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

GridRangeInfo object and PopulateCaluesMethod

When i specify a GridRangeInfo onject usind cells(1,1,10,1) and pass this in to a PopulateValues call, it works fine, however if i specify a gridrangeinfo object using Col(1), the grid does not populate. Any ideas?

3 Replies

AD Administrator Syncfusion Team June 18, 2003 01:49 PM UTC

Before passing the column range, call range.ExpandRange(1, 1, grid.RowCount, grid.ColCount) to change the column range to a cell range. If you look at a column range, its Bottom member is a huge value. Using ExpandRange converts these value to viable numbers.


TM Trevor Moody June 19, 2003 12:17 PM UTC

Clay, thanks for that. A second question though, if I pass an array list into a PopulateValues call, where the Arraylist contains objects with a series of properties, is there a way to control which column each property maps to on the grid, whilst using Populatevalues in this way. Thanks Trevor


AD Administrator Syncfusion Team June 19, 2003 05:46 PM UTC

No. If you want to control the order, you woul dhave to do the looping your self, pulling in the right property for the current col index. In your loop, you would use code similar to this to populate things quickly and avoid teh event processing that slows thing down when you use indexers.
//loop on rowIndex and colIndex
GridStyleInfo style = new GridStyleInfo();
style.CellValue = item; //your value...
SetCellInfo(rowIndex, colIndex, style, StyleModifyType.Override, true, true);

Loader.
Live Chat Icon For mobile
Up arrow icon