Hi guys,
Im sure there is some obvious im missing, but the problem i have is that i have a grid with 3 columns. Column 1 has report name, Column 2 - a checkbox column to 'show' that report, Column 3 - a checkbox column to 'hide' that report. So if a user clicks the checkbox in 'Show' column, i want to uncheck the 'Hide' checkbox column (ie column 2) and vice versa. The code below handles it, however the grid only refreshes the change once i move off the current row... So what do i need to call so that the cells or row is repainted instantly once this code runs? Also should i instead use the CellValueChanged event? coz that didnt seem to work, hence why i chose this event here. Also do i even need to call BeginEdit and EndEdit here? Im not quite sure when those methods should be used.
Thanks for your advice :-) Chris.
private void gridReport_ValueChanged(object sender, EventArgs e)
{
RadCheckBoxEditor editor = (RadCheckBoxEditor)sender;
editor.BeginEdit();
SUB_REPORT report = (SUB_REPORT)gridReport.CurrentCell.RowInfo.DataBoundItem;
if (gridReport.CurrentCell.ColumnIndex == 1) // show column
{
if ((bool)editor.Value)
{
report.Hide = false;
}
}
else
{
if ((bool)editor.Value)
{
report.Show = false;
}
}
editor.EndEdit();
}
Im sure there is some obvious im missing, but the problem i have is that i have a grid with 3 columns. Column 1 has report name, Column 2 - a checkbox column to 'show' that report, Column 3 - a checkbox column to 'hide' that report. So if a user clicks the checkbox in 'Show' column, i want to uncheck the 'Hide' checkbox column (ie column 2) and vice versa. The code below handles it, however the grid only refreshes the change once i move off the current row... So what do i need to call so that the cells or row is repainted instantly once this code runs? Also should i instead use the CellValueChanged event? coz that didnt seem to work, hence why i chose this event here. Also do i even need to call BeginEdit and EndEdit here? Im not quite sure when those methods should be used.
Thanks for your advice :-) Chris.
private void gridReport_ValueChanged(object sender, EventArgs e)
{
RadCheckBoxEditor editor = (RadCheckBoxEditor)sender;
editor.BeginEdit();
SUB_REPORT report = (SUB_REPORT)gridReport.CurrentCell.RowInfo.DataBoundItem;
if (gridReport.CurrentCell.ColumnIndex == 1) // show column
{
if ((bool)editor.Value)
{
report.Hide = false;
}
}
else
{
if ((bool)editor.Value)
{
report.Show = false;
}
}
editor.EndEdit();
}