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
215
UltraGrid columns sort order is different than Datatable column sort order. Why ?
posted

I create a datatable and assign it to UltraGrid datasource. The sort order from datatable is not preserved.

e.g. Datatable column sort order (col1, col2, col3). UltraGrid Column sort order (col1, col3, col2).

I want to preserve the UltraGrid column sort order to the sort order in DataTable

e.g. Datatable column sort order (col1, col2, col3).UltraGrid Column sort order (col1, col2, col3).

Please advice

---------------------------------------Here is the code i use.---------------------------

            DataTable _table = new DataTable();

            for (int i = 0; i < _colKeys.Length; i++)
            {
                if (!_table.Columns.Contains(_colKeys[i]))
                {
                    _table.Columns.Add(_colKeys[i], typeof(string));
                    _table.Columns[_colKeys[i]].Caption = _colNames[i];
                }
            }

            _table.Rows.Add(_table.NewRow());   // Value row
            _table.Rows.Add(_table.NewRow());   // NAV row
            _mSummaryGrid.DataSource = _table;

Parents Reply Children
No Data