I''m using a GridControl and populating it by sending an array (created at runtime) to the grid.
Is there any way of setting the BaseStyle of a specific cell when using PopulateValues? I assume PopulateValues is just a fast way of getting raw data into the grid without any formating.
Will I need to use the Indexer to populate the grid, and set the cell style as I loop through the rows and columns?
ADAdministrator Syncfusion Team January 7, 2005 12:18 AM
Populate values does not support setting styles.
You will have to loop through the individual cells you want to set. Using an indexer on the grid to set the styles (grid[row,col].BackColor = x) does raise events. If you are only doing a few cells, then you will not notice this, but if you have many such cells to populate, then you should call SetCellInfo, passing true and false for the last two arguments.
/// Changes the cell contents at a specific row and column index and allows you to suppress raising events
/// and also avoid copying the style objects.
/// The row index.
/// The column index.
/// The object that holds cell information.
/// A that specifies the style operation to be performed.
/// A that indicates if the operation was successful.
/// If True, the method will not raise the event.
/// If True, the method will try to assign the style object directly. This is only possible if the
/// existing cell was empty before or if modifyType is . Otherwise it will apply the object as
/// specified in modifyType.
public bool SetCellInfo(int rowIndex, int colIndex, GridStyleInfo style, StyleModifyType modifyType, bool dontRaiseSaveCellInfoEvent, bool copyReferenceOnly)
STStephen TrinderJanuary 9, 2005 12:57 PM
Thanks a lot for that! I am trying to get the most speed I can out of my app, and your help so far has been great!