Class CursorGridViewControl
Control which inherit from GridViewControl and implement data handling with the simplic cursor system. The Grid can be filled by a simple select statement in the LoadData-Mehotd
Inheritance
Namespace: Simplic.Framework.DBUI
Assembly: Simplic.Framework.DBUI.dll
Syntax
public class CursorGridViewControl : GridViewControl
  Constructors
| Improve this Doc View SourceCursorGridViewControl()
Create new cursor based GridViewControl
Declaration
public CursorGridViewControl()
  Fields
| Improve this Doc View SourceKeyboardHandleRefreshData
Delegate which will be called, when the data should be refreshed using Control + R.
Declaration
public Action<CursorGridViewControl> KeyboardHandleRefreshData
  Field Value
| Type | Description | 
|---|---|
| Action<CursorGridViewControl> | 
Properties
| Improve this Doc View SourceAvailableColumns
get all columns which were loaded over the DB-Cursor
Declaration
public IList<string> AvailableColumns { get; }
  Property Value
| Type | Description | 
|---|---|
| IList<System.String> | 
ConnectionName
Get or set connection name
Declaration
public string ConnectionName { get; set; }
  Property Value
| Type | Description | 
|---|---|
| System.String | 
ForceFirstRowSelected
If set to true, the first row will be selected automatically
Declaration
public bool ForceFirstRowSelected { get; set; }
  Property Value
| Type | Description | 
|---|---|
| System.Boolean | 
InPlaceUpdate
Gets or sets whether to do in place data updates or make a full refresh
Declaration
public bool InPlaceUpdate { get; set; }
  Property Value
| Type | Description | 
|---|---|
| System.Boolean | 
ItemsAsDictionary
Get all selected items as a dictionary
Declaration
public IList<Dictionary<string, object>> ItemsAsDictionary { get; }
  Property Value
| Type | Description | 
|---|---|
| IList<Dictionary<System.String, System.Object>> | 
LastPreparedStatement
Gets or sets the last prepared statement
Declaration
public string LastPreparedStatement { get; set; }
  Property Value
