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
240
setting groupby in code - when to trigger?
posted

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...

Parents
No Data
Reply
  • 40030
    Verified Answer
    Offline posted

    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

Children