Grid view of a three-dimensional ext.net array

I have a two dimensional array

for (int i = 0; i < rowList.GetLength(0); i++) { for (int j = 0; j < rowList.GetLength(1); ++j) { System.Diagnostics.Debug.WriteLine(rowList.GetValue(i,j)); } } 

How can I show this information in ext.net gridPanel

I have the code on an aspx page as follows:

  <ext:GridPanel ID="GridPanel1" runat="server" Title="SLA-Einhaltung gesamt in % (Basis) " Height="200" Width="800" Frame="true"> <Store> <ext:Store runat="server" ID="Store1"> <Model> <ext:Model runat="server" IDProperty="ModelID"> <Fields> <ext:ModelField Name="SLA_typ"></ext:ModelField> </Fields> </ext:Model> </Model> </ext:Store> </Store> <ColumnModel runat="server"> <Columns> <ext:Column runat="server" DataIndex="SLA_typ" Width="120" Text="Tittle"></ext:Column> </Columns> </ColumnModel> </ext:GridPanel> 
+4
source share
1 answer

I do not know ext.net gridPanel. But I looked through it and found a sample http://examples.ext.net/#/GridPanel/ArrayGrid/Simple/ This example uses a jagged array, not a two-dimensional array. The core of the array is an array of arrays.

I had the same issue with the WPF grid, and the solution was to create an array with notches. So I would try a gear array. Here's how you could create a jagged array from a rowList array.

 object [][] jagged = new object[rowList.GetLength(0)][]; for (int i = 0; i < rowList.GetLength(0); i++) { jagged[i] = new object[GetLength(1)]; for (int j = 0; j < rowList.GetLength(1); ++j) { jagged[i][j] = rowList[i,j]; } } 
+2
source

Source: https://habr.com/ru/post/1447931/


All Articles