GDBG GridListControl Revisited

Thread ID:

Created:

Updated:

Platform:

Replies:

When processing a PopupClosedEventArgs on a GBDG with a GridListCOntrol, I''m using the following code from an earlier post to extract the selected value:
GridDataBoundGrid grid = (GridDataBoundGrid) sender;
GridCurrentCell cc = grid.CurrentCell;
cc.EndEdit();
grid.Binder.EndEdit();
string dispMember = grid[cc.RowIndex, cc.ColIndex].FormattedText;
If the GDBG DataSource returned no rows and a GridListControl record is selected from a cell on the lone empty row, this works perfect. Also, if the GridListControl record is selected on a GDBG row which has data in that cell already, the code works perfect.
However,if the GDBG DataSource returned rows, and a GridListControl record is selected from a cell on the empty row following the last GBDG record, the cc.RowIndex has a negative value for the index.
Thanks

Are you seeing any exceptions being thrown. For example, if you have a column that does not accept nulls, then this will have to be populated before you can end the edit on teh record.
Here is a little sample that seems to be working OK for me. Does it work ok for you?
http://www.syncfusion.com/Support/user/uploads/GDBG_GLC_e94e2717.zip

Clay,
The supplied URL does not seem to work.
>Are you seeing any exceptions being thrown. For example, if you have a column that does not accept nulls, then this will have to be populated before you can end the edit on teh record.
>
>Here is a little sample that seems to be working OK for me. Does it work ok for you?
>
>http://www.syncfusion.com/Support/user/uploads/GDBG_GLC_e94e2717.zip
>

Also,
I noticed the cc.RowIndex does not go negative until the grid.Binder.EndEdit() is called.
Thanks,
>Clay,
>
>The supplied URL does not seem to work.
>
>>Are you seeing any exceptions being thrown. For example, if you have a column that does not accept nulls, then this will have to be populated before you can end the edit on teh record.
>>
>>Here is a little sample that seems to be working OK for me. Does it work ok for you?
>>
>>http://www.syncfusion.com/Support/user/uploads/GDBG_GLC_e94e2717.zip
>>