I have a 'MessagesGrid'.
On a checkedchanged event i get the current row:
CheckBox selectedCheckBox = (CheckBox)sender;
GridRecord row =((GridRecordItem)((Infragistics.Web.UI.TemplateContainer)selectedCheckBox.Parent).Item).Row;
Then i want to select a row or unselect it:
if (selectedCheckBox.Checked)
{
MessagesGrid.Behaviors.Selection.SelectedRows.Add(row);
}
else
MessagesGrid.Behaviors.Selection.SelectedRows.Remove(row);
But everytime i get back into my function, the selectrows.count = 0.
Why are the selected rows not persisted between postbacks?
Hi djmartain,
If MessagesGrid is a WebHierarchicalDataGrid, you should not be selecting rows on it. You should select it in the behavior of the grid that the row belongs to. You should be able to get access to the Grid from the row.
regards,David Young