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
150
Column headers for dynamic data?
posted

My setup: I'm loading data into a DataTable at server-side. In my app I'm binding the DataTable to a UltraGridDatasource where I've defined some of the columns that are in the DataTable. The rest of the columns are dynamic in the DataTable and the amount varies depending on the data. The UltraGridDatasource is then bound to an UltraGrid.

My problem: When I bind the UltraDataSource to the grid the column caption is the same as the key in the DataTable, even though I've set a different caption for the columns I've defined in the UltraGridDatasource. It seems that the UltraGridDatasource overrides settings and uses the DataTable keys as captions for all columns when the DataTable includes dynamic (undefined) data columns.

My question: How can I mix data so that the column captions, for defined columns in the UltraGridDatasource, are based on defined values and dynamic columns use the DataTable column / UltraGridDatasource column key as the caption?

Parents
No Data
Reply
  • 469350
    Suggested Answer
    Offline posted

    Hi,

    ltoivola said:
    My setup: I'm loading data into a DataTable at server-side. In my app I'm binding the DataTable to a UltraGridDatasource where I've defined some of the columns that are in the DataTable. The rest of the columns are dynamic in the DataTable and the amount varies depending on the data. The UltraGridDatasource is then bound to an UltraGrid.

    There's no such thing as UltraGridDatasourceas far as I know. So I assume you mean UltraDataSource here.

    ltoivola said:
    My problem: When I bind the UltraDataSource to the grid the column caption is the same as the key in the DataTable, even though I've set a different caption for the columns I've defined in the UltraGridDatasource. It seems that the UltraGridDatasource overrides settings and uses the DataTable keys as captions for all columns when the DataTable includes dynamic (undefined) data columns.

    This doesn't make sense to me. If the grid is bound to an UltraDataSource, then it has no connection or reference to your Datatable, The UltraDataSource has no way to reference a DataTable, either. So how could it possibly be using the keys from the DataTable? What you are suggesting here is simply not possible.

    ltoivola said:
    My question: How can I mix data so that the column captions, for defined columns in the UltraGridDatasource, are based on defined values and dynamic columns use the DataTable column / UltraGridDatasource column key as the caption?

    If you are binding a grid to an UltraDataSource, then the column captions and keys come from the UltraDataSource. So you can choose whatever column keys and captions you want.

    You also have the option of changing the column captions in the grid via the column.Header.Caption property.

Children