How do I completely clear out any grouping done by the user, server-side for a WHDG? I am trying to reset a grid completely w/this following code:
With igWHDG
.GroupingSettings.GroupedColumns.Clear()
.GroupingSettings.ColumnSettings.Clear()
'.GroupingSettings.EnableColumnGrouping = False
.DataSource =
Nothing
.DataKeyFields =
""
With .GridView
.Band.GroupingSettings.GroupedColumns.Clear()
.Band.GroupingSettings.ColumnSettings.Clear()
.ClearDataSource()
.Behaviors.Sorting.SortedColumns.Clear()
.Behaviors.Filtering.ClearBehaviorColumnInfo()
.Behaviors.Filtering.ColumnFilters.Clear()
'.Behaviors.Filtering.ApplyFilter()
.ResetToDefault()
End With
.RefreshBehaviors()
This does everything I want except that the group rows are still present in the grid (and clicking on one causes a javascript errors).
Hello Wallace,
I have created a sample which reproduces your issue in the way I understood it from the details described in your post. Note that this is a web site to run it you need to add ig_res folder. In order to do that you just need to turn into design mode and the folder will be automatically added to your project.
If you have any other questions, please do not hesitate to contact us. I will be really glad if I had helped in this situation.
Looking forward to hear from you.
Sincerely,
Georgi Sashev
Developer Support Engineer
Infragistics, Inc.
http://es.infragistics.com/support
Hmm, it looks like your example just added a databind() after setting the datasource to nothng, but that didn't work for me. In my example attached:
Hi all,
I have a similar problem, I'm doing the following:
.GridView.GroupedRows.Clear(); .GroupingSettings.GroupedColumns.Clear();.GridView.ClearDataSource();
In this case the grouped rows are removed, but a button without label
is still in the grouping zone of the header instead of the default
text 'Drag a column here to group by.'.
If I use your tip, .GroupingSettings.EnableColumnGrouping = Infragistics.Web.UI.DefaultableBoolean.False
the user is not able to do a new grouping because now the grouping
header where to drop columns is gone.
Do you have any other suggestion?
Thanks,
Gustavo
OK, that works. Thanks,
In this case when you have grouping this means that you have your EnableViewState="true" which will save your grouping, so to prevent saving this and completely clear your grid you need to clear the grouping like this:
.GroupingSettings.EnableColumnGrouping = Infragistics.Web.UI.DefaultableBoolean.False
Please find your sample modified as an attachment.
I hope this helped in your situation.
For any further assistance please, do not hesitate to contact us.