Home Forums WinForms controls Xceed Grid for WinForms Grouping problem

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #15705 |

    Is it possible(and how) to create custom groups and populate it with data after user expands this group. I’m looking for functionality similar to those of treeview. In treeview you have Expanding event in which you can delete all child nodes of node that is expanding and repopulate it with new data. The basic idea is to first load all of the groups with plus signs so that user can expand the group regardless of is there any rows in the group, and after user expands the group to load all child rows.

    1. Is it possible to create custom group without any child rows
    2. Is it possible to catch expand/collapse event s of the custom group.
    3. Is it possible to delete all child rows of this group without destroying the group itself
    4. Is it possible to repopulate this group with new data

    Regards,
    Tomislav Kralj

    Imported from legacy forums. Posted by Tomislav (had 2929 views)

    Xceed Support
    Member
    Post count: 5658

    After checking with the developer, it’s not possible to create empty groups (without any child rows). The only one to “workaround” this problem would be to add invisible row to a group.

    However, it is possible:

    2. To catch expand/collapse event s of the custom group
    <code>
    Group group = new Group( “Column1” );
    group.CollapsedChanged += new EventHandler( group_CollapsedChanged );

    void group_CollapsedChanged( object sender, EventArgs e )
    {
    //…
    }
    </code>

    Imported from legacy forums. Posted by CharlesB (had 302 views)

    User (Old forums)
    Member
    Post count: 23064

    Thanks, and what about 3rd and 4th questions ?

    Imported from legacy forums. Posted by Tomislav (had 262 views)

    Xceed Support
    Member
    Post count: 5658

    For 3, it would be possible, but you would need to add an invisible row before. The problem is that if you are using <a href=”http://doc.xceedsoft.com/products/Xceedgrid/Xceed.Grid~Xceed.Grid.SummaryRow~TextFormat.html”>TextFormat</a&gt;, Statistical function like “COUNT” will not return the right numbers.

    For 4, you can simply add new rows to the group, like any other group.

    <code>
    Xceed.Grid.DataRow row = gridControl1.DataRows.AddNew();

    foreach( Cell cell in row.Cells )
    {
    cell.Value = … //The value on which the group is set
    }
    row.EndEdit();
    </code>

    Imported from legacy forums. Posted by CharlesB (had 3970 views)

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.