Hi,
I am working with a web application which uses the WebDataGrid and a DropDown EditorProvider for a Column.
When I add Items to the Collection and build the web application it throws an error lik this
Infragistics.Web.UI.ListControls.DropDownItemCollection must have items of type
'Infragistics.Web.UI.ListControls.DropDownItem'. 'infragistics.web.ui.listcontrols.dropdownitem'
is of type 'System.Web.UI.HtmlControls.HtmlGenericControl'.
I am using NETAdvantage for ASP.NET WebClient 2010 volume 1 (trial version).
Please Help.
Thank You
Praveen
Hi Praveen,
Can you send me more information regarding the error and how to produce it. Also do you have the namespace Infragistics.Web.UI.ListControls included in the register clauses in the web site or the web.config file? The namespace should be added manually or by dropping a new WebDropDown control on the page, before adding items to the control.
Magued
Hi Magued,
Thanks for Your reply.
As per your reply I add this Register tag prefix
<%
@ Register assembly="Infragistics35.Web.v10.1, Version=10.1.20101.1011,
Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
namespace="Infragistics.Web.UI.ListControls" tagprefix="ig" %>
at the top of the page and it worked fine.
But when I bind Items from an SqlDataSource it throws this error
The control collection cannot be modified during DataBind,
Init, Load, PreRender or Unload phases.
Please help.
Hi Praveenkm,
I have included a sample that demonstrates binding an sqldatasource to a webdropdown. Please download and uncompress. You may need to run the project upgrade utility to upgrade the project to the NetAdvantage version that you are using. You will need to change the connection string to point to your NorthWind DataBase. I have removed the ig_res folder to decrease the size of the sample.
Please test and send me regarding any questions. Also feel free to modify the sample to reproduce the error you are getting..
I used the application You had attached. The WebDropDown -> DataBinding will work fine if the
control is used independently.
In my case I am using a DropDownProvider which is an EditorProvider and using this
for a column in RowAdding Behavior. The Items in the WebDataGrid is also bound from an
SqlDataSource and also trying to bind DropDownProvider items from SqlDataSource.
When the PageLoad happens I get this error :
Please help
Hi Parveen,
Please refer to the following link on how to use a WebDropDown as an editor provider for the WebDataGrid. The link describes the same scenario as your application. if you are still having an issue then try to reproduce it on a sample or send me more information on how to reproduce it.
I cannot see the link anywhere.Please post it.
I'm runing NetAdvantage 10.3 clr 4x, and I have the same problem. I can't have a dropdown as an editor provider if there's a template data field with an itemtemlate tag in the webdatagrid.
Thanks
Upgrading to the latest service release (2105) seems to have fixed the problem.
I have the same problem with 10.3. If I remove my TemplateDataField, it works. With the TemplateDataField in there, I get this stack trace:
[HttpException (0x80004005): The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases.] System.Web.UI.ControlCollection.Add(Control child) +8701175 Infragistics.Web.UI.Framework.Data.FlatDataBoundControl.get_TemplateContainerControl() +117 Infragistics.Web.UI.Framework.Data.FlatDataBoundControl.Infragistics.Web.UI.IControlMain.get_TemplateContainerControl() +33 Infragistics.Web.UI.Framework.RunBot.InstantiateTemplate(ITemplatedObject item, ITemplate template, String templateContainerID) +127 Infragistics.Web.UI.GridControls.BaseGrid.InstantiateTemplate(ITemplatedGridObject item, ITemplate defaultTemplate, String id) +366 Infragistics.Web.UI.GridControls.WebDataGrid.InstantiateTemplates() +1532 Infragistics.Web.UI.GridControls.BaseGrid.EnsureTemplates() +34 Infragistics.Web.UI.GridControls.WebDataGrid.DataBind() +884 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +66 Infragistics.Web.UI.Framework.Data.FlatDataBoundControl.EnsureDataBound() +86 Infragistics.Web.UI.GridControls.WebDataGrid.EnsureDataBound() +186 Infragistics.Web.UI.GridControls.WebDataGrid.CreateChildControls() +51 System.Web.UI.Control.EnsureChildControls() +102 Infragistics.Web.UI.GridControls.WebDataGrid.EnsureChildControls() +129 System.Web.UI.Control.FindControl(String id, Int32 pathOffset) +20 System.Web.UI.Control.FindControl(String id) +12 System.Web.UI.WebControls.DataBoundControlHelper.FindControl(Control control, String controlID) +81 System.Web.UI.WebControls.DataBoundControl.GetDataSource() +67 Infragistics.Web.UI.Framework.Data.FlatDataBoundControl.GetDataSourceObject(Boolean designModeCheck) +185 Infragistics.Web.UI.Framework.Data.FlatDataBoundControl.GetDataSourceObject() +38 Infragistics.Web.UI.Framework.Data.FlatDataBoundControl.GetDataSource() +59 System.Web.UI.WebControls.DataBoundControl.ConnectToDataSourceView() +159 System.Web.UI.WebControls.DataBoundControl.OnLoad(EventArgs e) +19 System.Web.UI.Control.LoadRecursive() +74 System.Web.UI.Control.LoadRecursive() +146 System.Web.UI.Control.LoadRecursive() +146 System.Web.UI.Control.LoadRecursive() +146 System.Web.UI.Control.LoadRecursive() +146 System.Web.UI.Control.LoadRecursive() +146 System.Web.UI.Control.LoadRecursive() +146 System.Web.UI.Control.LoadRecursive() +146 System.Web.UI.Control.LoadRecursive() +146 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207
Hello boruchsiper,
I am having the same exact issue.
Did you ever find a resolution?
Thanks,Jeff
Please attach the markup for the WebDataGrid. If this is a different issue then please open a new forum thread.