I have a C# Win ultraGrid with several groups and several users under each group.
I have a name (hidden) an alias. I made it so when you right click it, there's an option to reset the alias to the name by:
this.ultraGridUsers.Selected.Rows[0].Cells["Alias"].Value
= this.ultraGridUsers.Selected.Rows[0].Cells["UnitID"].Text
Is there a way to reset the whole grid? I tried:
this.ultraGridUsers.Rows[0].Cells["Alias"].Value = this.ultraGridUsers.Rows[0].Cells["UnitID"].Text;
but it's giving me a 'key' error.
Doh, I thought "using System.Collections.Generic;" covered it.
Thanks for all your help.
Add in the file "using area":
using System.Collections;
I'm not familiar with Enumerators at all, so I looked up some Infragistics docs and came up with this:
UltraGridBand band = this.ultraGridUsers.DisplayLayout.Bands[1];
IEnumerable enumerator = band.GetRowEnumerator(rowTypes);
foreach (UltraGridRow row in enumerator)
{
row.Cells["Alias"].Value = row.Cells["UnitID"].Text;
}
It seems promising, the only thing is the IEnumerable part, throwing an error:
Error 3 Using the generic type 'System.Collections.Generic.IEnumerable<T>' requires '1' type arguments.
Thanks for your continued help.
It doesn't work since the Rows property in the grid are only the first band rows, not the users rows. In order to get all second band rows use:
grid.Rows.GetRowEnumerator(GridRowType.DataRow, grid.DisplayLayout.Bands[1], null)
That's only if it's selected. I want to do it for all UserIDs and Aliases that exist in that grid.
I tried removing the 'Selected' in those statements but it didn't work.