column grouping

Discussion in 'C#' started by omosis2, May 19, 2016.

  1. omosis2

    omosis2 New Member

    Joined:
    May 19, 2016
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    In dapfor wpf gridcontrol I would like to know how column grouping is done.
     
  2. andlaty4real

    andlaty4real New Member

    Joined:
    May 19, 2016
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Dapfor allows you to perform different functions which includes column grouping.

    Most frequent methods of working with data grouping are shown below:
    C#
    Header header = ...;
    Code:
    Column column1 = header["Column1"]; 
    Column column2 = header["Column2"]; 
    column1.Grouped = true; 
    
    //Group the content by the first column 
    column1.Grouped = true; 
    
    //Turn on multiple grouping 
    column2.Grouped = true; 
    Debug.Assert(header.GroupedColumns[0].Id == "Column1"); 
    Debug.Assert(header.GroupedColumns[1].Id == "Column2"); 
    Debug.Assert(column1.GroupIndex == 0); 
    Debug.Assert(column2.GroupIndex == 1); 
    Debug.Assert(header.GroupedColumns.Count == 2); 
    
    //Enumerate all grouped columns 
    foreach (Column column in header.GroupedColumns) 
    { 
        //Some code here... 
    } 
    
    //Ungroup the content 
    header.GroupedColumns.Clear();
     
  3. Ami Desai

    Ami Desai Member

    Joined:
    Jan 5, 2017
    Messages:
    42
    Likes Received:
    17
    Trophy Points:
    8
    Location:
    Ahmedabad
    Home Page:
    http://www.ifourtechnolab.com/
    Hi,

    You can check this

    Code:
    Header header = ...;
    
    Column column1 = header["Column1"];
    Column column2 = header["Column2"];
    column1.Grouped = true;
    
    //Group the content by the first column
    column1.Grouped = true;
    
    //Turn on multiple grouping
    column2.Grouped = true;
    Debug.Assert(header.GroupedColumns[0].Id == "Column1");
    Debug.Assert(header.GroupedColumns[1].Id == "Column2");
    Debug.Assert(column1.GroupIndex == 0);
    Debug.Assert(column2.GroupIndex == 1);
    Debug.Assert(header.GroupedColumns.Count == 2);
    
    //Enumerate all grouped columns
    foreach (Column column in header.GroupedColumns)
    {
        //Some code here...
    }
    
    //Ungroup the content
    header.GroupedColumns.Clear();
    Thanks
     
    shabbir likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice