Hi all,
either this Wednesday is a Monday or I am just a bit too stupid to get it right today.
I have a GridView which has a CheckBoxColum. Now I want to set the checkbox to checked in one row when the GridView is bound based on a value that is sorted in another field in the datasource. The value is only know on Startup and is determinded by another Function.
However, when I enable the code the application seems to go into an endless-loop - it keeps repeating the "CellFormatting"-Event on and on and never starts up.
The datasource of the grid is a List of objects that is collected and then bound on Startup and in this test-Scenario contains 3 elements. As soon as I delete the code shown below the application starts up without any Problems.
Any help would be appreciated. Thank you.
This is the code:
either this Wednesday is a Monday or I am just a bit too stupid to get it right today.
I have a GridView which has a CheckBoxColum. Now I want to set the checkbox to checked in one row when the GridView is bound based on a value that is sorted in another field in the datasource. The value is only know on Startup and is determinded by another Function.
However, when I enable the code the application seems to go into an endless-loop - it keeps repeating the "CellFormatting"-Event on and on and never starts up.
The datasource of the grid is a List of objects that is collected and then bound on Startup and in this test-Scenario contains 3 elements. As soon as I delete the code shown below the application starts up without any Problems.
Any help would be appreciated. Thank you.
This is the code:
private void gvPersonalKeys_CellFormatting(object sender, Telerik.WinControls.UI.CellFormattingEventArgs e) { if (e.CellElement.ColumnInfo is GridViewCheckBoxColumn) { GridCheckBoxCellElement box = (GridCheckBoxCellElement)e.CellElement; string value = e.CellElement.RowInfo.Cells["Serialnumber"].Value.ToString(); if (value == "738F") box.Value = true; else box.Value = false; } }