.
<ig:DropDownProvider ID="UOM_DropDownProvider"> <EditorControl DropDownContainerMaxHeight="200px" EnableAnimations="False" ID="EditorControl" runat="server" EnableDropDownAsChild="False" DropDownContainerWidth="150px"> <Items> <ig:DropDownItem Key="Kgs" Text="Kgs" Value="1"> </ig:DropDownItem> <ig:DropDownItem Key="Liters" Text="Lts" Value="2"> </ig:DropDownItem> <ig:DropDownItem Key="Meeters" Text="Mtls" Value="3"> </ig:DropDownItem> </Items> </EditorControl> </ig:DropDownProvider>
<ig:BoundDataField DataFieldName="ItemPriority" Key="ItemPriorityKey" Width="7%"> <Header Text="Priority" /> </ig:BoundDataField>
<ig:BoundDataField DataFieldName="RemarksTooltip" Key="RemarksKey"> <Header Text="Remarks" /> </ig:BoundDataField> <ig:UnboundCheckBoxField Key="testKey" HeaderCheckBoxMode="BiState" HeaderChecked="true" /> <ig:TemplateDataField Key="ViewKey" Header-Text="View"> <ItemTemplate > <div id="javawwwww" style="width: 99%; float: left"> <asp:LinkButton CssClass="editDoc-button" OnClick="BtnPRItemViewDoc_Click" TabIndex="112" Visible='<%#Eval("HasDoc")%>' ToolTip="Click to view documents" CommandArgument='<%#Eval("Id")%>' runat="server"></asp:LinkButton> </div> </ItemTemplate> </ig:TemplateDataField> <ig:BoundDataField DataFieldName="Id" Key="Id" Hidden="true"> </ig:BoundDataField> </Columns>
<ig:EditingColumnSetting ColumnKey="ItemPriorityKey" EditorID="WebDataGrid1_DropDownProvider1" ReadOnly="False" /> <ig:EditingColumnSetting ColumnKey="RemarksKey" ReadOnly="True" /> </ColumnSettings>
on 'edit any field and post back' above code trigger following error :(
Multiple controls with the same ID 'it11_0' were found. FindControl requires that controls have unique IDs.
if i don't use any TemplateDataField it working fine
any workaround for solving this issue?
Hello Vishnu,
Please comment the following line in the LinkButton1_Click event and you should avoid this error:
protected void LinkButton1_Click(object sender, EventArgs e) { // WebDataGrid1.ClearDataSource(); WebDataGrid1.DataSource = GetDataSource(); WebDataGrid1.DataBind(); }
Hi Hristo,
finally find out the issue. while including asp:sitemap control the issue is occurring.
<asp:SiteMapPath ID="SiteMap1" ClientIDMode="AutoID" runat="server" PathSeparatorStyle-CssClass="breadcrumbarrow" OnItemCreated="SiteMapPath_ItemCreated" OnItemDataBound="SiteMapPath1_OnItemDataBound" PathSeparator=" " TabIndex="-1"> </asp:SiteMapPath>
can you please suggest any solution for the same.
Hello,
I further modified my sample to better match your scenario. The changes that I made are :
1) MasterPage added
2) Code to rebind the grid is executen on button click
3) The grid and the button are placed inside UpdatePanel control
4) Changed references to use 12.1.20121.1005 version
The sample still works fine and I am not able to reproduce the error. Please have a look and let me know if this sample produce the error. If not you can compare it to your app to help you troubleshoot the issue. Otherwise please modify my sample or send me a working isolated sample reproducing the issue.
Hi Hristo, Thanks for your quick response
<%@ Page Language="C#" MasterPageFile="~/XXXXXXX.master" AutoEventWireup="true" EnableEventValidation="false" CodeFile="PRDetails.aspx.cs" Inherits="XXXXXX_Purchase_PRDetails" %><%@ Register TagPrefix="ig" Namespace="Infragistics.Web.UI.ListControls" Assembly="Infragistics4.Web.v12.1, Version=12.1.20121.1005, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" %><%@ Register TagPrefix="ig" Namespace="Infragistics.Web.UI.GridControls" Assembly="Infragistics4.Web.v12.1, Version=12.1.20121.1005, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" %><%@ Register TagPrefix="uclCal" TagName="Calender" Src="~/UserControls/Calender.ascx" %><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="Ajax" %><asp:Content ID="Content1" ContentPlaceHolderID="PageContent" runat="Server"> <form> <asp:UpdatePanel runat="server" ID="upPnlSpare" UpdateMode="Always"> <ContentTemplate> <ig:WebDataGrid ID="WebDataGrid1" runat="server" Height="350px" AutoGenerateColumns="False" DataKeyFields="id" DefaultColumnWidth="200px"> <Columns> <ig:BoundDataField Key="id" DataFieldName="id"> <Header Text="id"> </Header> </ig:BoundDataField> <ig:BoundDataField Key="Number" DataFieldName="Number"> <Header Text="Number"> </Header> </ig:BoundDataField><%-- <ig:BoundDataField Key="Date" DataFieldName="Date"> <Header Text="Date"> </Header> </ig:BoundDataField>--%> <ig:TemplateDataField Key="Date" Header-Text="View"> <ItemTemplate > <div id="javawwwww" style="width: 99%; float: left"> <asp:LinkButton Text="Link" ID="LinkButton1" OnClick="LinkButton1_Click" runat="server"> </asp:LinkButton> </div> </ItemTemplate><Header Text="View"></Header> </ig:TemplateDataField> </Columns> <EditorProviders> <ig:DropDownProvider ID="UOM_DropDownProvider"> <EditorControl DropDownContainerMaxHeight="200px" ID="EditorControl" runat="server" EnableDropDownAsChild="False" DropDownContainerWidth="150px"> <Items> <ig:DropDownItem Value="1" Text="Kgs" Key="Kgs"> </ig:DropDownItem> <ig:DropDownItem Value="2" Key="Liters" Text="Lts"> </ig:DropDownItem> </Items> </EditorControl> </ig:DropDownProvider> </EditorProviders> <Behaviors> <ig:EditingCore> <Behaviors> <ig:CellEditing> <ColumnSettings> <ig:EditingColumnSetting ColumnKey="Number" EditorID="UOM_DropDownProvider" /> <ig:EditingColumnSetting ColumnKey="id" ReadOnly="true" /> </ColumnSettings> </ig:CellEditing> </Behaviors> </ig:EditingCore> </Behaviors> </ig:WebDataGrid> <asp:Button ID="Button1" runat="server" Text="Save" /> </ContentTemplate> </asp:UpdatePanel> </form></asp:Content>
C#
sing System;using System.Collections;using System.Collections.Generic;using System.Configuration;using System.IO;using System.Linq;using System.Text;using System.Text.RegularExpressions;using System.Threading;using System.Web.Services;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using CrystalDecisions.CrystalReports.Engine;using CrystalDecisions.Shared;using Infragistics.Web.UI.GridControls;using Ionic.Zip;using System.Data;using System.Reflection;public partial class XXXXX_Purchase_PRDetails : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) { WebDataGrid1.DataSource = GetDataSource(); } public DataTable GetDataSource() { System.Data.DataTable table = new DataTable("Table"); // Declare variables for DataColumn and DataRow objects. DataColumn column; DataRow row; // Create new DataColumn, set DataType, // ColumnName and add to DataTable. column = new DataColumn(); column.DataType = System.Type.GetType("System.Int32"); column.ColumnName = "id"; column.ReadOnly = true; // Add the Column to the DataColumnCollection. table.Columns.Add(column); // Create second column. column = new DataColumn(); column.DataType = System.Type.GetType("System.Int32"); column.ColumnName = "Number"; column.AutoIncrement = false; column.Caption = "Number"; column.ReadOnly = false; column.Unique = false; // Add the column to the table. table.Columns.Add(column); // Create third column. column = new DataColumn(); column.DataType = System.Type.GetType("System.DateTime"); column.ColumnName = "Date"; column.AutoIncrement = false; column.Caption = "Date "; column.ReadOnly = false; column.Unique = false; // Add the column to the table. table.Columns.Add(column); // Make the ID column the primary key column. DataColumn[] PrimaryKeyColumns = new DataColumn[1]; PrimaryKeyColumns[0] = table.Columns["id"]; table.PrimaryKey = PrimaryKeyColumns; for (int i = 0; i <= 100; i++) { row = table.NewRow(); row["id"] = i; row["Number"] = i; row["Date"] = DateTime.Now; table.Rows.Add(row); } return table; } protected void LinkButton1_Click(object sender, EventArgs e) { WebDataGrid1.ClearDataSource(); WebDataGrid1.DataSource = GetDataSource(); WebDataGrid1.DataBind(); }}
even this code generate same issue "Multiple controls with the same ID 'it2_0' were found. FindControl requires that controls have unique IDs"
our master page not contain any ig controls.
Hi,
Thank you for your feedback.
Please use the your code to rebind in my sample app and see if it will work. Also modify my sample with anything that you consider related to the issue that occurs. If you manage to reproduce the issue in my sample it will be fine. Or try to isolate your sample and send it for investigation.
You can also specify the exact version of 12.1 that you are using, so I can test my sample app with it.