You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Using the GetItems GetColumn and GetColumnSafe Methods
12
12
13
13
14
+
In various cases you may want to access or traverse grid functional items/columns outside the dedicated ItemCreated and ItemDataBound event handlers, for example during PreRender or DataBinding event handlers of the grid. This is easily attainable with the **GetItems(itemType), GetColumn(columnName)** and **GetColumnSafe(columnName)** methods (exposed by each **GridTableView** instance).
14
15
15
-
##
16
+
The topic demonstrates accessing the following instances:
17
+
*[Items](#items)
18
+
*[Edit Items](#edit-items)
19
+
*[Insert Item](#insert-item)
20
+
*[Columns](#columns)
16
21
17
-
In various cases you may want to access grid functional items/columns outside of the grid server event handlers. This is easily attainable with the **GetItems(itemType), GetColumn(columnName)** and **GetColumnSafe(columnName)** methods (exposed by each **GridTableView** instance).
18
-
19
-
The **GetItems(itemType)** method returns an array of items (in the respective GridTableView) which match the specified type. You can use the **GridItemType** enumeration to choose the item type, for example:
22
+
**Batch editing mode** is highly client-side based and differs from EditForms, PopUp and InPlace modes. It requires specific handling, which is explained in the [Accessing Cells And Rows]({%slug grid/rows/accessing-cells-and-rows%}) article.
20
23
24
+
## Items
21
25
26
+
The **GetItems(itemType)** method returns an array of items (in the respective GridTableView) which match the specified type. You can use the **GridItemType** enumeration to choose the item type, for example:
'thus you get reference to the column with OrderID unique name
149
+
````
46
150
47
151
The **GetColumnSafe(columnName)** performs the same task as **GetColumn(columnName)** method, however **GetColumnSafe** will not raise an exception in case column with that name is not found in the corresponding **GridTableView**.
48
152
153
+
The entire column collection can be traversed using the following approach:
The forthcoming sample implementation is made for hierarchical grid with two levels. With separate buttons on the page you can:
50
187
51
188
* switch the visibility for the inner tables command item link button (only for expanded parent items)
@@ -104,12 +241,12 @@ The forthcoming sample implementation is made for hierarchical grid with two lev
104
241
````
105
242
````VB
106
243
PublicSharedconnectionStringAsString="Provider=Microsoft.Jet.OLEDB.4.0; Data Source="&System.Web.HttpContext.Current.Server.MapPath("~/Grid/Data/Access/Nwind.mdb")
0 commit comments