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
45
get cell value from band of a hierarchical ultragrid
posted

hi,

Plz can someone help me to know how to get cell value from a band of a hierarchical ultragrid ???  

ex: i want to get the cell value at the "Customer" Column, 6Th Row in a band named "Band_3".

And Plz how to get the rowcount of a Band ?

Appreciated.

  • 12480
    Suggested Answer
    Offline posted

    Hi,

    A band in a grid represents a set of columns. It's more like the schema then the actual data. For this reason, knowing the band isn't enough to access a specific row that uses that band. You would need to know the parent row. For example, if your data looked like this:

    Root 0
       Child 00
       Child 01
    Root 1
       Child 10
       Child 11

    You could access Child 10 with the following code:
    UltraGridRow row = ultraGrid1.Rows[1].ChildBands[0].Rows[0]

    If you wanted to access the value of the cell in the "Customer" column, you could then use this code:
    row.Cells["Column 0"].Value

    Value returns an object, so you might cast it to a string to display it on another control.

    Please let me know if this explanation helps you meet your requirement.

    ultraGrid1.Rows[1].ChildBands[0].Rows[0]