Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1650
Cell Values
posted

What are the possible ways to get the cell values?

Here is some background:

I have a grid with 2 visible column. Basically like a property grid, Labels on the left and vaues on the right.

Each row is an item in what will become a filter. What I am looking to do is get all the values of the cells.

I have attempted to do this in the Validating event but have been unable to get to the needed data...

 

Any ideas??

Parents
No Data
Reply
  • 37774
    posted

    Do you need to loop through all of the rows in the grid?  It's hard to suggest exactly which approach is best without knowing how you want to use it, but there is a Value property on a cell, or the GetCellValue property on the Row (which has the benefit of not forcing the cell to be created if it isn't already).  If you need to loop through all the rows in the grid, and your grid isn't hierarchical, you could do something like:

    foreach (UltraGridRow row in this.ultraGrid1.Rows)
    {
        foreach (UltraGridColumn col in this.ultraGrid1.DisplayLayout.Bands[0].Columns)
        {
            object cellValue = row.GetCellValue(col);

            // Do things with cell value
        }
    }

    -Matt

Children