I try to put CheckBox in the headers of my GridDataBoundGrid.
I have 2 nested relation. My Checkbox box are located in the third row, the row of the second relation.
I use your example "How to put a checkbox in headers". I can see them, but when i click on one of them i have this Exception:
"
System.ArgumentOutOfRangeException: L''argument spécifié n''était pas dans les limites de la plage des valeurs valides.
Nom du paramètre : rowIndex
at Syncfusion.Collections.SFTable.set_Item(Int32 rowIndex, Int32 colIndex, Object value)
at Syncfusion.Windows.Forms.Grid.GridRowCollection.set_Item(Int32 rowIndex, Int32 colIndex, GridStyleInfoStore value)
at Syncfusion.Windows.Forms.Grid.GridData.set_Item(Int32 rowIndex, Int32 colIndex, GridStyleInfoStore value)
at Syncfusion.Windows.Forms.Grid.GridModel.SetCellInfo(Int32 rowIndex, Int32 colIndex, GridStyleInfo style, StyleModifyType modifyType, Boolean dontRaiseSaveCellInfoEvent, Boolean copyReferenceOnly)"
I have to double click on the checkbox to check them, and it takes a long time.
Any Ideas?
thx.
jerome
PS: my code
private void Model_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
{
if(e.RowIndex==2)
{
e.Style.CellValueType = typeof(string);
if(CheckedHeaders.Contains(e.ColIndex))
e.Style.CellValue = (string) CheckedHeaders[e.ColIndex];
e.Style.CheckBoxOptions = new GridCheckBoxCellInfo(true.ToString(), false.ToString(), "", true);
e.Style.CellType = "CheckBox";
e.Style.CellAppearance = GridCellAppearance.Raised;
e.Style.Enabled = true;
}
}
private void Model_SaveCellInfo(object sender, GridSaveCellInfoEventArgs e)
{
if(e.RowIndex==2)
{
if (e.Style.CellValue!=null)
CheckedHeaders[e.ColIndex] = (string) e.Style.CellValue;
e.Style.Enabled = true;
}
}
JE
jerome
January 18, 2006 03:54 PM UTC
Sorry, i forgot: I m using version 3.3
Regards,
jerome
AD
Administrator
Syncfusion Team
January 19, 2006 01:33 PM UTC
Hi Jerome,
Try setting Model.Data.RowCount with Model.RowCount after setting the datasource to see if this helps.
this.gridDataBoundGrid1.Model.Data.RowCount = this.gridDataBoundGrid1.Model.RowCount;
Regards,
Calvin.
JE
jerome
January 19, 2006 01:47 PM UTC
Thx a lot,
it works very well,
jerome