Hi there,
I'm having a difficult time getting the WebHierarchicalDataGrid to work properly. I've added one to a test page and without any code in the code behind file to bind any data to it, I get this error message:
I initially had tried binding some items to the collection, then leaving the call to databind out, then finally removing all code from the code behind and I still get this error. Does anyone know what's causing it? Code below - it's pulled directly from your samples page.
<ig:WebHierarchicalDataGrid ID="dg" runat="server" AutoGenerateColumns="false" AutoGenerateBands="true" InitialExpandDepth="0" InitialDataBindDepth="-1" Height="450" Width="700px" DataKeyFields="SupplierID"> <ExpandCollapseAnimation SlideOpenDirection="Auto" SlideOpenDuration="300" SlideCloseDirection="Auto" SlideCloseDuration="300" /> <Columns> <ig:BoundDataField DataFieldName="SupplierID" Key="SupplierID" Header-Text="Supplier ID" /> <ig:BoundDataField DataFieldName="CompanyName" Key="Company" Header-Text="Company" Width="230px" /> <ig:BoundDataField DataFieldName="ContactName" Key="Contact" Header-Text="Contact" Width="150px" /> <ig:BoundDataField DataFieldName="Region" Key="Region" Header-Text="Region" Width="80px" /> </Columns> </ig:WebHierarchicalDataGrid>
Thanks!
Hi again,
When I googled your error, I got like a million hits. Did you try some of their suggestions? Looks like it's not an Infragistics problem at all.
Ed
Hi,
I just tried your markup in a new website and it didn't come up with any errors. Here's the markup:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="Infragistics35.Web.v10.2, Version=10.2.20102.2152, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" Namespace="Infragistics.Web.UI.GridControls" TagPrefix="ig" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title></head>
<body> <form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager><ig:WebHierarchicalDataGrid ID="dg" runat="server" AutoGenerateColumns="false" AutoGenerateBands="true" InitialExpandDepth="0" InitialDataBindDepth="-1" Height="450" Width="700px" DataKeyFields="SupplierID"> <ExpandCollapseAnimation SlideOpenDirection="Auto" SlideOpenDuration="300" SlideCloseDirection="Auto" SlideCloseDuration="300" /> <Columns> <ig:BoundDataField DataFieldName="SupplierID" Key="SupplierID" Header-Text="Supplier ID" /> <ig:BoundDataField DataFieldName="CompanyName" Key="Company" Header-Text="Company" Width="230px" /> <ig:BoundDataField DataFieldName="ContactName" Key="Contact" Header-Text="Contact" Width="150px" /> <ig:BoundDataField DataFieldName="Region" Key="Region" Header-Text="Region" Width="80px" /> </Columns> </ig:WebHierarchicalDataGrid> </div> </form></body></html>
When I tried with your code behind the data showed up perfectly too.
I tried setting the datasource in the code-behind and had the same problem, as I said in my first post. Code below:
var list = new List<object>(); list.Add(new { SupplierID = 1, CompanyName = "first company", ContactName = "first contact", Region = "first region" }); list.Add(new { SupplierID = 2, CompanyName = "second company", ContactName = "second contact", Region = "second region" }); dg.DataSource = list; dg.DataBind();
There's no datasource.