I'm using Fran's favorite win control, UltraWinGrid v 2005.2 and LLBLGen 1.2005.1 with self servicing.
The UltraWinGrid is bound to an entity collection and when I click on a row in the grid, I'd like to get that row's entity.
What I've been doing is something like this:
collection = this.ultraGrid.DataSource as collection;
if ((collection != null) && (collection .Count >= e.Cell.Row.Index) )
{
entity = collection [e.Cell.Row.Index];
}
else
return;
// proceed with entity manipulation
The problem with this is that the UltraWinGrid is sorted and so the Grid.Row.Index property is returning the index of the selected row in the grid (say 1) but, that Index property doesn't match the collection's index; i.e. collection[Row.index] returns the wrong entity.
I don't think the bug is with the LLBLGen collection code, but rather Infragistics is not returning the index of the row in the "parent collection" as the summary for the Row.Index property states.
I'm going to contact Infragistics as well to see what they recommend for getting the current row's underlying data source, but have you all had this problem and do you know of a work around?
Thanks.