Home Forums WinForms controls Xceed Grid for WinForms Force grouping update?

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

    Is it possible to force an update to the grouping in a grid. I’m manually grouping using the QueryGroupKeys event, but updating a cell doesn’t fire this event. It seems to only fire upon adding or removing a row. I want to update the grouping whenever editing of a specific cell has been left. Is this possible?

    Imported from legacy forums. Posted by macke (had 4267 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi Marcus,

    Have you tried the gridControl.UpdateGrouping(); method? Perhaps simply by calling this method you will obtain the desired behavior? Please let me know if I missed something.

    Imported from legacy forums. Posted by Matt (had 339 views)

    User (Old forums)
    Member
    Post count: 23064

    I did indeed, but instead of getting the desired effect, the value of the cell changed back to it’s original value. This is when calling the method from the EditLeft event. So I tried calling it from the ValueChanged event, in which case all the rows disappear, or becomes invisible or whatever is happening. It’s just empty anyways.

    I’m grouping manually. Since the value I wish to group by is in a detail grid and I want the grouping to reside in the root grid, I figured this is the way I have to do it. So I simply do this in the QueryGroupKeys event:

    private void OnQueryGroupKeys(object sender, QueryGroupKeysEventArgs e)
    {
    MemberRow memberRow = FindByMemberID(e.DataRow);
    MemberStatus status = (MemberStatus)memberRow.Status;

    e.GroupKeys[0] = Enums.GetDescription(status);
    }

    and in the ValueChanged event:

    private void OnValueChanged(object sender, EventArgs e)
    {
    grid.UpdateGrouping();
    }

    Imported from legacy forums. Posted by macke (had 447 views)

    User (Old forums)
    Member
    Post count: 23064

    Try forcing a EndEdit on the row that is currently being edited in your ValueChanged event, this should take care of it :). The Grouping will not be updated whilst there is a row in edition.

    Imported from legacy forums. Posted by Matt (had 202 views)

    User (Old forums)
    Member
    Post count: 23064

    I changed the body of the event handler to look like such:

    private void OnValueChanged(object sender, EventArgs e)
    {
    Cell memberStatusCell = sender as DataCell;
    memberStatusCell.ParentRow.EndEdit();
    grid.UpdateGrouping();
    }

    However, I get the same result as before when I had just the UpdateGrouping() call in there.

    Imported from legacy forums. Posted by macke (had 331 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi Macke,

    Let’s do this in a closed channel so I can keep good track of your case and have the developers give me a hand. Can you send me your details at matt@xceedsoft.com, we will work on this together personally :).

    Imported from legacy forums. Posted by Matt (had 332 views)

    User (Old forums)
    Member
    Post count: 23064

    Ok, I sent you an email (actually two, forgot the attachment in the first ;o)). Sorry for not getting back to you sooner, Real Life (TM) got in the way.

    Imported from legacy forums. Posted by macke (had 5713 views)

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