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
290
WinGridCell - Set the index of the ValueList on RowInsert
posted

Hi, 

I am wondering how I can set the index of a ValueList that is assigned to a WinGridCell.

For example I've assigned a list to the cell at the InitialiseLayout event


grid.DisplayLayout.Bands[0].Columns["ColumnName"].ValueList = ValueList object.


Which is all well and good.


So basically when a user goes to enter a new row, I want to set the SelectedIndex of that valuelist in the cell to 0.

I have tried,


private void grid_AfterRowInsert(object sender, Infragistics.Win.UltraWinGrid.RowEventArgs e)
{

try
{

switch (e.Row.Band.Index)
{
case 0:

 e.Row.Cells["ColumnName"].ValueList.SelectedItemIndex = 0;


}


}...

But this errors by saying the ValueList is NULL, but as you see, I've assigned the ValueList at the InitialiseLayout event. 

Any help would be good. 

Thanks

Chris   

Parents
  • 290
    posted

    Ok as I was reading my post, I worked out I was assigning the ValueList in the InitialisedLayout event to the "column" object and checking in the AfterRowInsert event checking  against the cell object, which is why it was a NULL, I am guessing that you need to work with the column object and not the cell in this case?

Reply Children