Class GroupsInDetailsCollection
A Read-only collection of Group elements that are children of a GroupsDetails section. An instance of this collection is returned by the Groups property of a GroupsDetails object. The Groups property of a Group does also return an instance of this collection if the group's details section contains groups (and not records). Otherwise an empty collection is returned.
Inheritance
Implements
Inherited Members
Namespace: Syncfusion.Grouping
Assembly: Syncfusion.Grouping.Base.dll
Syntax
public class GroupsInDetailsCollection : IList, ICollection, IEnumerable, IDisposable
Fields
Empty
A Read-only empty collection.
Declaration
public static GroupsInDetailsCollection Empty
Field Value
Type |
---|
GroupsInDetailsCollection |
Properties
Count
Gets the number of elements contained in the collection. The property also ensures that the collection is in sync with the underlying table if changes have been made to the Table or the TableDescriptor.
Declaration
public int Count { get; }
Property Value
Type |
---|
System.Int32 |
Remarks
The method ensures that the collection is in sync with the underlying table if changes have been made to the Table or the TableDescriptor.
The method calls EnsureInitialized(Object, Boolean).
IsFixedSize
Returns False since this collection has no fixed size.
Declaration
public bool IsFixedSize { get; }
Property Value
Type |
---|
System.Boolean |
IsReadOnly
Returns True because this collection is always Read-only.
Declaration
public bool IsReadOnly { get; }
Property Value
Type |
---|
System.Boolean |
IsSynchronized
Returns False.
Declaration
public bool IsSynchronized { get; }
Property Value
Type |
---|
System.Boolean |
Item[Int32]
Gets the group at the specified non-zero based index. Setting is not supported and will throw an exception since the collection is Read-only.
Declaration
public Group this[int index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Item index. |
Property Value
Type |
---|
Group |
Remarks
The method ensures that the collection is in sync with the underlying table if changes have been made to the Table or the TableDescriptor.
The method calls EnsureInitialized(Object, Boolean).
Item[String]
Searches for the specified category and returns the found group.
Declaration
public Group this[string category] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.String | category | Category index. |
Property Value
Type |
---|
Group |
Examples
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
this.groupingGrid1.ShowNavigationBar = true;
this.groupingGrid1.TableControl.HorizontalScrollTips = false;
this.groupingGrid1.BorderStyle = BorderStyle.FixedSingle;
this.groupingGrid1.FilterRuntimeProperties = true;
DataSet ds = new DataSet();
ReadXml(ds, @"Data\Expand.xml");
ds.Tables[1].TableName = "Products";
ds.Tables[2].TableName = "OrderDetails";
ds.Tables[3].TableName = "Suppliers";
ds.Relations.Add(
ds.Tables[0].Columns["CategoryID"],
ds.Tables[1].Columns["CategoryID"]);
ds.Relations[0].RelationName = "Category_Products";
ds.Relations.Add(
ds.Tables[1].Columns["ProductID"],
ds.Tables[2].Columns["ProductID"]);
ds.Relations[1].RelationName = "Products_OrderDetails";
this.groupingGrid1.DataSource = ds.Tables[0];
Table categoriesTable = groupingGrid1.GetTable("Categories");
Console.WriteLine(categoriesTable.ToString());
Table productsTable = categoriesTable.RelatedTables["Products"];
Console.WriteLine(productsTable.ToString());
ChildTable product1 = (ChildTable) productsTable.TopLevelGroup.Groups["1"];
Console.WriteLine(product1.ToString());
Console.WriteLine(product1.Records[0].ToString());
ChildTable product21 = (ChildTable) productsTable.TopLevelGroup.Groups["8"];
Console.WriteLine(product21.ToString());
Console.WriteLine(product21.Records[0].ToString());
}
Public Sub New() '
'
' Required for Windows Form Designer support
'
InitializeComponent()
Me.groupingGrid1.ShowNavigationBar = True
Me.groupingGrid1.TableControl.HorizontalScrollTips = False
Me.groupingGrid1.BorderStyle = BorderStyle.FixedSingle
Me.groupingGrid1.FilterRuntimeProperties = True
Dim ds As New DataSet()
ReadXml(ds, "Data\Expand.xml")
ds.Tables(1).TableName = "Products"
ds.Tables(2).TableName = "OrderDetails"
ds.Tables(3).TableName = "Suppliers"
ds.Relations.Add(ds.Tables(0).Columns("CategoryID"), ds.Tables(1).Columns("CategoryID"))
ds.Relations(0).RelationName = "Category_Products"
ds.Relations.Add(ds.Tables(1).Columns("ProductID"), ds.Tables(2).Columns("ProductID"))
ds.Relations(1).RelationName = "Products_OrderDetails"
Me.groupingGrid1.DataSource = ds.Tables(0)
Dim categoriesTable As Table = groupingGrid1.GetTable("Categories")
Console.WriteLine(categoriesTable.ToString())
Dim productsTable As Table = categoriesTable.RelatedTables("Products")
Console.WriteLine(productsTable.ToString())
Dim product1 As ChildTable = CType(productsTable.TopLevelGroup.Groups("1"), ChildTable)
Console.WriteLine(product1.ToString())
Console.WriteLine(product1.Records(0).ToString())
Dim product21 As ChildTable = CType(productsTable.TopLevelGroup.Groups("8"), ChildTable)
Console.WriteLine(product21.ToString())
Console.WriteLine(product21.Records(0).ToString())
End Sub 'New
Methods
Contains(Group)
Determines if the element belongs to this collection.
Declaration
public bool Contains(Group value)
Parameters
Type | Name | Description |
---|---|---|
Group | value | The Object to locate in the collection. The value can be a NULL reference (Nothing in Visual Basic). |
Returns
Type | Description |
---|---|
System.Boolean | True if item is found in the collection; otherwise, False. |
Remarks
The method ensures that the collection is in sync with the underlying table if changes have been made to the Table or the TableDescriptor.
The method calls EnsureInitialized(Object, Boolean).
Contains(String)
Searches for the specified category and returns True if it was found.
Declaration
public bool Contains(string category)
Parameters
Type | Name | Description |
---|---|---|
System.String | category | Category key. |
Returns
Type | Description |
---|---|
System.Boolean | Returns True if it was found. |
Remarks
The method ensures that the collection is in sync with the underlying table if changes have been made to the Table or the TableDescriptor.
The method calls EnsureInitialized(Object, Boolean).
CopyTo(Group[], Int32)
Copies the entire collection to a compatible one-dimensional Array, starting at the specified index of the target array.
Declaration
public void CopyTo(Group[] array, int index)
Parameters
Type | Name | Description |
---|---|---|
Group[] | array | The one-dimensional Array that is the destination of the elements copied from ArrayList. The Array must have zero-based indexing. |
System.Int32 | index | The zero-based index in array at which copying begins. |
Remarks
The method ensures that the collection is in sync with the underlying table if changes have been made to the Table or the TableDescriptor.
The method calls EnsureInitialized(Object, Boolean).
Dispose()
Disposes the object.
Declaration
public void Dispose()
FindGroup(Object)
Searches for the specified category and returns the zero-based index of the occurrence.
Declaration
public int FindGroup(object category)
Parameters
Type | Name | Description |
---|---|---|
System.Object | category | The category key. |
Returns
Type | Description |
---|---|
System.Int32 | The zero-based index of the occurrence of the category within the entire GroupsInDetailsCollection, if found; otherwise, -1. |
Remarks
The method ensures that the collection is in sync with the underlying table if changes have been made to the Table or the TableDescriptor.
The method calls EnsureInitialized(Object, Boolean).
Examples
public Form1()
{
// Required for Windows Form Designer support
InitializeComponent();
this.groupingGrid1.ShowNavigationBar = true;
this.groupingGrid1.TableControl.HorizontalScrollTips = false;
this.groupingGrid1.BorderStyle = BorderStyle.FixedSingle;
this.groupingGrid1.FilterRuntimeProperties = true;
DataSet ds = new DataSet();
ReadXml(ds, @"Data\Expand.xml");
ds.Tables[1].TableName = "Products";
ds.Tables[2].TableName = "OrderDetails";
ds.Tables[3].TableName = "Suppliers";
ds.Relations.Add(
ds.Tables[0].Columns["CategoryID"],
ds.Tables[1].Columns["CategoryID"]);
ds.Relations[0].RelationName = "Category_Products";
ds.Relations.Add(
ds.Tables[1].Columns["ProductID"],
ds.Tables[2].Columns["ProductID"]);
ds.Relations[1].RelationName = "Products_OrderDetails";
this.groupingGrid1.DataSource = ds.Tables[0];
Table categoriesTable = groupingGrid1.GetTable("Categories");
Console.WriteLine(categoriesTable.ToString());
Table productsTable = categoriesTable.RelatedTables["Products"];
Console.WriteLine(productsTable.ToString());
ChildTable product1 = (ChildTable) productsTable.TopLevelGroup.Groups["1"];
Console.WriteLine(product1.ToString());
Console.WriteLine(product1.Records[0].ToString());
ChildTable product21 = (ChildTable) productsTable.TopLevelGroup.Groups["8"];
Console.WriteLine(product21.ToString());
Console.WriteLine(product21.Records[0].ToString());
}
Public Sub New()
' Required for Windows Form Designer support
InitializeComponent()
Me.groupingGrid1.ShowNavigationBar = True
Me.groupingGrid1.TableControl.HorizontalScrollTips = False
Me.groupingGrid1.BorderStyle = BorderStyle.FixedSingle
Me.groupingGrid1.FilterRuntimeProperties = True
Dim ds As New DataSet()
ReadXml(ds, "Data\Expand.xml")
ds.Tables(1).TableName = "Products"
ds.Tables(2).TableName = "OrderDetails"
ds.Tables(3).TableName = "Suppliers"
ds.Relations.Add(ds.Tables(0).Columns("CategoryID"), ds.Tables(1).Columns("CategoryID"))
ds.Relations(0).RelationName = "Category_Products"
ds.Relations.Add(ds.Tables(1).Columns("ProductID"), ds.Tables(2).Columns("ProductID"))
ds.Relations(1).RelationName = "Products_OrderDetails"
Me.groupingGrid1.DataSource = ds.Tables(0)
Dim categoriesTable As Table = groupingGrid1.GetTable("Categories")
Console.WriteLine(categoriesTable.ToString())
Dim productsTable As Table = categoriesTable.RelatedTables("Products")
Console.WriteLine(productsTable.ToString())
Dim product1 As ChildTable = CType(productsTable.TopLevelGroup.Groups("1"), ChildTable)
Console.WriteLine(product1.ToString())
Console.WriteLine(product1.Records(0).ToString())
Dim product21 As ChildTable = CType(productsTable.TopLevelGroup.Groups("8"), ChildTable)
Console.WriteLine(product21.ToString())
Console.WriteLine(product21.Records(0).ToString())
End Sub 'New
FindGroup(Object[])
Searches for the specified category and returns the zero-based index of the occurrence.
Declaration
public int FindGroup(object[] categoryKeys)
Parameters
Type | Name | Description |
---|---|---|
System.Object[] | categoryKeys | The array of objects that identify the category. |
Returns
Type | Description |
---|---|
System.Int32 | Returns the zero-based index of the occurrence. |
Remarks
The method ensures that the collection is in sync with the underlying table if changes have been made to the Table or the TableDescriptor.
The method calls EnsureInitialized(Object, Boolean).
FindHighestSmallerOrEqualKey(Object)
Returns the group that matches the category or the nearest group with a category key that is smaller than the specified category key.
Declaration
public Group FindHighestSmallerOrEqualKey(object category)
Parameters
Type | Name | Description |
---|---|---|
System.Object | category | The category key. |
Returns
Type | Description |
---|---|
Group | The zero-based index of the occurrence of the category within the entire GroupsInDetailsCollection, if found; otherwise, -1. |
FindLowestHigherOrEqualKey(Object)
Returns the group that matches the category or the nearest group with a category key that is higher than the specified category key.
Declaration
public Group FindLowestHigherOrEqualKey(object category)
Parameters
Type | Name | Description |
---|---|---|
System.Object | category | The category key. |
Returns
Type | Description |
---|---|
Group | The zero-based index of the occurrence of the category within the entire GroupsInDetailsCollection, if found; otherwise, -1. |
GetEnumerator()
Returns an enumerator for the entire collection.
Declaration
public GroupsInDetailsCollectionEnumerator GetEnumerator()
Returns
Type | Description |
---|---|
GroupsInDetailsCollectionEnumerator | An Enumerator for the entire collection. |
Remarks
Enumerators only allow reading the data in the collection. Enumerators cannot be used to modify the underlying collection.
IndexOf(Group)
Returns the zero-based index of the occurrence of the element in the collection.
Declaration
public int IndexOf(Group value)
Parameters
Type | Name | Description |
---|---|---|
Group | value | The element to locate in the collection. The value can be a NULL reference (Nothing in Visual Basic). |
Returns
Type | Description |
---|---|
System.Int32 | The zero-based index of the occurrence of the element within the entire collection, if found; otherwise, -1. |
Remarks
The method ensures that the collection is in sync with the underlying table if changes have been made to the Table or the TableDescriptor.
The method calls EnsureInitialized(Object, Boolean).
IndexOf(String)
Searches for the specified category and returns the zero-based index of the occurrence or -1 if not found.
Declaration
public int IndexOf(string category)
Parameters
Type | Name | Description |
---|---|---|
System.String | category | Category key. |
Returns
Type | Description |
---|---|
System.Int32 | Returns the zero-based index of the occurrence. |
Remarks
The method ensures that the collection is in sync with the underlying table if changes have been made to the Table or the TableDescriptor.
The method calls EnsureInitialized(Object, Boolean).
Remove(Group)
Removes the group.
Declaration
public void Remove(Group value)
Parameters
Type | Name | Description |
---|---|---|
Group | value | Group to remove. |
Explicit Interface Implementations
ICollection.CopyTo(Array, Int32)
Copies the entire collection to a compatible one-dimensional Array, starting at the specified index of the target array.
Declaration
void ICollection.CopyTo(Array array, int index)
Parameters
Type | Name | Description |
---|---|---|
System.Array | array | The one-dimensional Array that is the destination of the elements copied from ArrayList. The Array must have zero-based indexing. |
System.Int32 | index | The zero-based index in array at which copying begins. |
Remarks
The method ensures that the collection is in sync with the underlying table if changes have been made to the Table or the TableDescriptor.
The method calls EnsureInitialized(Object, Boolean).
ICollection.SyncRoot
Returns whether collection of rows can be synchronized.
Declaration
object ICollection.SyncRoot { get; }
Returns
Type |
---|
System.Object |
IEnumerable.GetEnumerator()
Returns an enumerator for the entire collection.
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator | An Enumerator for the entire collection. |
Remarks
Enumerators only allow reading the data in the collection. Enumerators cannot be used to modify the underlying collection.
The method ensures that the collection is in sync with the underlying table if changes have been made to the Table or the TableDescriptor.
The method calls EnsureInitialized(Object, Boolean).
IList.Add(Object)
Adds the value to the collection.
Declaration
int IList.Add(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | The value in the list. |
Returns
Type |
---|
System.Int32 |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Collection is Read-only. |
IList.Clear()
Clears the Collection.
Declaration
void IList.Clear()
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Collection is Read-only. |
IList.Contains(Object)
Checks whether the value is in the collection or not.
Declaration
bool IList.Contains(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | The value of an element in the list. |
Returns
Type |
---|
System.Boolean |
IList.get_Item(Int32)
Declaration
object IList.get_Item(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Returns
Type |
---|
System.Object |
IList.IndexOf(Object)
Returns the index of value from the collection.
Declaration
int IList.IndexOf(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | The value of an element in the list. |
Returns
Type |
---|
System.Int32 |
IList.Insert(Int32, Object)
Inserts the value at the specified index.
Declaration
void IList.Insert(int index, object value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index of the list. |
System.Object | value | The value of an element in the list. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Collection is Read-only. |
IList.Item[Int32]
Gets or sets the current index in an collection.
Declaration
object IList.this[] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index of current element in an collection. |
Returns
Type | Description |
---|---|
System.Object | Returns the selected cells information at the specified index. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Since Collection is read only, index value cannot be set. |
IList.Remove(Object)
Removes the value passed from the collection.
Declaration
void IList.Remove(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | The value of an element in the list. |
IList.RemoveAt(Int32)
Removes the value at specified index of the collection.
Declaration
void IList.RemoveAt(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index of the list. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Collection is Read-only. |
IList.set_Item(Int32, Object)
Declaration
void IList.set_Item(int index, object value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | |
System.Object | value |