| Type | Description | 
|---|---|
| System.String | 
MinPageSize
Minimal size of a grid page. Default value is 200.
Declaration
public int MinPageSize { get; set; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
PreparedSqlStatement
Return the last executed statement with parameter already replaced
Declaration
public string PreparedSqlStatement { get; }
  Property Value
| Type | Description | 
|---|---|
| System.String | 
ResolveDroppedDataStatement
Gets or sets the statement to resolve dropped data
Declaration
public string ResolveDroppedDataStatement { get; set; }
  Property Value
| Type | Description | 
|---|---|
| System.String | 
SelectedItemAsDictionary
Get one selected item as a dictionary
Declaration
public IDictionary<string, object> SelectedItemAsDictionary { get; }
  Property Value
| Type | Description | 
|---|---|
| IDictionary<System.String, System.Object> | 
SelectStament
Last executed select statement
Declaration
public string SelectStament { get; set; }
  Property Value
| Type | Description | 
|---|---|
| System.String | 
Methods
| Improve this Doc View SourceBeforePreparingSqlStatementEvent(BeforePreparingStatementEventArgs)
called before the underlying cursor executes the statement
Declaration
protected virtual void BeforePreparingSqlStatementEvent(BeforePreparingStatementEventArgs args)
  Parameters
| Type | Name | Description | 
|---|---|---|
| BeforePreparingStatementEventArgs | args | 
CancelLoading()
Aborts the current loading
Declaration
public void CancelLoading()
  Clear()
Clear items and cursor
Declaration
public void Clear()
  ClearPlaceholder()
Clear placeholder list
Declaration
public void ClearPlaceholder()
  CreateAndAddRow(IDictionary<String, Object>)
Add row by using drop data resolving sql
Declaration
public override void CreateAndAddRow(IDictionary<string, object> parameters)
  Parameters
| Type | Name | Description | 
|---|---|---|
| IDictionary<System.String, System.Object> | parameters | Parameters which will be passed to the sql statement  | 
      
Dispose()
Dispose dbcursor and grid
Declaration
public override void Dispose()
  DynamicSelectedItem()
Returns the currently selected item as dynamic object (based on CIExpandoObject)
Declaration
public dynamic DynamicSelectedItem()
  Returns
| Type | Description | 
|---|---|
| System.Object | 
GetDynamicItems()
returns all items in the itemscollection as dynamic this method might be an performance bottleneck
Declaration
public IList<dynamic> GetDynamicItems()
  Returns
| Type | Description | 
|---|---|
| IList<System.Object> | 
GetDynamicRow(ObservableDataRow)
Converts given DataRow item from the ItemsCollection to an dynamic CIExpandoObject
Declaration
public virtual CIExpandoObject GetDynamicRow(ObservableDataRow item)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ObservableDataRow | item | 
Returns
| Type | Description | 
|---|---|
| CIExpandoObject | 
GetDynamicRow(Int32)
Converts given item behind given rowIndex from the ItemsCollection to an dynamic CIExpandoObject
Declaration
public dynamic GetDynamicRow(int rowIndex)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.Int32 | rowIndex | 
Returns
| Type | Description | 
|---|---|
| System.Object | 
GetDynamicSelectedItems()
Returns OrderedSelectedItems as List of dynamic CIExpandoObjects
Declaration
public IList<dynamic> GetDynamicSelectedItems()
  Returns
| Type | Description | 
|---|---|
| IList<System.Object> | 
GetItemAsDictionary(Object)
Get specific item as dictionary
Declaration
public IDictionary<string, object> GetItemAsDictionary(object item)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.Object | item | Item to cast  | 
      
Returns
| Type | Description | 
|---|---|
| IDictionary<System.String, System.Object> | Null or instance of dictionary  | 
      
GetSelectedGuid(String)
Get selected cell value as Guid
Declaration
public Guid GetSelectedGuid(string columnName)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | columnName | Name of the column  | 
      
Returns
| Type | Description | 
|---|---|
| Guid | Value of the selected cell if exists  | 
      
GetSelectedGuids(String)
Declaration
public IList<Guid> GetSelectedGuids(string columnName)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | columnName | 
Returns
| Type | Description | 
|---|---|
| IList<Guid> | 
GetSelectedInt32(String)
Get selected cell value as int32 nullable
Declaration
public int? GetSelectedInt32(string columnName)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | columnName | Name of the column  | 
      
Returns
| Type | Description | 
|---|---|
| System.Nullable<System.Int32> | Value of the selected cell if exists  | 
      
GetSelectedInt64(String)
Get selected cell value as long null able
Declaration
public long? GetSelectedInt64(string columnName)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | columnName | Name of the column  | 
      
Returns
| Type | Description | 
|---|---|
| System.Nullable<System.Int64> | Value of the selected cell if exists  | 
      
GetSelectedString(String)
Get selected cell value as string
Declaration
public string GetSelectedString(string columnName)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | columnName | Name of the column  | 
      
Returns
| Type | Description | 
|---|---|
| System.String | Value of the selected cell if exists  | 
      
LoadAll()
Loads the entire result
Declaration
public void LoadAll()
  LoadAllAsync()
Loads the entire result asynchronous
Declaration
public void LoadAllAsync()
  OnPreviewKeyDown(KeyEventArgs)
Catch preview down and execute key actions
Declaration
protected override void OnPreviewKeyDown(KeyEventArgs e)
  Parameters
| Type | Name | Description | 
|---|---|---|
| KeyEventArgs | e | 
RefreshData()
Refresh/load data in the grid view. Cancel active loading threads
Declaration
public void RefreshData()
  RegisterPersistenceManager()
Register persistence manager
Declaration
public override void RegisterPersistenceManager()
  SetPlaceholder(String, String, Boolean)
Set a placeholder, often used for [CascadingAddon] orther palceholder
Declaration
public void SetPlaceholder(string name, string value, bool escapeSql = false)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | name | Name of the place holder  | 
      
| System.String | value | Value  | 
      
| System.Boolean | escapeSql | If set to true, sql injectable code will be escaped  | 
      
Events
| Improve this Doc View SourceAsyncLoadDataFinished
Event which will be called if data loading finished (for a page)
Declaration
public event CursorGridViewControl.AsyncLoadDataFinishedHandler AsyncLoadDataFinished
  Event Type
| Type | Description | 
|---|---|
| CursorGridViewControl.AsyncLoadDataFinishedHandler | 
AsyncLoadDataStart
Event which will be called if data loading starts
Declaration
public event CursorGridViewControl.AsyncLoadDataStartHandler AsyncLoadDataStart
  Event Type
| Type | Description | 
|---|---|
| CursorGridViewControl.AsyncLoadDataStartHandler | 
BeforeCursorPreparingStatementEvent
before preparing statement, fires before the sql statement is executed
Declaration
public event CursorGridViewControl.BeforeCursorPreparingStatementHandler BeforeCursorPreparingStatementEvent
  Event Type
| Type | Description | 
|---|---|
| CursorGridViewControl.BeforeCursorPreparingStatementHandler | 
ResolveDynamicColumn
Resolve dynamic columns
Declaration
public event CursorGridViewControl.ResolveDynamicColumnHandler ResolveDynamicColumn
  Event Type
| Type | Description | 
|---|---|
| CursorGridViewControl.ResolveDynamicColumnHandler |