I have a GridListControl that I have set the ColCount = 11. This is done in the OnQueryColCount method. When I try to assign a cell value at column 11, I get the error "Specified argument was out of the range of valid values. Parameter name: colIndex".
ADAdministrator Syncfusion Team March 31, 2004 03:06 PM
The GridListControl holds no data, it is the DataSource that you assign to the GridListControl that holds the data. So, you cannot set a value in any column. Instead you would normally set it in the DataSource that you have assigned to the GridListControl, an dthe GridListControl gets it from the DataSource.
If you want to dynamically set the column count using QueryColCount, then you would also need to handle QueryCellInfo, and provide the value by setting e.Style.CellValue based on the e.ColIndex and e.RowIndex values. (This is how you ''set'' the value. You provide it on demand in QueryCellInfo).
MCMichael CorriganApril 1, 2004 07:22 AM
This is how I am setting the column headers:
gcAgentBonus.Grid[0,9].CellValue = "Level 1";
gcAgentBonus.Grid[0,10].CellValue = "Level 2";
but once I get to column 11:
gcAgentBonus.Grid[0,11].CellValue = "Bonus";
this is when the exception occurs. Am I not setting the column headers correctly?
ADAdministrator Syncfusion Team April 1, 2004 07:29 AM
Normally, you would furnish the headers in QueryCellInfo. The reason the work up to 10, is that the default values of gcAgentBonus.Grid.RowCount and gcAgentBonus.Grid.ColCount are set to 10 x 10. And it is these default values that allow your code to work up to 10.
One thing you could try is just setting gcAgentBonus.Grid.ColCount = 11. This would allocate the space for 11 columns an dlikely allow you code setting the headers to work. This would likely be fine as long as teh number of columns is small.