4

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 a ext.net gridPanel

I have code in the aspx page like this:

      <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>
2pietjuh2
  • 891
  • 1
  • 12
  • 29
Mahabub
  • 51
  • 4

1 Answers1

2

I have no knowledge of ext.net gridPanel. But I looked it up and found the sample http://examples.ext.net/#/GridPanel/ArrayGrid/Simple/ That sample uses a jagged array, not a two dimensional array. A jagged array is an array of arrays.

I had the same problem with the WPF-grid and the solution was to create a jagged array. So I would try a jagged array. This is how you could create a jagged array from your 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];

        }
    }
mortb
  • 7,874
  • 3
  • 21
  • 38