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
60
Disable GroupBy feature on certain columns only programmatically in XamDataGrid
posted

I am not defining FieldLayouts before hand and dynamically binding the Collection of data to the grid at runtime. I have names of certain properties of this data on whom I want to disable the GroupBy feature.
For e.g., if I have data on cities I want to prevent grouping by pincode as pincodes are unique and grouping by that doesn't make sense.

Is it possible to do this programmatically in XamDataGrid?

Parents
No Data
Reply
  • 16495
    Offline posted

    Hello,

     

    Thank you for your post.

     

    I have been looking into your requirement and I am not sure that I understand it correctly. What I can suggest in order to be able to achieve the functionality that you are looking for  is to handle Loaded event of XamDataGrid. In the event handler you can access the Field you want and set it`s AllowGroupBy property to false, so you will disable the ability to group the grid by  this field. I created short sample application based on your scenario to show you how you can implement this approach. Please let me know  if I am missing something about your scenario and  if this is still an issue for you send me, an isolated sample project , where this is reproduced or modify my sample application with the functionality that you are using, so I can investigate it further for you.

     

    Please let me know if you need any further assistance on the matter.

    DisableGroupingOnCertainFields.zip
Children