One of my grids cell is having valuelist. I need to Set Project Management which is at 13th index of the values list as default cell value , whenever my grid displays
Here is what I did, that might be useful for other guy if got stucked in similar situation
on after row insert event, i am using this code:
Dim Index as integer
Dim classItem as object = e.row.cells("mycolumnname").valuelistresolved.GetValue("Project Management",-1) '' this gives me the associated value of the Project Management text
e.row.cells("mycolumnname").value = classitem '' this will set the item with underlying value in classItem, In my case its 16 , so 16 is set as value of current cell.
Setting the SelectedItemIndex on the ValueList might work, but it's not very reliable. This will only work if the ActiveCell in the grid happens to be a cell in the column.
It would be a lot easier and more reliably to simply set the Value of the grid cell.
right now i am using this lien of code but its doing nothing
.Bands(0).Columns(SERVICE_ISSUE_CLASS).ValueList.SelectedItemIndex = .Bands(0).Layout.ValueLists(CLASSES).FindString("Project Management", -1)