Class GridViewControl
Grid view base. All Simplic gridviews should derive from this, or directly implement this gird view. The Gridview provides all base functionality a simplic gridview should provide.
Implements
Inherited Members
Namespace: Simplic.UI.GridView
Assembly: Simplic.UI.dll
Syntax
public class GridViewControl : AutomaticSelectionGridView, IDisposable
Constructors
| Improve this Doc View SourceGridViewControl()
Create new instance and set all default values for the current instance
Declaration
public GridViewControl()
Properties
| Improve this Doc View SourceConfiguration
Get the current grid configuration
Declaration
public GridConfigurationModel Configuration { get; }
Property Value
Type | Description |
---|---|
GridConfigurationModel |
CurrentlyFocusedRow
Gets or sets the currently focused row
Declaration
public object CurrentlyFocusedRow { get; }
Property Value
Type | Description |
---|---|
System.Object |
CurrentlyFocusedRowIndex
Get the currently focused row index
Declaration
public int CurrentlyFocusedRowIndex { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
EnableDrag
Gets or sets whether drag and drop is enabled or not
Declaration
public bool EnableDrag { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
EnableDrop
Gets or sets whether drag and drop is enabled or not
Declaration
public bool EnableDrop { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
HandleSelectionChanged
If set to false, no selection changed will be handlet by the telerik grid
Declaration
protected bool HandleSelectionChanged { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsOnPaging
Will be true, during paging is executed
Declaration
public bool IsOnPaging { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
ItemsSource
Override ItemsSource to enable selection changed handling if an itemssource was set
Declaration
public object ItemsSource { get; set; }
Property Value
Type | Description |
---|---|
System.Object |
NavigationBehaviour
Grid navigation behaviour. Default is SimplicDefault
Declaration
public GridViewNavigationBehaviour NavigationBehaviour { get; set; }
Property Value
Type | Description |
---|---|
GridViewNavigationBehaviour |
OrderedSelectedItems
Return a list of selected items ordered by the index of the Items-List
Declaration
public IList<object> OrderedSelectedItems { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IList<System.Object> |
SelectedItemOrderMode
Gets or sets the selected item order mode
Declaration
public SelectedItemOrderMode SelectedItemOrderMode { get; set; }
Property Value
Type | Description |
---|---|
SelectedItemOrderMode |
SelectedItemsAsDictionary
Get all selected items as a dictionary
Declaration
public IList<Dictionary<string, object>> SelectedItemsAsDictionary { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IList<System.Collections.Generic.Dictionary<System.String, System.Object>> |
VisibleRowCount
Get the amount of all visible rows
Declaration
public int VisibleRowCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
| Improve this Doc View SourceAddColumn(ColumnConfigurationModel)
Add column by configuration
Declaration
protected GridViewBoundColumnBase AddColumn(ColumnConfigurationModel columnConfiguration)
Parameters
Type | Name | Description |
---|---|---|
ColumnConfigurationModel | columnConfiguration |
Returns
Type | Description |
---|---|
GridViewBoundColumnBase |
ChangeCurrentlyFocusedRow(Int32)
Change the foxused item by using its index
Declaration
public void ChangeCurrentlyFocusedRow(int newIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | newIndex | Index of the item to focus |
CreateAndAddRow(IDictionary<String, Object>)
Create and add a row by using a set of parameters
Declaration
public virtual void CreateAndAddRow(IDictionary<string, object> parameters)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IDictionary<System.String, System.Object> | parameters | Parameters as dictionary |
Dispose()
Dispose / set ItemsSource to null
Declaration
public virtual void Dispose()
ExecuteCommand(ICommand)
Execute a gridview command (not telerik command)
Declaration
public void ExecuteCommand(ICommand command)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.ICommand | command | Instance of a gridview command |
GetColumnConfigurationByName(String)
Get a column configuration by the internname of the column. The compare method will is case insensitive
Declaration
public ColumnConfigurationModel GetColumnConfigurationByName(string internName)
Parameters
Type | Name | Description |
---|---|---|
System.String | internName | Name of the column |
Returns
Type | Description |
---|---|
ColumnConfigurationModel | Instance of the configuration if found, else null |
GetSelectedItemsAsAPIModels()
Returns all selected items/rows as an api model by calling a static factory. For the grid CreateClrAPIModelMethodParameter and CreateClrAPIModelMethod must be configurated.
Declaration
public IEnumerable<object> GetSelectedItemsAsAPIModels()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.Object> | Enumerable of api-models |
GetUserConfiguration()
Get the user-configurations for this grid as a steram
Declaration
public Stream GetUserConfiguration()
Returns
Type | Description |
---|---|
System.IO.Stream | Instance of stream |
GoToNextItem(Boolean)
Go to the next item, if only one item is selected, the selection will move, as long as keepPrivousSelection is set to false, else the previous item will keep its selection
Declaration
public void GoToNextItem(bool keepPreviousSelection = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | keepPreviousSelection | Defiens whether keep old selection during moving |
GoToPageDown(Boolean)
Move page down in the current grid
Declaration
public void GoToPageDown(bool selectRowsOnPaging = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | selectRowsOnPaging | Defines whether to select all affected rows during paging |
GoToPageUp(Boolean)
Move page up in the current grid
Declaration
public void GoToPageUp(bool selectRowsOnPaging = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | selectRowsOnPaging | Defines whether to select all affected rows during paging |
GoToPreviousItem(Boolean)
Go to the previous item, if only one item is selected, the selection will move, as long as keepPrivousSelection is set to false, else the previous item will keep its selection
Declaration
public void GoToPreviousItem(bool keepPreviousSelection = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | keepPreviousSelection | Defiens whether keep old selection during moving |
LoadConfiguration(GridConfigurationModel)
Load the configuration for the current GridViewControl instance
Declaration
public void LoadConfiguration(GridConfigurationModel configuration)
Parameters
Type | Name | Description |
---|---|---|
GridConfigurationModel | configuration | Instance of a grid configuration instance, containing all configuration stuff |
LoadUserConfiguration(Stream)
Load all configurations for the current user/grid
Declaration
public void LoadUserConfiguration(Stream configuration)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | configuration | Stream containing all information |
OnKeyDown(KeyEventArgs)
Handle routed keydown event to execute custom action or prevent default telerika ctions
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.KeyEventArgs | e |
OnPreviewKeyDown(KeyEventArgs)
Handle Keydown for navigating though
Declaration
protected override void OnPreviewKeyDown(KeyEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.KeyEventArgs | e |
OnPreviewMouseDoubleClick(MouseButtonEventArgs)
Handle mouse double click
Declaration
protected override void OnPreviewMouseDoubleClick(MouseButtonEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.MouseButtonEventArgs | e |
OnPreviewMouseDown(MouseButtonEventArgs)
Handle mouse selection (left button)
Declaration
protected override void OnPreviewMouseDown(MouseButtonEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.MouseButtonEventArgs | e |
OnSelectedCellsChanging(GridViewSelectedCellsChangingEventArgs)
Declaration
protected override void OnSelectedCellsChanging(GridViewSelectedCellsChangingEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
GridViewSelectedCellsChangingEventArgs | args |
OnSelectedItemChanged(Object, Object)
slecteion changed to set internal values
Declaration
protected override void OnSelectedItemChanged(object oldItem, object newItem)
Parameters
Type | Name | Description |
---|---|---|
System.Object | oldItem | |
System.Object | newItem |
OnSelectionChanging(SelectionChangingEventArgs)
Override selection changing
Declaration
protected override void OnSelectionChanging(SelectionChangingEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
SelectionChangingEventArgs | args |
ReApplyRowStyle()
applies rowstyle for on screen rows. Needs to be called after reordering rows (dragDrop)
Declaration
public void ReApplyRowStyle()
RegisterPersistenceManager()
Register persistence manager
Declaration
public virtual void RegisterPersistenceManager()
RemoveSelectionByItem(Object)
Remove an item from selected item list
Declaration
public void RemoveSelectionByItem(object item)
Parameters
Type | Name | Description |
---|---|---|
System.Object | item |
RemoveSelectionByRowIndex(Int32)
Remove item from selection by it's row id
Declaration
public void RemoveSelectionByRowIndex(int rowIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex |
ResetSelectionMember()
Reset member for selection functionality. Should be called on refreshing data in derived classes
Declaration
protected void ResetSelectionMember()
SelectAll()
Override Select all
Declaration
public void SelectAll()
SetDescriptor(GroupDescriptor)
Set header for group descriptor
Declaration
protected void SetDescriptor(GroupDescriptor descriptor)
Parameters
Type | Name | Description |
---|---|---|
GroupDescriptor | descriptor | Descriptor instance |
SetSelectionByItem(Object)
Add an item tp selected item list
Declaration
public void SetSelectionByItem(object item)
Parameters
Type | Name | Description |
---|---|---|
System.Object | item |
SetSelectionByRowIndex(Int32)
Add an item to selected items by its row inedx
Declaration
public void SetSelectionByRowIndex(int rowIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex |
ToggleSelectAll()
selects all elements, if min. one item is not selected, else unselects all elements
Declaration
public void ToggleSelectAll()
ToggleSelectionByRowIndex(Int32)
selects or unselects given row depending on the current selection state
Declaration
public void ToggleSelectionByRowIndex(int rowIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex |
UnselectAll()
Overwrite Unselect all
Declaration
public void UnselectAll()
Events
| Improve this Doc View SourceMouseRowDoubleClick
Will be fired if a double click on a row was performed
Declaration
public event GridViewControl.MouseRowDoubleClickHandler MouseRowDoubleClick
Event Type
Type | Description |
---|---|
GridViewControl.MouseRowDoubleClickHandler |
RowDropCompleted
Row drop completed event
Declaration
public event GridViewControl.RowDropCompletedEventHandler RowDropCompleted
Event Type
Type | Description |
---|---|
GridViewControl.RowDropCompletedEventHandler |
RowLoadedComplete
Event which will be called, if all in the grid were loaded (Scroll to the bottom)
Declaration
public event GridViewControl.RowLoadedCompleteHandler RowLoadedComplete
Event Type
Type | Description |
---|---|
GridViewControl.RowLoadedCompleteHandler |