Hi,
I'm trying to display a WHDG from code behind. At run time, I receive the following error (sorry for the French message):
Microsoft JScript runtime error: Sys.ArgumentUndefinedException: La valeur ne peut pas être non définie.Nom du paramètre : type
(translation: Value cannot be undefined, parameter name: type).
in what seems to be JS code in a file called ScriptResource.axd?IFOK_etc., line 2700. Code:
var
Sys$Component$create(type, properties, events, references, element) {
/// <summary locid="M:J#Sys.Component.create" />
/// <param name="type" type="Type"></param>
/// <param name="properties" optional="true" mayBeNull="true"></param>
/// <param name="events" optional="true" mayBeNull="true"></param>
/// <param name="references" optional="true" mayBeNull="true"></param>
/// <param name="element" domElement="true" optional="true" mayBeNull="true"></param>
/// <returns type="Sys.UI.Component"></returns>
e = Function._validateParams(arguments, [
{name:
, type: Type},
},
}
]);
e;
The code behind code looks like this (it'is in a content page of a Master page):
DataTable()
authors.Columns.Add(
)
authors.Rows.Add(
books.Columns.Add(
books.Rows.Add(
DataSet
ds.Tables.Add(authors)
ds.Tables.Add(books)
ds.Relations.Add(ds.Tables(0).Columns(0), ds.Tables(1).Columns(0))
GrilleListeCoursGroupe
.Bands.Clear()
.DataSource = ds
.DataKeyFields =
"authID"
.DataBind()
With
Hello,
I am guessing you are using VS2005.
You need to add a new WebForm to the website as an Ajax WebForm: Right-click on the website->New Item...->Ajax WebForm
Hi Alexander,
I'm using VS2008, Version 9.0.30792.1 SP, Framework 3.5 SP1. I tried your solution in a brand new solution on a page with only a WHDG with an Ajax WebForm, and with a standard aspx WebForm an I got the same error in javaScript code. I attach a screen shot of the error, that occurs after the page load Event. I'm attaching too the source code (aspx and vb), all in the same zip file.
I partly solved the problem: I changed the order of the lines:
.DataKeyFields = "authID"
to
DataKeyFields = "authID"
DataSource = ds
I think that the infragistics should display a more spefic message...
The grid then correctly displays the first band of the hierarchy. But when I click on the arrow to expand the data, I receive the message "Runtime Exception: No child grid script descriptors are available!"
How can I correct this new problem?
That is so very strange... I am looking into this right now, and it's very puzzling. Do you have VS2010 RC installed by any chance? Do you experience the sam eproblem with a C# website as well?
Thanks.
Somehow Bands.Clear() causes this to happen. If you remove this line everything is ok. We will look furher into that.
Also you need to setup PrimaryKey off the authors table to make it expandable.
The coolumns collection would have to be set up from the aspx, or some columns should be added to it prior to databinding, and the AutoGenerateColumns should be set to False.
I remove any calls to Bands.Clear(), I add a primary key to my parent datatable (anyway, the data was displayed correctly at both level of the hierarchy), I rewrite my test application (the authors and books) in C#. I'm using VS2008 SP1 version 9.0.30729.1, Framework 3.5 SP1 on windows XP. I'm also using "Infragistics35.Web.v10.1, Version=10.1.20101.1011 ".
I am always getting the same NullReferenceException when trying to hide a column. In the debugger, the Columns collection size is 0.
Were you able reproduce the problem?
I'm attaching the aspx file, and the VB and CS code behind that show the problem.
I lost almost a week worth of work on that simple problem.