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
75
WebDataGrid Cell Selection Bug
posted

Hello,

I have a WebDataGrid control which contains both BoundDataFields and TemplateDataFields. Paging is enabled. Within the TemplateDataFields I have an image for Delete and an image for Edit. When the user clicks on the image I capture the cell id via the CellSelectionChanged event and then I edit or delete the row as appropraite. This all works perfectly when on the first page. However if the user navigates to the second page the CellSelectionChanged event does not pick up the ID of the selected row.

The code for the CellSelectionChanged event is below. When on the second page the e.CurrentSelectedCells.count = 1 but e.CurrentSelectedCells[0] is null? Any ideas?

if (e.CurrentSelectedCells[0] != null)
{

// Get the values we need from the selected row

GridRecordItem thisRecord = e.CurrentSelectedCells[0];
_selectedRowID =


Convert.ToInt32(thisRecord.Row.Items[0].Value);
_selectedRowType = thisRecord.Row.Items[1].Value.ToString();

}