ControllerDataGridDataItemClassSetViewBag Method | |
Puts values of objects:
Name | Description |
---|
DataGridView | Puts Data Grid View from object PageDataGrid |
TempData | Puts data list for selection |
Namespace:
SOWIWin.Helper
Assembly:
SOWIWin.Helper (in SOWIWin.Helper.dll) Version: 19.1.23.1 (19.1.23.622)
Syntax Remarks
This method must override because has no code
Examples
This example puts object value of DataGridView (hides all standard fields)
public override void SetViewBag()
{
int lOrder = 0;
List<SOWIData.Management.DataGrid> lDataGridView = new List<SOWIData.Management.DataGrid>();
lDataGridView.Add(new SOWIData.Management.DataGrid("ID", lOrder++));
lDataGridView.Add(new SOWIData.Management.DataGrid("GUID", lOrder++));
lDataGridView.Add(new SOWIData.Management.DataGrid("ClientID", lOrder++));
lDataGridView.Add(new SOWIData.Management.DataGrid("Name", lOrder++));
lDataGridView.Add(new SOWIData.Management.DataGrid("NameOriginalValue", lOrder++));
lDataGridView.Add(new SOWIData.Management.DataGrid("Label", lOrder++));
lDataGridView.Add(new SOWIData.Management.DataGrid("Description", lOrder++));
lDataGridView.Add(new SOWIData.Management.DataGrid("DateTimeValue", lOrder++));
lDataGridView.Add(new SOWIData.Management.DataGrid("Value", lOrder++));
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++));
lDataGridView.Add(new SOWIData.Management.DataGrid("CreateUser", lOrder++));
lDataGridView.Add(new SOWIData.Management.DataGrid("LastEditDate", lOrder++));
lDataGridView.Add(new SOWIData.Management.DataGrid("LastEditUser", lOrder++));
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;
}
This example puts a selection list for field Name
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("Name", lOrder++, true, true)
{
ListName = "ListName"
});
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
}
This example puts a selection list from App
#region --- selection list ---
santesuisseApp.Register lAppRegister = new santesuisseApp.Register();
List<SOWIData.IDataStandard> lListRegister = lAppRegister.GetListStandard();
#endregion
#region --- TempData ---
this.TempData = new Dictionary<string, object>();
this.TempData.Add("ListRegister", lListRegister);
#endregion
This example implemented in App class and gives a selection list for DataGrid
public List<SOWIData.IDataStandard> GetListStandard()
{
return this.GetList().ToList<SOWIData.IDataStandard>();
}
See Also