Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
330
Changing value of a cell
posted

Ok, this has been driving me crackers for a couple of hours now.  I'm a newbie to UltraGrid

I have a databound UltraGrid.  I added an extra column with an icon and text in it with the following:-

private void ugrBlah_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
{
  // Add new column for padlock (if it's not already there)
  if (!e.Layout.Bands[0].Columns.Contains("IsLocked"))
   e.Layout.Bands[0].Columns.Add("IsLocked", "Locked");
}

private void ugrBlah_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
{
  e.Row.Cells["IsLocked"].Appearance.Image = Properties.Resources.padlock;
  e.Row.Cells["IsLocked"].Value = "Cheese";
}

Which works fine... I get a nice padlock icon with "Cheese" next to it.  Padlocked cheese.

But then, in response to a button click, I want the currently selected / lit / active row to change icon and text.  I've tried the following:-

ugrBlah.ActiveRow.Cells["IsLocked"].Value = "Cake";
ugrBlah.ActiveRow.Cells["IsLocked"].Appearance.Image = Properties.Resources.padlock_open;

It changes the icon, but not the text Value.

I have tried ...ActiveRow.Update(), and ugrBlah.Refresh(), both to no avail.

Any ideas anybody?

Parents Reply Children
No Data