Click or drag to resize

PageDataGridDataItemClassOnSetColumn Method

Puts column with a selection list (ComboBox object, when exist a ListName)

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

Parameters

sender
Type: SystemObject

[Missing <param name="sender"/> documentation for "M:SOWIWin.Helper.PageDataGrid`1.OnSetColumn(System.Object,System.Windows.Controls.DataGridAutoGeneratingColumnEventArgs)"]

e
Type: System.Windows.ControlsDataGridAutoGeneratingColumnEventArgs

[Missing <param name="e"/> documentation for "M:SOWIWin.Helper.PageDataGrid`1.OnSetColumn(System.Object,System.Windows.Controls.DataGridAutoGeneratingColumnEventArgs)"]

Remarks
Note for selection list: it's TempData object type of Dictionary then puts Key and Value otherwise ID and Name
Examples
This example defintion a column with a selection list.
/// <summary>
/// Set View Bag define Data Grid View
/// </summary>
public override void SetViewBag()
{
    #region --- DataGridView ---
    int lOrder = 0;
    List<SOWIData.Management.DataGrid> lDataGridView = new List<SOWIData.Management.DataGrid>();
    lDataGridView.Add(new SOWIData.Management.DataGrid("ID", lOrder++, true));
    lDataGridView.Add(new SOWIData.Management.DataGrid("GUID", lOrder++));
    lDataGridView.Add(new SOWIData.Management.DataGrid("ClientID", lOrder++));
    lDataGridView.Add(new SOWIData.Management.DataGrid("Name", lOrder++, true, true)
    {
        ListName = "ListName"
    });
    lDataGridView.Add(new SOWIData.Management.DataGrid("NameOriginalValue", lOrder++));
    lDataGridView.Add(new SOWIData.Management.DataGrid("Label", lOrder++, true, true));
    lDataGridView.Add(new SOWIData.Management.DataGrid("Description", lOrder++));
    lDataGridView.Add(new SOWIData.Management.DataGrid("DateTimeValue", lOrder++));
    lDataGridView.Add(new SOWIData.Management.DataGrid("Value", lOrder++, true, true));
    lDataGridView.Add(new SOWIData.Management.DataGrid("Text", lOrder++));
    lDataGridView.Add(new SOWIData.Management.DataGrid("Flag", lOrder++));
    lDataGridView.Add(new SOWIData.Management.DataGrid("Checked", lOrder++));
    lDataGridView.Add(new SOWIData.Management.DataGrid("Selection", lOrder++));
    lDataGridView.Add(new SOWIData.Management.DataGrid("ActionText", lOrder++));
    lDataGridView.Add(new SOWIData.Management.DataGrid("ActionDB", lOrder++));
    lDataGridView.Add(new SOWIData.Management.DataGrid("TaskText", lOrder++));
    lDataGridView.Add(new SOWIData.Management.DataGrid("Task", lOrder++));
    lDataGridView.Add(new SOWIData.Management.DataGrid("StatusText", lOrder++));
    lDataGridView.Add(new SOWIData.Management.DataGrid("Status", lOrder++));
    lDataGridView.Add(new SOWIData.Management.DataGrid("CreateDate", lOrder++, true));
    lDataGridView.Add(new SOWIData.Management.DataGrid("CreateUser", lOrder++, true));
    lDataGridView.Add(new SOWIData.Management.DataGrid("LastEditDate", lOrder++, true));
    lDataGridView.Add(new SOWIData.Management.DataGrid("LastEditUser", lOrder++, true));
    lDataGridView.Add(new SOWIData.Management.DataGrid("DeleteDate", lOrder++));
    lDataGridView.Add(new SOWIData.Management.DataGrid("DeleteUser", lOrder++));
    lDataGridView.Add(new SOWIData.Management.DataGrid("LastUser", lOrder++));
    lDataGridView.Add(new SOWIData.Management.DataGrid("Archive", lOrder++));
    lDataGridView.Add(new SOWIData.Management.DataGrid("Help", lOrder++));
    lDataGridView.Add(new SOWIData.Management.DataGrid("ColorUI", lOrder++));
    lDataGridView.Add(new SOWIData.Management.DataGrid("Database", lOrder++));
    lDataGridView.Add(new SOWIData.Management.DataGrid("ChangeTracker", lOrder++));
    lDataGridView.Add(new SOWIData.Management.DataGrid("Configuration", lOrder++));

    this.DataGridView = lDataGridView;

    #endregion

    #region --- ListName ---
    Dictionary<string, string> lListName = new Dictionary<string, string>();
    lListName.Add("Ja", "Ja");
    lListName.Add("Nein", "Nein");
    #endregion

    #region --- TempData ---
    this.TempData = new Dictionary<string, object>();
    this.TempData.Add("ListName", lListName);
    #endregion

}
See Also