I am having some issues with a column in my band that is set as a UnboundCheckBoxField. The design is for users to select (check) desired rows that they wish to use. This can be as small as 1 row, or all rows generated if necessary. From here they press save and the code behind iterates each row looking for the checked property to be true. All processes after this, when a selected row is found, function as desired.
The problem I am facing is occurring right after the button is clicked. If at least 1 row is selected there seems to be a random chance that before the code behind for the click event even fires every row that was generated in the band is now checked (E.g. Of 56 rows, 1 is selected. Before the first line of the click event is read all 56 checkboxes are checked).
This of course runs the chance of every generated row being saved when a user only wanted 1 or 2. As now the iteration is processing every row.
There is a HeaderCheckBoxMode="Off" property included as well in the column to allow users to easily select all rows if they so choose. Removing this property however seems to fix the concern but if a user requires all rows it would be best to leave this feature in place as well. We have been working with WebDataGrids with check-boxes as well and find no issues using them there. This problem occurs only within WebHierarchicalDataGrid and a Band.
Wondering if this is a known concern or there is a workaround that secures the checked properties?
<ig:Band Key="ChildBand_0" AutoGenerateColumns="False" DataKeyFields="prj_code,Phase,Task"
<ig:UnboundCheckBoxField Key="Select" HeaderCheckBoxMode="Off" >
Hello Sheila,Thank you for the detailed description you have provided of the issue.The desired behavior you have described would be strongly dependent on the exact settings you have used for the WebHierarchicalDataGrid.Presuming your "Save" button uses a server-side handler, you can iterate all child rows for a specific row and get the value for their "Select" cells by using the following code-snippet:
// Child rows of the first parent row.
var firstRowChildren = hierDataGrid.GridView.Rows.RowIslands.Rows;
string checkedChildren = string.Empty;
// Iterate child rows.
foreach (var childRow in firstRowChildren)
// Get the checkbox value of the current child row.
var selectValue = (childRow as GridRecord).Items.Value; // 4th item is the cell of 'Select' column.
if (selectValue is bool && ((bool)selectValue))
// If the checkbox value is true, append the value from the "Description" cell of the child row to our string.
// Here you can populate a collection of your choice with the checked child rows.
checkedChildren += (childRow as GridRecord).Items.Value + "<br/>"; // 1st item is the cell of 'Description' column.
label.Text = checkedChildren;