0

I use janus gridex datagridview, In first column type is CheckBocx, I want to check if current row selected is checked or not, but my code not working

if(DBGrid.CurrentRow.Cells["CheckBoxColumn"].Value == true)
{
    // do something
}

2 Answers2

0

If the row is 'ActAsSelector = True' then you can use the row level checking itself :

if(DBGrid.CurrentRow.IsChecked)
{
    // do something
}

Otherwise you need to cast the value to Boolean.

if((bool)DBGrid.CurrentRow.Cells["CheckBoxColumn"].Value == true)
{
  // do something
}
Makesh
  • 335
  • 4
  • 15
0

If the row is 'ActAsSelector = True', you can use itself :

var CheckedList = string.Join(",", 
    gridEX1.GetCheckedRows()
        .Cast<Janus.Windows.GridEX.GridEXRow>()
        .Select(x => x.Cells["ID"].Text)
        .ToArray());
abdusco
  • 9,700
  • 2
  • 27
  • 44