Hi,
I have a valuelist attached to one of my columns in the ultragrid. One of the options in the list (say :- "Add object") opens up a dialog where i select some object , click OK and then come back to the parent form. Here when i try to set this newly added object as the selectedItem in the cell , i see that CellList_Select operation is not giving me the row's visible index or List index , both these properties are coming as "-1".
Any ideas what is going on here?
Thanks,
Keerti Somasundaram
Hi Keerti,
I'm really not sure I understand the issue. It sounds like you are saying that you are launching a dialog from the CellListSelect event and then doing something, but it's not clear what. There is no SelectedItem property on a cell, so I don't understand what you are setting. And the event args for CellListSelect do not return an index, just a cell.
So it's very unclear to me what you are doing. It sounds like maybe you are accessing the ValueList of the cell and trying to set the cell's Value or Text by setting the SelectedIndex on the ValueList, but that's not a good idea. The ValueList services the entire column and it's really not good to use the ValueList to change the cell programmatically. You would be better off setting the Value property on the cell.
Mike,
I figured out the issue , the index properties on the CellEventArgs object were getting set to -1 because of some datasource updation events that were happening in the background fired by me. I verfied this by tracking the events and noticing that before i open this child dialog i can see that CellEventArgs.Cell.Row.VisibleIndex gives me the correct value.
I guess we can close this issue. Thanks for your quick reply.
Thanks - Keerti