We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Error in composite header in Syncfusion.Windows.Forms.Grid.GridDataBoundGrid

hello. i have a trouble

it's my very simple code


private Syncfusion.Windows.Forms.Grid.GridDataBoundGrid anGrid;

anGrid.Model.Rows.HeaderCount = anGrid.Model.Rows.FrozenCount = 2;

anGrid.Model.CoveredRanges.Add(GridRangeInfo.Cells(0, 1, 2, 1));
anGrid.Model.CoveredRanges.Add(GridRangeInfo.Cells(0, 2, 2, 2));
anGrid.Model.CoveredRanges.Add(GridRangeInfo.Cells(0, 3, 2, 3));
anGrid.Model.CoveredRanges.Add(GridRangeInfo.Cells(0, 4, 2, 4));
anGrid.Model.CoveredRanges.Add(GridRangeInfo.Cells(0, 5, 2, 5));

anGrid.Model.CoveredRanges.Add(GridRangeInfo.Cells(0, 6, 0, 11));
anGrid.Model.CoveredRanges.Add(GridRangeInfo.Cells(1, 6, 1, 7));
anGrid.Model.CoveredRanges.Add(GridRangeInfo.Cells(2, 6, 2, 6));
anGrid.Model.CoveredRanges.Add(GridRangeInfo.Cells(2, 7, 2, 7));
anGrid.Model.CoveredRanges.Add(GridRangeInfo.Cells(1, 8, 1, 9));
anGrid.Model.CoveredRanges.Add(GridRangeInfo.Cells(2, 8, 2, 8));
anGrid.Model.CoveredRanges.Add(GridRangeInfo.Cells(2, 9, 2, 9));
anGrid.Model.CoveredRanges.Add(GridRangeInfo.Cells(1, 10, 1, 11));
anGrid.Model.CoveredRanges.Add(GridRangeInfo.Cells(2, 10, 2, 10));
anGrid.Model.CoveredRanges.Add(GridRangeInfo.Cells(2, 11, 2, 11));

anGrid[1, 6].Text = "1";
anGrid[1, 8].Text = "2";
anGrid[1, 10].Text = "3";
//ALL RIGHT!
try
{
anGrid[2, 6].Text = "5";
}
catch (Exception ex)
{
ERROR!
Specified argument was out of the range of valid values. Parameter name: rowIndex


}

anGrid.Refresh();


Can you help me? it's very important for me


4 Replies

AD Administrator Syncfusion Team March 3, 2009 02:59 PM UTC

Hi Infine,

Thanks for your interest in Syncfusion products.

I checked with the code you provided with a normal datatable binded to griddataboundgrid. I couldn't get any error. Please provide more details about the data and how the columns binded to gdbg in your application.

Regards,
Rajadurai



AD Administrator Syncfusion Team March 3, 2009 03:45 PM UTC

Hi Rajadurai,

Thanks for reply

That code executing before data binding. i just want to get empty table with such caption



AD Administrator Syncfusion Team March 3, 2009 03:49 PM UTC

i have version 6.4.0.15



RC Rajadurai C Syncfusion Team March 4, 2009 04:10 PM UTC

Hi Infine,

A GridDataBoundGrid normally holds no data. The data comes from the datasource and is just displayed in the grid. The error thrown in the provided code is because of not setting the column count explicitly.

gridDataBoundGrid1.Model.ColCount = 10;


You cannot display the text which are set in some cells without binding griddataboundgrid to datasource.

Regards,
Rajadurai


Loader.
Live Chat Icon For mobile
Up arrow icon