ShinobiControls Xamarin Bindings Documentation

ShinobiGrids : ShinobiGrids Namespace

SDataGridDataSourceHelper Class

The SDataGridDataSourceHelper is a utility class which makes it easier to render an NSArray of items within a ShinobiDataGrid.

Syntax

[Foundation.Register("SDataGridDataSourceHelper", true)]
public class SDataGridDataSourceHelper : Foundation.NSObject

Remarks

The datasource helper sets itself as both the delegate and datasource of the data-grid, automatically handling population of the data-grid cells, sorting, grouping (into sections) and row selection.

The datasource helper must be associated with a data-grid via the initWithDataGrid initializer. The data that the datasource helper renders in the associated data-grid is specified via the data property. The columns of the data-grid should be supplied in the usual fashion (via the addColumn method), however each column must have its SDataGridColumn.PropertyKey property set. The datasource helper uses the PropertyKey associated with each column to extract the value that should be rendered in the column for each of the supplied objects, via NSObject:valueForKey.

The datasource helper exposes a delegate, which extends the SDataGridDelegate. Delegate method invocations from the data-grid are forwarded to the datasource helper delegate, allowing you to handle the delegate methods, such as row re-ordering, or sorting, within your code. The datasource helper delegate also provides methods that allow you to customise the value used for grouping, sorting, or rendering the property of an object. This can be used to customise how sorting or grouping is applied, or provide extra formatting details for a property.

The datasource helper is able to automatically populate SDataGridTextCell columns, the value extracted for the column (as defined by the column's propertyKey value), is converted to a string via the '%@' formatter, with the SDataGridTextCell.TextField being set accordingly. For other cell types you will need to implement the delegate SDataGridDataSourceHelperDelegate.ShouldPopulateCell(SDataGridDataSourceHelper, SDataGridCell, IntPtr, string, IntPtr) method in order to populate the cell with the value provided by the datasource helper.

Requirements

Namespace: ShinobiGrids
Assembly: ShinobiGrids (in ShinobiGrids.dll)
Assembly Versions: 2.8.0.4

Members

See Also: Inherited members from Foundation.NSObject.

Public Constructors

Initializes and returns a newly allocated datasource helper object.

Protected Constructors

Constructor to call on derived classes to skip initialization and merely allocate the object.
A constructor used when creating managed representations of unmanaged objects.

Public Properties

[read-only]
override
ClassHandle IntPtr . The handle for this class.
Data Foundation.NSObject[]. The data which will be rendered by the grid.
[read-only]
DataGrid ShinobiDataGrid . The SDataGrid that this helper is associated with.
Delegate SDataGridDataSourceHelperDelegate . The object that acts as a delegate for the data-grid helper.
GroupedPropertyKey string . The property of the rendered items which is used to group the data.
GroupedPropertySortOrder SDataGridColumnSortOrder . The property of the rendered items which is used to group the data.
SelectedItems Foundation.NSObject[]. The model objects that have been selected in the grid.
[read-only]
SortedData Foundation.NSObject[]. The data in the order that it is currently being rendered by the grid.
WeakDelegate Foundation.NSObject . Weakly typed SDataGridDataSourceHelper.Delegate.

Public Methods

ReloadData ()
Reload all the data.

Protected Methods

override
Dispose (bool)
Releases unmanaged resources.

Member Details

SDataGridDataSourceHelper Constructor

Constructor to call on derived classes to skip initialization and merely allocate the object.

Syntax

[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)]
protected SDataGridDataSourceHelper (Foundation.NSObjectFlag t)

Parameters

t
Unused sentinel value

Remarks

You should not invoke this method directly.

Requirements

Namespace: ShinobiGrids
Assembly: ShinobiGrids (in ShinobiGrids.dll)
Assembly Versions: 2.8.0.4

SDataGridDataSourceHelper Constructor

Initializes and returns a newly allocated datasource helper object.

Syntax

[Foundation.Export("initWithDataGrid:")]
public SDataGridDataSourceHelper (ShinobiDataGrid dataGrid)

Parameters

dataGrid
The grid that contains the section that is requesting the information.

Remarks

The new datasource helper is associated with the given ShinobiDataGrid and will set itself as both the datasource and delegate.

Requirements

Namespace: ShinobiGrids
Assembly: ShinobiGrids (in ShinobiGrids.dll)
Assembly Versions: 2.8.0.4

SDataGridDataSourceHelper Constructor

A constructor used when creating managed representations of unmanaged objects.

Syntax

[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)]
protected SDataGridDataSourceHelper (IntPtr handle)

Parameters

handle
Handle of the unmanaged object

Remarks

You should not invoke this method directly.

Requirements

Namespace: ShinobiGrids
Assembly: ShinobiGrids (in ShinobiGrids.dll)
Assembly Versions: 2.8.0.4

ClassHandle Property

The handle for this class.

Syntax

public override IntPtr ClassHandle { get; }

Value

Documentation for this section has not yet been entered.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: ShinobiGrids
Assembly: ShinobiGrids (in ShinobiGrids.dll)
Assembly Versions: 2.8.0.4

