Click or drag to resize

ControllerDataGridDataItemClass Class

Inheritance Hierarchy
SystemObject
  SOWIWin.HelperPageDataGridDataItemClass
    SOWIWin.HelperControllerDataGridDataItemClass

Namespace:  SOWIWin.Helper
Assembly:  SOWIWin.Helper (in SOWIWin.Helper.dll) Version: 19.1.23.1 (19.1.23.622)
Syntax
public abstract class ControllerDataGrid<DataItemClass> : PageDataGrid<DataItemClass>, 
	IControllerDataGrid

Type Parameters

DataItemClass
data item class based of IDataStandard

The ControllerDataGridDataItemClass type exposes the following members.

Constructors
Properties
Methods
  NameDescription
Public methodCopy
Copy the selected data item to his data grid
(Inherited from PageDataGridDataItemClass.)
Private methodCopyItem
Copies a object 1:1
(Inherited from PageDataGridDataItemClass.)
Public methodCode exampleCopyToClipboard
Copy the selected data items to clipboard
(Inherited from PageDataGridDataItemClass.)
Public methodCopyToClipboard(IList)
Copy data items to clipboard
(Inherited from PageDataGridDataItemClass.)
Public methodDataRefresh
Refresh user interface data table view
(Inherited from PageDataGridDataItemClass.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetColumnIndexByName
Give column index by column name
(Inherited from PageDataGridDataItemClass.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodCode exampleInsertFromClipboard
Insert data items from clipboard
(Inherited from PageDataGridDataItemClass.)
Public methodCode exampleLoad
Load all data items with object AppModule method GetAll
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodCode exampleOnCollectionChanged
Data items changed handling
(Inherited from PageDataGridDataItemClass.)
Protected methodCode exampleOnCopy
Event copy from object DataGrid (DataGridMain)
(Inherited from PageDataGridDataItemClass.)
Protected methodOnCopyToClipboard
Called method CopyToClipboard(IList). Can be overridden.
(Inherited from PageDataGridDataItemClass.)
Private methodOnPaste
Insrt from clipboard
(Inherited from PageDataGridDataItemClass.)
Protected methodOnRemove
Data item remove of datagrid
(Inherited from PageDataGridDataItemClass.)
Protected methodCode exampleOnSetColumn
Puts column with a selection list (ComboBox object, when exist a ListName)
(Inherited from PageDataGridDataItemClass.)
Protected methodCode exampleOnSetColumnsDisplayIndex
Set columns display order (index)
(Inherited from PageDataGridDataItemClass.)
Protected methodCode exampleOnSetColumnsReadOnly
Set column field edit or read only
(Inherited from PageDataGridDataItemClass.)
Protected methodCode exampleOnSetColumnsVisibility
Set columns visibility.
(Inherited from PageDataGridDataItemClass.)
Public methodSetData
Set data to DataItems and PageDataGridUI.DataGridMain.DataContext
(Inherited from PageDataGridDataItemClass.)
Public methodCode exampleSetViewBag
Puts values of objects:
NameDescription
DataGridViewPuts Data Grid View from object PageDataGrid
TempDataPuts data list for selection
Public methodCode exampleToCopy
Copy a data item. Put properties: ID 0, Action Create, Status Create and empty GUID
(Inherited from PageDataGridDataItemClass.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodCode exampleUpdate
Data items was changed update to database.
Public methodCode exampleValidate
Data items validation with AppModule method Validate. Is data item not valid then show a message on desktop.
Top
Fields
Extension Methods
  NameDescription
Public Extension MethodGetObjectToBytes
Convert an object to byte array
(Defined by Extensions.)
Public Extension MethodIsNumber
Check is value a number
(Defined by Convert.)
Public Extension MethodToHTMLDisplay(DataGrid, TempDataDictionary)Overloaded. (Defined by Extensions.)
Public Extension MethodCode exampleToHTMLDisplay(String, DataGridDataTypes, String, String, String, String, TempDataDictionary)Overloaded.
Gives HTML code for display.
(Defined by Extensions.)
Public Extension MethodToHTMLEditor(DataGrid, TempDataDictionary, String)Overloaded. (Defined by Extensions.)
Public Extension MethodToHTMLEditor(String, DataGridDataTypes, String, String, String, TempDataDictionary, Boolean, String, DataPlacements, String, String)Overloaded.
Gives HTML code for Input field
(Defined by Extensions.)
Public Extension MethodCode exampleToHTMLHidden(String)Overloaded.
Gives HTML code for hidden data
(Defined by Extensions.)
Public Extension MethodToHTMLHidden(DataGrid)Overloaded.
Gives HTML code for hidden data
(Defined by Extensions.)
Public Extension MethodXMLWrite
Gives XML string from data item
(Defined by Helper.)
Top
Remarks
Note Note
Syntax controller name: [name]Controller

Suffix Controller e.g. TicketController

This controller has two main elements:

The AppModule object is data handling and must elments (methods, properties) from interface IAppControllerDataItemClass

The PageDataGridDataItemClass is user interface

Class overview

Requirement

Assembly references: PresentationCore, PresentationFramework, WindowsBase
Examples

Class overview

Constructor MainWindow

public MainWindow()
{
    InitializeComponent();
    this.FrameDataGridView.Content = null;
    this.FrameDictionary.Content = null;
    SetForm();
}

Method SetForm

private void SetForm()
{
    this.DataGridView = null;
    this.DictionaryUI = null;
    if(true)
    {
        this.DataGridView = new Controllers.DataGridViewController(this.Database.ConnectionString, this.UserName);
        this.FrameDataGridView.Content = this.DataGridView.PageDataGridUI;
        this.DictionaryUI = new Controllers.DictionaryUIController(this.Database.ConnectionString, this.UserName);
        this.FrameDictionary.Content = this.DictionaryUI.PageDataGridUI;
    }
}

Method Load

Can called by event RibbonButtonDataLoad_Click
private void Load()
{
    this.FrameDataGridView.Content = DataGridView.Load();
    this.FrameDictionary.Content = DictionaryUI.Load();
}

Method Update

Can called by event RibbonButtonDataUpdate_Click.

This example update all data grids.

private void Update()
{
    DataGridView.Update();
    DictionaryUI.Update();
}
This code example update the selection data grid.
switch (TabPageIndex)
{
    case Tabs.none:
        break;
    case Tabs.DataGridView:
        DataGridView.Update();
        break;
    case Tabs.Dictionary:
        DictionaryUI.Update();
        break;
    case Tabs.SQL:
        break;
    default:
        break;
}
See Also