Click or drag to resize

PageDataGridDataItemClassOnSetColumnsVisibility Method

Set columns visibility.

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

Parameters

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

Normally puts columns visibility by DataGridView object (must a instance) property WinListVisible

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

For a example see SetViewBag

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

protected override void OnSetColumnsVisibility(object sender, EventArgs e)
{
    Visibility lShow = Visibility.Visible;
    Visibility lHidden = Visibility.Hidden;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("ID")].Visibility = lShow;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("GUID")].Visibility = lShow;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("ClientID")].Visibility = lShow;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("Name")].Visibility = lShow;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("NameOriginalValue")].Visibility = lHidden;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("Label")].Visibility = lShow;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("Description")].Visibility = lShow;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("DateTimeValue")].Visibility = lHidden;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("Value")].Visibility = lHidden;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("Text")].Visibility = lHidden;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("Flag")].Visibility = lHidden;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("Checked")].Visibility = lHidden;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("Selection")].Visibility = lHidden;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("ColorUI")].Visibility = lHidden;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("ActionText")].Visibility = lShow;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("ActionDB")].Visibility = lHidden;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("TaskText")].Visibility = lShow;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("Task")].Visibility = lHidden;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("StatusText")].Visibility = lShow;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("Status")].Visibility = lHidden;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("CreateDate")].Visibility = lShow;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("CreateUser")].Visibility = lShow;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("LastEditDate")].Visibility = lShow;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("LastEditUser")].Visibility = lShow;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("DeleteDate")].Visibility = lShow;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("DeleteUser")].Visibility = lShow;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("Archive")].Visibility = lShow;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("Help")].Visibility = lHidden;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("Database")].Visibility = lHidden;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("ChangeTracker")].Visibility = lHidden;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("Configuration")].Visibility = lHidden;
}
Set columns visibility by view options
private void SetColumnsVisibility()
{
    Visibility lShow = Visibility.Hidden;
    Visibility lWin = (this.ViewWinValues == true ? Visibility.Visible : Visibility.Hidden);
    Visibility lWeb = (this.ViewWebValues == true ? Visibility.Visible : Visibility.Hidden);
    Visibility lMobil = (this.ViewMobilValues == true ? Visibility.Visible : Visibility.Hidden);
    Visibility lDefault = (this.ViewOnlyDefaultValues == false ? Visibility.Visible : Visibility.Hidden);
    Visibility lStandardFields = (this.ViewStandardFields == true ? Visibility.Visible : Visibility.Hidden);

    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("ViewName")].Visibility = lShow;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("DataFieldTypeText")].Visibility = lShow;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("Order")].Visibility = lDefault;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("ColumnLabel")].Visibility = lDefault;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("WinListVisible")].Visibility = lWin | lDefault;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("WinListVisibleDefault")].Visibility = lWin;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("WebListVisible")].Visibility = lWeb | lDefault;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("WebListVisibleDefault")].Visibility = lWeb;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("MobilListVisible")].Visibility = lMobil | lDefault;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("MobilListVisibleDefault")].Visibility = lMobil;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("ID")].Visibility = lStandardFields;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("GUID")].Visibility = lStandardFields;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("ClientID")].Visibility = lStandardFields;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("Name")].Visibility = lStandardFields;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("NameOriginalValue")].Visibility = lShow;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("Label")].Visibility = lStandardFields;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("Description")].Visibility = lStandardFields;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("DateTimeValue")].Visibility = lStandardFields;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("Value")].Visibility = lStandardFields;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("Text")].Visibility = lStandardFields;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("Flag")].Visibility = lStandardFields;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("Checked")].Visibility = lStandardFields;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("Selection")].Visibility = lStandardFields;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("ActionText")].Visibility = lShow;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("ActionDB")].Visibility = lStandardFields;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("TaskText")].Visibility = lShow;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("Task")].Visibility = lShow;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("StatusText")].Visibility = lShow;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("Status")].Visibility = lStandardFields;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("CreateDate")].Visibility = lStandardFields;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("CreateUser")].Visibility = lStandardFields;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("LastEditDate")].Visibility = lStandardFields;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("LastEditUser")].Visibility = lStandardFields;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("DeleteDate")].Visibility = lStandardFields;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("DeleteUser")].Visibility = lStandardFields;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("Archive")].Visibility = lStandardFields;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("Help")].Visibility = lStandardFields;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("Database")].Visibility = lShow;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("ChangeTracker")].Visibility = lShow;
    this.PageDataGridUI.DataGridMain.Columns[GetColumnIndexByName("Configuration")].Visibility = lShow;
}
See Also

Reference

PageDataGridDataItemClassOnSetColumnsVisibility(Object, EventArgs)