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
20
Change Column Name
posted

Hi, how do I change a column name in run-time (code behind) ??

Is there something like    xamDataGrid1.Columns("Code").Caption = "Our Code"  ????

 

 

Thanks

 

Gustavo

Parents
  • 6867
    posted

    Each Field has a Label property, to which you can assign a user-friendly display name for the column.  To change the Label of an auto-generated Field, I suggest you handle the FieldLayoutInitialized event of the XamDataGrid and run code like this:

    void XamDataGrid_FieldLayoutInitialized(object sender, FieldLayoutInitializedEventArgs e)
    {
        foreach (Field field in e.FieldLayout.Fields)
            field.Label = GetLabelFromFieldName(field.Name);
    }

Reply Children
No Data