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
85
How can i get UltraGridColumn by UltraGridRow?
posted

Now, I have a member UltraGridRow row. I want to get the column collection by the  row  and find the max value of the specific column. how can i do ?

Parents
  • 21795
    Offline posted

    Hello Steve,

    To get the columns of the band where the row is you can use code like this:
    ColumnsCollection columns = row.Band.Columns;

    Regarding the max value it is depending on from which values you need the max one. You may iterate all the columns in particular row like this:

    foreach(UltraGridCell cell in row.Cells)
    {
        var cellValue = cell.Value;
        //  TODO: Get the max one
    }

    or you may iterate the rows in particular column like this:

    UltraGridBand band = row.Band;
    foreach(UltraGridRow r in band.GetRowEnumerator(GridRowType.DataRow))
    {
        var cellValue = r.GetCellValue(col);
        //  TODO: Get the max one
    }

    or you can combine both these and iterate entire band. For additional information about how to loop through entire grid you may check this article in our online documentation “Looping Through the Entire Grid”.

    Please let me know if any additional questions on this matter arise.

Reply Children
No Data