FoxPro Programming
HtmlDataGrid Grouping
Gravatar is a globally recognized avatar based on your email address. HtmlDataGrid Grouping
  Kathy
  All
  Jan 1, 2022 @ 10:55am

Hello and Happy New Year!
Wishing you all the best for the New Year of 2022.

Would you please let me know if we can have both sorting and grouping features on HtmlDataGrid.
This is for a grid that gets generated in Foxpro by using wwScripting approach and I've been thinking of using HtmlDataGridConfig::OnAfterRowRender for grouping but I'm not sure if we can have the sorting feature for different columns while maintaining grouping.
I would appreciate any tip.

Thanks,
Kathy

Gravatar is a globally recognized avatar based on your email address. re: HtmlDataGrid Grouping
  Rick Strahl
  Kathy
  Jan 2, 2022 @ 03:42pm

You can do grouping via injection using the row rendering events. That should also work if you're sorting, as the sorting happens to the data before it gets rendered. Since the events fire as the data is rendered, it should already be ordered by the time you get the row events to handle the grouping logic. Assuming the grouping logic doesn't change due to the sorting this should just work.

I think one of the samples in the documentation describes grouping via OnBeforeRowRendered().

Gravatar is a globally recognized avatar based on your email address. re: HtmlDataGrid Grouping
  Kathy
  Rick Strahl
  Jan 3, 2022 @ 07:17am

I'll test it ASAP.
Thank you so much for the confirmation and the hints.
Kathy

© 1996-2024