I’m developing on Asp.Net web application with Infragistics 2015 controls.
I have created the multi column webdropdown using template (webdatagrid placed inside the itemtemplate) as suggested here http://help.infragistics.com/doc/ASPNET/2014.1/CLR4.0/?page=WebDropDown_Create_a_Multi_Column_WebDropDown_using_Templates.html
Datasource of the webdatagrid will be assigned in the code-behind. This works fine.
But while postback the page it throws the following error, “ 0x800a139e - JavaScript runtime error: Sys.InvalidOperationException: Two components with the same id 'ContentPlaceHolder1_WebTab1_tmpl0_wddInvestigationName_0_wdGInvName' can't be added to the application. “
All these controls placed inside the webtab control.
We are using Infragistics4.Web.v15.1.
Any help would be appreciated.
Sample code :
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<ig:WebTab ID="WebTab1" runat="server" Height="200px" Width="100%">
<tabs>
<ig:ContentTabItem runat="server" Text="Drilldown" ClientIDMode="AutoID">
<Template>
<div style="padding-top: 15px; padding-bottom: 15px; width: 100%" id="divDropdowns">
<table>
<tr>
<td align="right">
<asp:Label runat="server" ID="lblInvNo" Text="Inv No : " Font-Bold="true"></asp:Label>
</td>
<td align="left" width="95px">
<ig:WebDropDown ID="wddInvestigationNo" runat="server" Width="200px" EnableDropDownAsChild="false"
DataTextField="InvId" DataValueField="InvId">
<Items>
<ig:DropDownItem></ig:DropDownItem>
</Items>
<ItemTemplate>
<ig:WebDataGrid ID="wdGInvNo" runat="server" Height="350px" Width="400px" AutoGenerateColumns="False" >
<Columns>
<ig:BoundDataField DataFieldName="InvId" Key="InvId" Width="20%">
<Header Text="InvId">
</Header>
</ig:BoundDataField>
<ig:BoundDataField DataFieldName="InvName" Key="InvName" Width="60%">
<Header Text="InvName">
<ig:BoundDataField DataFieldName="Status" Key="Status" Width="20%">
<Header Text="Status">
</Columns>
<Behaviors>
<ig:Selection CellClickAction="Row" RowSelectType="Single" Enabled="True">
<AutoPostBackFlags RowSelectionChanged="true" />
<SelectionClientEvents RowSelectionChanged="DropdownRowslection" />
</ig:Selection>
</Behaviors>
</ig:WebDataGrid>
</ig:WebDropDown>
</tr>
<td>
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="btnSearch_Click" />
</table>
</Template>
</ig:ContentTabItem>
</Tabs>
</ig:WebTab>
</ContentTemplate>
</asp:UpdatePanel>
Hello Ahmed,
Thank you for providing markup of your project for my close look.
After seen the error message It is looking like VS is getting two components with the same id.
Your grid id is “wdGInvNo” and dropdown id is “wddInvestigationNo” , I would like to know which control has id of “wddInvestigationName” and “wdGInvName”.
I have attached the sample project I used to test this. Please test this project on your PC; whether or not it works correctly may help indicate the nature of this problem.
If the project does not work correctly, this indicates either a problem possibly specific to your environment, or a difference in the DLL versions we are using. My test was performed using version “Version=15.1.20151.1”
If the project does show the product feature working correctly, this indicates a possible problem in the code of your application. It will help if you can provide a small, isolated sample application that demonstrates the behavior you are seeing.
You can refer the following API doc link demonstrate WebDropdown Template
http://www.infragistics.com/samples/aspnet/drop-down/templates
Please let me know if I may be of further assistance
Hi,
Thanks for the quick response. The sample solution works for me.
Control names were mentioned in initial post description was wrong and the original error message is : 0x800a139e - JavaScript runtime error: Sys.InvalidOperationException: Two components with the same id 'ContentPlaceHolder1_WebTab1_tmpl0_wddInvestigationNo_0_wdGInvNo' can't be added to the application.
I notice that, this issue only comes if <AutoPostBackFlags SelectedIndexChanged="On" /> for webtab control. (all my controls placed inside this webtab)
If I remove selectedIndexchanged event from the code then works fine without error.
P.S : the page created under the master page file and scriptmanager is exists on the master page only.
Thanks again and appreciate your help...!
Hello Ahamed,
Thank you for your update.