Data Property

The data which will be rendered by the grid.

Syntax

[get: Foundation.Export("data", ObjCRuntime.ArgumentSemantic.Strong)]
[set: Foundation.Export("setData:", ObjCRuntime.ArgumentSemantic.Strong)]
public virtual Foundation.NSObject[] Data { get; set; }

Value

Documentation for this section has not yet been entered.

Remarks

Caution: It is recommended that the user maintains a reference to all data objects, to ensure that GC doesn't occur.

Requirements

Namespace: ShinobiGrids
Assembly: ShinobiGrids (in ShinobiGrids.dll)
Assembly Versions: 2.8.0.4

DataGrid Property

The SDataGrid that this helper is associated with.

Syntax

[get: Foundation.Export("dataGrid")]
public virtual ShinobiDataGrid DataGrid { get; }

Value

Documentation for this section has not yet been entered.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: ShinobiGrids
Assembly: ShinobiGrids (in ShinobiGrids.dll)
Assembly Versions: 2.8.0.4

Delegate Property

The object that acts as a delegate for the data-grid helper.

Syntax

public SDataGridDataSourceHelperDelegate Delegate { get; set; }

Value

Documentation for this section has not yet been entered.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: ShinobiGrids
Assembly: ShinobiGrids (in ShinobiGrids.dll)
Assembly Versions: 2.8.0.4

Dispose Method

Releases unmanaged resources.

Syntax

protected override void Dispose (bool disposing)

Parameters

disposing
True if called by Dispose, false if called from a finalizer

Remarks

Requirements

Namespace: ShinobiGrids
Assembly: ShinobiGrids (in ShinobiGrids.dll)
Assembly Versions: 2.8.0.4

GroupedPropertyKey Property

The property of the rendered items which is used to group the data.

Syntax

[get: Foundation.Export("groupedPropertyKey", ObjCRuntime.ArgumentSemantic.Strong)]
[set: Foundation.Export("setGroupedPropertyKey:", ObjCRuntime.ArgumentSemantic.Strong)]
public virtual string GroupedPropertyKey { get; set; }

Value

Documentation for this section has not yet been entered.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: ShinobiGrids
Assembly: ShinobiGrids (in ShinobiGrids.dll)
Assembly Versions: 2.8.0.4

GroupedPropertySortOrder Property

The property of the rendered items which is used to group the data.

Syntax

[get: Foundation.Export("groupedPropertySortOrder")]
[set: Foundation.Export("setGroupedPropertySortOrder:")]
public virtual SDataGridColumnSortOrder GroupedPropertySortOrder { get; set; }

Value

Documentation for this section has not yet been entered.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: ShinobiGrids
Assembly: ShinobiGrids (in ShinobiGrids.dll)
Assembly Versions: 2.8.0.4

ReloadData Method

Reload all the data.

Syntax

[Foundation.Export("reloadData")]
public virtual void ReloadData ()

Remarks

If you make changes to the underlying data (e.g. adding, removing or updating items), you should call this method to inform the datasource helper. When invoked the datasource helper will refresh the data-grid, whilst maintaining the sort, selection and group state.

Caution: This method will only work if called from the UI thread.

Requirements

Namespace: ShinobiGrids
Assembly: ShinobiGrids (in ShinobiGrids.dll)
Assembly Versions: 2.8.0.4

SelectedItems Property

The model objects that have been selected in the grid.

Syntax

[get: Foundation.Export("selectedItems", ObjCRuntime.ArgumentSemantic.Strong)]
[set: Foundation.Export("setSelectedItems:", ObjCRuntime.ArgumentSemantic.Strong)]
public virtual Foundation.NSObject[] SelectedItems { get; set; }

Value

Documentation for this section has not yet been entered.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: ShinobiGrids
Assembly: ShinobiGrids (in ShinobiGrids.dll)
Assembly Versions: 2.8.0.4

SortedData Property

The data in the order that it is currently being rendered by the grid.

Syntax

[get: Foundation.Export("sortedData")]
public virtual Foundation.NSObject[] SortedData { get; }

Value

Documentation for this section has not yet been entered.

Remarks

This property respects the current sort order and any row re-ordering applied by the user.

If the data has been grouped by setting the SDataGridDataSourceHelper.GroupedPropertyKey of the datasource helper, the returned array will contain instances of ShinobiGrids.SDataGridDataGroup, one per group.

Requirements

Namespace: ShinobiGrids
Assembly: ShinobiGrids (in ShinobiGrids.dll)
Assembly Versions: 2.8.0.4

WeakDelegate Property

Syntax

[get: Foundation.Export("delegate", ObjCRuntime.ArgumentSemantic.UnsafeUnretained)]
[set: Foundation.Export("setDelegate:", ObjCRuntime.ArgumentSemantic.UnsafeUnretained)]
public virtual Foundation.NSObject WeakDelegate { get; set; }

Value

Documentation for this section has not yet been entered.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: ShinobiGrids
Assembly: ShinobiGrids (in ShinobiGrids.dll)
Assembly Versions: 2.8.0.4