FindControl requires that controls have unique IDs

Hi,
I've been banging my head against this error for awhile now, and am appealing to you for some help.

Here's what I'm trying to do:
I'm trying to implement a derivative of the EditAllRows example. I have a dropdownlist of Access table names and I bind the gridgrouping control to a new table when a new table is selected. Since the columns vary from table to table, i'm importing the itemtemplate from a dummy grid. I've been referring to the examples in this post (http://www.syncfusion.com/support/forums/message.aspx?MessageID=34268)

The problem is when a new table is selected from the dropdownlist I get the following error:

Multiple controls with the same ID 'GridGroupingControl1~TR~0~_TOPGROUP_^*R0' were found. FindControl requires that controls have unique IDs.

Stack Trace:
[HttpException (0x80004005): Multiple controls with the same ID 'GridGroupingControl1~TR~0~_TOPGROUP_^*R0' were found. FindControl requires that controls have unique IDs.]
System.Web.UI.Control.FillNamedControlsTable(Control namingContainer, ControlCollection controls) +268
System.Web.UI.Control.FillNamedControlsTable(Control namingContainer, ControlCollection controls) +340
System.Web.UI.Control.FillNamedControlsTable(Control namingContainer, ControlCollection controls) +340
System.Web.UI.Control.FillNamedControlsTable(Control namingContainer, ControlCollection controls) +340
System.Web.UI.Control.FillNamedControlsTable(Control namingContainer, ControlCollection controls) +340
System.Web.UI.Control.FillNamedControlsTable(Control namingContainer, ControlCollection controls) +340
System.Web.UI.Control.FillNamedControlsTable(Control namingContainer, ControlCollection controls) +340
System.Web.UI.Control.EnsureNamedControlsTable() +76
System.Web.UI.Control.FindControl(String id, Int32 pathOffset) +179
System.Web.UI.Page.FindControl(String id) +57
System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +282
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2547


If anyone has an idea how to correct this, it would be GREATLY appreciated. Thanks!

15 Replies

GB Gokul B Syncfusion Team December 14, 2006 12:05 AM UTC

Hi Jeff,

We are currently looking into this and let you know later tommorrow.

Thanks for using Syncfusion products.

Regards,
B.Gokulkumar


GB Gokul B Syncfusion Team December 14, 2006 09:15 PM UTC

Hi Jeff,

We could able to reproduce the issue as you mentioned. While binding the Grid Dynamically, fail to create a primarykey column to GridGroupControl causes this error. So, please make sure this is taken care in your sample. However, for your clear clarification we created a sample as per your requirement. Please have a look at our attached sample.

Forum_53447.zip

Let us know if this helps

Thanks for using Syncfusion products.

Regards,
B.Gokulkumar


JE Jeff December 19, 2006 05:29 PM UTC

Hi,
Thanks for your assistance. I adapted your example to my datasource, and when I try to Save Changes made on the grid, I get the following error:

Object reference not set to an instance of an object.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

on the following line of the SaveChanges() function:

>>>foreach (TableRow row in GridGroupingControl1.TopLevelTable.Rows)

Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
_Default.SaveChanges() in c:\Documents and Settings\Rack City\My Documents\Visual Studio 2005\WebSites\WebSite2\LiveApp.aspx.cs:190
_Default.GridGroupingControl1_BarButtonItemClicked(Object source, ButtonBarItemClickEventArgs e) in c:\Documents and Settings\Rack City\My Documents\Visual Studio 2005\WebSites\WebSite2\LiveApp.aspx.cs:166
Syncfusion.Web.UI.WebControls.Grid.Grouping.GridGroupingControl.OnBarButtonItemClicked(ButtonBarItemClickEventArgs e) +96
Syncfusion.Web.UI.WebControls.Grid.Grouping.GridGroupingControl.ProcessClientEvent(String eventArgument) +5432
Syncfusion.Web.UI.WebControls.Grid.Grouping.GridGroupingControl.RaisePostBackEvent(String eventArgument) +29
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +32
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +242
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3838


Are you able to save changes with the example you provided? Thanks for your assistance.

