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
75
Accessing grid columns in same sequence in which they are visible
posted

Hi, I need to access columns of infragistics ultragrid in same sequence in which they are being displayed in grid. If i can get the index of column in same sequence as they are visible on grid, i can fix my issues. Thanks in advance. Lalit

  • 12773
    posted

    Hello ,

    You can look at this tread, here is a information how to access the visible position of the columns:

    http://forums.infragistics.com/forums/p/25572/93767.aspx#93767

    I hope this helps.


    Sincerely,
    Dimitrina Gineva
    Developer Support Engineer
    Infragistics, Inc.

  • 469350
    Suggested Answer
    Offline posted

    It's rather complicated to try to do this using VisiblePosition. Here's a better way:


                UltraGridColumn column = this.ultraGrid1.DisplayLayout.Bands[0].GetFirstVisibleCol(this.ultraGrid1.ActiveColScrollRegion, true);
                while (column != null)
                {
                    Debug.WriteLine(column.Header.Caption);
                    column = column.GetRelatedVisibleColumn(VisibleRelation.Next);
                }

  • 815
    Offline posted

    You can get this value from the .Header.VisiblePosition property from the column object.  This controls the order that columns are displayed in the grid.