I'm trying to set the groupbysettings in code. My columns are auto generated after setting the data context. I have the code to set the column list, but do not see an event that will tell me the grid is ready for me to set the groupbysettings...
Hey Mike,
So, there isn't an event that fires that lets you know when you can set the GroupBy. Basically the way the grid loads its data is dependent on when you set it. If you set the ItemSource before the xamWebGrid's Loaded event, it waits until the xamWebGrid has been loaded. Otherwise, if you're setting your DataContext after it's been loaded, the xamWebGrid will load it's itemsSource immediately, which is when the Column's are generated.
Note:, as soon as you have access to your Columns, you can set the IsGroupBy property and have them grouped.
-SteveZ
Thanks for the speedy response :)
So can I set IsGroupBy in the initialize row event?
You could do that... But you're going to be hitting that code for every row in your ItemsSource.
Gotcha :)
I reorganized the code to make sure I set the data context after the load event occurs. Then I set my group by list and column visibility inline right after that.
Now it works beautifully :)
1000 thank you's !!
-Mike