Best
Jeff


GB Gokul B Syncfusion Team December 20, 2006 12:07 AM UTC

Hi Jeff,

We could see this issue in our sample as you mentioned. So we need to look bit more on that and let you know later within two days.

Thanks for using Syncfusion products.

Regards,
B.Gokulkumar




AD Administrator Syncfusion Team December 22, 2006 12:34 AM UTC

Hi Jeff,

We regret for the delay.

Still we are struggling to address the issue. This Error occurrs only when the templates are added from the dummy grid. It is working fine when the grid has its template of its own. However, we need to look bit more for some possible workaround and let you know later.

Thanks for your patience.

Thanks for using Syncfusion products.

Regards,
Gokulkumar.B


AD Administrator Syncfusion Team December 26, 2006 05:46 PM UTC

Hi Jeff,

I very much appreciate your patience on this issue, but once again I apologize for the delay, in getting back to you. We need to investigate more on this issue and let you know later within "Friday".

Thanks for using Syncfusion products.

Regards,
Gokulkumar.B





AD Administrator Syncfusion Team December 27, 2006 06:38 PM UTC

Gokulkumar,
Thank you for keeping me posted on the progress and for the resolution as soon as it becomes available.

Best
Jeff


>Hi Jeff,

I very much appreciate your patience on this issue, but once again I apologize for the delay, in getting back to you. We need to investigate more on this issue and let you know later within "Friday".

Thanks for using Syncfusion products.

Regards,
Gokulkumar.B





JE Jeff January 5, 2007 10:25 PM UTC

Gokulkumar,

Can you provide me an update on this issue? Our development has halted until this gets corrected; so a resolution is critical. Thanks!

Best
Jeff


AD Administrator Syncfusion Team January 8, 2007 01:37 PM UTC

Hi Jeff,

We apologize for the delay, in getting back to you. We are looking into it and will let you know by tomorrow.

Regards,
Valli.

>Gokulkumar,

Can you provide me an update on this issue? Our development has halted until this gets corrected; so a resolution is critical. Thanks!

Best
Jeff


AD Administrator Syncfusion Team January 9, 2007 10:45 AM UTC

Hi Jef,

Table Rows of the GridGrouping Control couldn't be retrieved when templates are created at the runtime. This is because 'this.GridGroupingControl1.TopLevelTable'is set to 'null' when the templates are created in the runtime as in the previous attached sample [Forum_53447_86a19ef6.zip].

This seems to be a bug and this has been forwarded to the Essential Grid Development team. Will update you the time frame within a week, as to when the fix will be available.

We really apologize for the delay and the inconvience caused.

Thanks for using syncfusion products.

Regards,
Valli.


AD Administrator Syncfusion Team February 10, 2007 06:59 AM UTC

Hi Jef,

This issue is opened and the fix will be available on or before 05, March 2007.

Thank you for using Syncfusion products.

Regards,
Sureshsekaran.


AD Administrator Syncfusion Team March 1, 2007 07:38 AM UTC

Hi Jef,

We have forwarded this issue to our developers and we will surely update you with the fix for this issue on March23th, 2007. You can keep track of the progress of the issue from the below link

http://www.syncfusion.com/support/issues/grid/Default.aspx?ToDo=view&questId=3340

We regret for the inconvenience caused.

Thanks and Regards,
Sharmila


DC David Cyr April 4, 2007 07:21 PM UTC

Has any progress been made regarding thiss issue? I've run the same problem and would like to know if you figured out how to get around it.

Regards,

Dave


MT Mitul Thobhani May 9, 2007 04:34 PM UTC

Hello, I am also wondering if this has been resolved as we are also facing this problem.

Any news?


VA Valli Syncfusion Team May 18, 2007 10:39 AM UTC

Hi Dave/Mitul,

Sorry for the inconvience caused.

Include the below code snippet before the accessing the TopLevelTable rows, to rectify the null exception issue.

this.GridGroupingControl1.CreateControlHierarchy();

Please let us know if this helps you.

Regards,
Valli

Loader.
Up arrow icon