Try this
1 - Add WHDS (I'm too lazy to type full name today) to page.
2 - Click on Add View, do not select a data source but click on OK
3 - Click Add Child
4 - You should see the following error "Index was out of range. Must be non-negative and less than the size of teh collection. Parameter name: index"
Here's another one.
I added an ObjectDataSource to the form and then tried to configure the dataviews. After selecting the ODS using Add View I then clicked on Add Child and got an exception message as shown below:
Hello Zack,
Thanks for writing. Add Child also tries to reflect all available datasources and their schema, so it's possible that the problem is not related directly to ObjectDataSource.
If you paste here the datatasources you have on the page (or directly the whole ASPX syntax) plus some additional information about your ObjectDataSource - we will do my best to reproduce and address the problem.
By the way, this is a new product for us so any feedback on features / what you need supported is welcome at any point.
Just wanted to let you know that we have implemented that (automatic CRUDs for UltraWebGrid when bound to WHDS) and it will most probably be included in the official 2008.2 release (still not 100% sure about that, PM has the final say here).
If you want to take a look at what we have, just shoot me an email or private message, and I will send you a project demonstrating how this works.
Thanks for writing back. I have sent you and email with my IG email - please, send me the sample code and I will do my best to address this issue asap.
Also, we would really appreciate any feedback (bugs, issues, feature requests) for WHDS - it is a new control for us so we would really want to see real world scenarios and ideas so we can make it right for you guys.
Thanks a lot!
Twice I tried to post sample code in my reply and I don't think the message was accepted either time. I emailed you asking for your email address but just in case that doesn't go through please email me at zjones at arinc dot com and I'll send you some sample code to test with.
>Thanks for writing. Add Child also tries to reflect all available datasources and their schema, so it's possible that the problem is not related directly to ObjectDataSource.
You may be on to something there. In my case I was trying to bind the control to a class method that returns a dataset. The dataset contains three levels in its hierarchy. The top level is a list of aircraft tail numbers. The second level is a list of maintenance tasks performed on the aircraft. The first and second levels are related by the tail number field. The third level is a list of parts used during the maintenance task. The second and third levels are related by a unique tracking number assigned to each maintenance task. The entire dataset is built in the class and a call to the class method returns the dataset. I wonder if the problem has to do with the fact that the dataset is not created until runtime?
Below is a sample class and webform that demonstrates the problem.
Imports System.Data
Public Class foo
Public Shared Function GetData() As DataSet Dim DS As New DataSet("Testing") Dim dtTailNumber As New DataTable("TailNumber") Dim DC As DataColumn DC = New DataColumn("TailNumber") DC.DataType = GetType(String) DC.ColumnName = "TailNumber" dtTailNumber.Columns.Add(DC) DS.Tables.Add(dtTailNumber)
'Maintenance List Dim dtMAN As New DataTable("MAN") DC = New DataColumn("TailNumber") DC.DataType = GetType(String) dtMAN.Columns.Add(DC) DC = New DataColumn("MAN#") DC.DataType = GetType(String) dtMAN.Columns.Add("MAN#") DS.Tables.Add(dtMAN)
'Parts List Dim dtParts As New DataTable("Parts") DC = New DataColumn("MAN#") DC.DataType = GetType(String) dtParts.Columns.Add(DC) DC = New DataColumn("PartNumber") DC.DataType = GetType(String) dtParts.Columns.Add(DC) DS.Tables.Add(dtParts)
'Create Relationships Dim DataRel As DataRelation Dim ParentCol As DataColumn Dim ChildCol As DataColumn 'Tail Numbers ParentCol = DS.Tables("TailNumber").Columns("TailNumber") ChildCol = DS.Tables("MAN").Columns("TailNumber") DataRel = New DataRelation("TailNumber", ParentCol, ChildCol) DS.Relations.Add(DataRel)
'Repair Actions ParentCol = DS.Tables("Parts").Columns("MAN#") ChildCol = DS.Tables("Parts").Columns("MAN#") DataRel = New DataRelation("MANNumber", ParentCol, ChildCol) DS.Relations.Add(DataRel)
Return DS End Function
End Class
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default3.aspx.vb" Inherits="Default3" %>
<%@ Register Assembly="Infragistics2.Web.Preview.v8.1, Version=8.1.20081.1000, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" Namespace="Infragistics.Web.UI.WebControls" TagPrefix="cc1" %>
<!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>Untitled Page</title></head><body> <form id="form1" runat="server"> <div> <asp:ObjectDataSource ID="ods1" runat="server" SelectMethod="GetData" TypeName="foo"></asp:ObjectDataSource> <cc1:WebHierarchicalDataSource ID="WebHierarchicalDataSource1" runat="server"> </cc1:WebHierarchicalDataSource> </div> </form></body></html>
To generate the error click on the smarttag for the WHDS then Create Relations then Add View, Select Ods1, Ok, click Add Child (the one directly below ods1.DefaultView) and you should get the exception.
>By the way, this is a new product for us so any feedback on features / what you need supported is welcome at any point. To be honest I'm somewhat confused by this control. It's not what I thought it was going to be. When I first heard about it I thought it was going to be another datagrid control specifically designed for displaying hierarchical data. Off the top of my head I can't think of a case where I'm going to need it in any of my current projects.