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
345
DataTable Column Captions
posted

Hi,

I'm using a DataTable as the Datasource for a xamDataGrid. I have set the column captions for the columns directly on the datatable, but the grid is still using the column names as captions when it is displayed on screen. Is there a property / setting I'm missing that will make the grid use the captions instead of the names?

Thanks,
Jacquers

 

 

 

Parents
No Data
Reply
  • 69686
    posted

    Hello Jacquers.

    The names of the Fields in the XamDataGrid have to exactly the same as the names of the Columns in the DataTable. If not, the grid will do that automatically. You can set the Label property of the Field to what you want to be displayed as text, but the Name has to be the same.

    You should also set AutoGenerateFields to False, to ensure that the XamDataGrid will not generate them automatically.

    For example:

    <igDP:Field Name="FirstName" Label="Employee First Name" />

    and the column's name in my DataTable is "FirstName".

    You can also take a look at the example in the XamFeatureBrowser regarding Field Layouts.

    Hope this helps,

    Alex.

Children