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

Locating unset cell in GridControl

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

1 Reply

AD Administrator Syncfusion Team August 4, 2005 05:19 PM

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
     }
}
            

Loader.
Live Chat Icon For mobile
Up arrow icon