Click or drag to resize

PageDataGridDataItemClassOnSetColumnsDisplayIndex Method

Set columns display order (index)

Namespace:  SOWIWin.Helper
Assembly:  SOWIWin.Helper (in SOWIWin.Helper.dll) Version: 19.1.23.1 (19.1.23.622)
Syntax
protected virtual void OnSetColumnsDisplayIndex(
	Object sender,
	EventArgs e
)

Parameters

sender
Type: SystemObject
Sender is a PageDataGridUI object
e
Type: SystemEventArgs
Without parameter
Remarks
Method is a event from object PageDataGridUI.

Normally puts columns order by DataGridView object (must a instance) property Order

Examples
Standard use the DataGridView object. When uses a SOWI Win standard DataGrid Controller so puts the columns display order in SetViewBag.

For a example see SetViewBag

Another way is overwrite this method and puts the columns display order. See following example:

this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("ID")].DisplayIndex = 0;
this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("ClientID")].DisplayIndex = 1;
this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("Identification")].DisplayIndex = 2;
this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("Group")].DisplayIndex = 3;
this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("Name")].DisplayIndex = 4;
this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("LanguageIn")].DisplayIndex = 5;
this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("LanguageOut")].DisplayIndex = 6;
this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("TextIn")].DisplayIndex = 7;
this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("TextOut")].DisplayIndex = 8;
this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("Flag")].DisplayIndex = 9;
See Also