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
450
Commit/Cancel TemplateRow When A Column Is Grouped
posted

Hi,

When no columns are grouped, we are using the TemplateAddRow functionality to insert new rows into our grid.  We also have grouping functionality enabled.  When a user chooses to group by a column while the AddRow has pending changes, it includes that row in the groupings even though it hasn't been committed yet.  If you ungroup that column, you again see your pending changes but you experience some odd behavior after this point...

I'm looking for a way to either attempt to commit the changes when a column is grouped, or just cancel all the changes for the AddRow when a column is grouped.  I can't seem to find any event that fires at the time a column is grouped.  Any help here?

 

Thanks,

~Corey

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    Hi Corey,

    Grouping and sorting are tightly linked together. So what you can do is trap the BeforeSortChange event. You con use the event args to determine if any grouping changes are taking place by examining the SortedColumns collection and check the IsGroupBy property on the each column in the collection. You will have to compare the new sorted columns passed into the event with the actual SortedColumns collection on the band.

    If there has been a change, then you can call UpdateData on the grid or Update on the ActiveRow to commit the changes. Or you could all CancelUpdate, if you prefer.

Children
No Data