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.
Unfortunately, activation email could not send to your email. Please try again.

GridRangeInfo object and PopulateCaluesMethod

Thread ID:

Created:

Updated:

Platform:

Replies:

5082 Jun 18,2003 08:15 AM Jun 19,2003 01:46 PM Windows Forms 3
loading
Tags: GridControl
Trevor Moody
Asked On June 18, 2003 08:15 AM

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?

Administrator [Syncfusion]
Replied On June 18, 2003 09:49 AM

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.

Trevor Moody
Replied On June 19, 2003 08:17 AM

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

Administrator [Syncfusion]
Replied On June 19, 2003 01:46 PM

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);

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;