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
1050
field customization at codebehind instead of xaml
posted

Hi,

I have a query that brings the data and i set dirctly to the datagrid.

I want to do the customization at c# codebehind level..

to add the fields dynamically and set the alignments,cellwidth etc...

any help?

Parents
No Data
Reply
  • 8576
    Offline posted
    Hi -
     
    You can:
    • listen to the XamDataGrid's FieldLayoutInitializing event (the FieldLayout is passed into the event in the FieldLayoutInitializingEventArgs)
    • set the FieldLayout.Settings.AutoGenerateFields property to false (this prevents the Fields from being automatically generated based on the fields discovered in the DataSource)
    • create Field objects with the settings you want and add them to the FieldLayout.Fields collection
    Joe
     
Children
No Data