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
220
How to Add New Group At Run time
posted

Sir,

  I want to group the rows in the WinGrid, based on a column in the Gird.

 Eg.. I have a dataset, with columns Name, Address, City, State...

 Now i want to Group the record based on State and then with in the State, i want to group by City.. I dont want to provide the  group by box to the user. i want to group it by myself in the code.

 Kindly help me to resolve this issue...

 Thanks

 R.Vasanth

Parents
  • 469350
    Verified Answer
    Offline posted

    To group a column in code, you add it to the SortedColumns collection. The add method has an overload that take a boolean parameter for GroupBy. So it looks something like this.

     
            private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
            {
                e.Layout.Bands[0].SortedColumns.Add("My Column", false, true);
            }

Reply Children