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.
Syncfusion Feedback

Locating unset cell in GridControl

Thread ID:

Created:

Updated:

Platform:

Replies:

32640 Aug 4,2005 09:08 PM UTC Aug 4,2005 10:19 PM UTC Windows Forms 1
loading
Tags: GridControl
Robert Linder
Asked On August 4, 2005 09:08 PM UTC

Hello, I am loading an Access database with n1 columns and n2 rows in a GridControl, so I can check if there are any missing cells. I can count the number of DataRows processed to see if it matches RowCount * ColCount. If there is a mismatch, I want to check the column count for each row. When row does not have the correct number of columns, then I want to loop thur the row to detect the missing. I am unable to find the method/property to call to get colcount for a row. I tried ''GridCellCollection cellRows= OntraTableGrid.Data.Rows[1]''to collect the row data, but cellRows is null Robert

Administrator [Syncfusion]
Replied On August 4, 2005 10:19 PM UTC

In a GridControl, the only column count is given by grid.ColCount. There is no concept of a varying number of columns per row. All rows can hold grid.ColCount entries, and the grid does not track whether some rows have all cells populated and some do not. You could loop thru the grid.Data object and test what entried are null.
for(int row = 1; row <= this.grid.RowCount; ++row)
{
   for(int col = 1; col <= this.grid.ColCount; ++col)
    {
        //if grid.Data[row, col] == null, the cell is empty
     }
}
 

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.

Warning Icon 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.Close Icon

;