Click or drag to resize

Data Grid View Data Type List

This document present declaration and implementation of SOWI Data Grid View of data type List

Overview
SOWIData Grid View Data Field Type List
Setup

Data Grid View setup in SOWI administrator tool Presentation Interface

Puts property CanEdit on and property ListName equal of TempData name

ScreenSOWIPresentation Interface
View

Use SOWI Web Foundation then it's already prepared (Edit, EditContent).

Presentation level: genered the view with extensions method e.g. into web application SOWIWeb.Helper.Extensions method ToHTMLEditor.

An code snippet example of EditContent

C#
if (itemDataGrid.CanEdit == true)
{
    @Html.Raw(SOWIWeb.Helper.HTML.FormGroupEditor(lValue, itemDataGrid, TempData))
}
Controller

Declaration data list in method SetViewBagList

Address controller example for choice the language

Important note Important

The TempData name must the same name of Data Grid View property ListName

C#
/// <summary>
/// Puts selection list: Language for user interface (UI)
/// </summary>
[NonAction]
protected override void SetViewBagList()
{
    TempData["LanguageUIList"] = AppAddress.GetLanguageUIs();
}
App

App Management Language example (code is cutted)

Important note Important

Data list must based on SOWI Data interface Data Standard

C#
/// <summary>
/// Language UI list use for selection list based by IDataStandard
/// </summary>
public List<SOWIData.IDataStandard> GetLanguageUIs()
{
    var lList = GetAll().Cast<SOWIData.IDataStandard>().ToList();
    lList = (from p in lList
              where p.Archive == false
              select p).ToList();
    return lList;
}
Data

Data list must based on SOWI Data Standard

The list uses fields ID and Name

See Also