K2DataGrid Error

  • 28 February 2006
  • 0 replies
  • 0 views

Badge +1
Hello,
The following error gets written on top of my page after the user clicks one of the buttons on it.

"GetData 2: Object reference not set to an instance of an object."

When page is tested without the datagrid, the error doesn't appear.
Also, only the top row (first node) out of the xml data field gets displayed in the datagrid.

The structre of the XML document I'm trying to use is

<root>
<lines>
<fields>
<col1/>
<col2/>
</fields>
</lines>
</root>

There are many lines w/ each one having a single <fields> element.

Here's the HTML of the datagrid.
---------------------
<K2:K2DATAGRID id="ErrorsK2DG" runat="server" DataXPath="/root/lines/fields" DataField="ProcXML: DocOut"
BackColor="White" BorderColor="#3366CC" CellPadding="4" BorderStyle="None" BorderWidth="1px"
AutoGenerateColumns="False">
<ItemStyle ForeColor="#003399" BackColor="White"></ItemStyle>
<HeaderStyle Font-Bold="True" ForeColor="#CCCCFF" BackColor="#003399"></HeaderStyle>
<Columns>
<asp:BoundColumn DataField="Col1" HeaderText="Col1"></asp:BoundColumn>
<asp:BoundColumn DataField="Col2" HeaderText="Col2"></asp:BoundColumn>
<asp:BoundColumn DataField="Col3" HeaderText="Col3"></asp:BoundColumn>

</Columns>
<PagerStyle HorizontalAlign="Left" ForeColor="#003399" BackColor="#99CCCC" Mode="NumericPages"></PagerStyle>
<FooterStyle ForeColor="#003399" BackColor="#99CCCC"></FooterStyle>
<SelectedItemStyle Font-Bold="True" ForeColor="#CCFF99" BackColor="#009999"></SelectedItemStyle>
</K2:K2DATAGRID>
---------------------

There is nothing in the code-behind of this page!

I get the error even if I set AutoGenerateColumns="True" and remove the bound columns.

I'm not sure what I've been doing wrong.
This is a very simple example, and I haven't been able to find an easy example like this in this forum.

Any help is appreciated!
Ana

0 replies

Be the first to reply!

Reply