Login  
Search All Forums
Dart Home | PowerWEB LiveControls for ASP.NET | Custom Development Reply | PowerWEB LiveControls for ASP.NET Topics | Forums   
AuthorForum: PowerWEB LiveControls for ASP.NET
Topic: Checkbox in LiveDataGrid errors when chaning page
Toadwart

From: Auckland, New Zealand
Posts: 6
Member Since: 05/22/05
posted May 23, 2005 8:10 PM

If I have an enabled checkbox column in my livedatagrid and I move to the next page then back to the first page I get the following error.
--------------------------
An error has occurred because a control with auto-generated id 'ldgRolesAssigned:_ctl6:_ctl0' could not be located to raise a postback event. To avoid this error, explicitly set the ID property of controls that raise postback events.

-------------------------
notes:
-I enable the checkbox by setting the NonEditModeBehavior attribute of the column to "EnabledCheckBox".

-Only happens when moving from one page of data that is showing fewer items than the rpev page.
i.e. If I have a grid showing 10 items I can page back and forth happily through all pages until I reach the last page that displays less than 10 items. When I move to the previous page the error is thrown.

-Only happens if the checkbox xolumn is enabled. If it's disabled it doesn't error.

-I've also tried this with a standard 'DataBound' column to which I added a System.Web.UI.WebControls.CheckBox control in the ItemDataBind event. Some error occurrs when changing pages.
Jeff Cranford



From: Rome, NY USA
Posts: 586
Member Since: 05/30/01
posted May 25, 2005 4:50 PM

This error is raised by the Microsoft Framework, not our controls. From their error message, it looks like a scenario they accounted for in a dynamic control scenario, as they provided instructions to fix. What happens if you assign an explicit ID, as they mention?
Toadwart

From: Auckland, New Zealand
Posts: 6
Member Since: 05/22/05
posted June 2, 2005 6:43 PM

Confused developer here...
I change my code to workaround the problem for awhile but have now gone back and added an enabled checkbox column and am not getting this error.

However, I now cant figure out how to attach an event handler to the checkboxes so I can perform some actions whenever they are changed.

I assume I need to add the handler to the control as the grid is being created in the ItemDataBound or ItemCreated events?
My problem is that the controls collection of my checkbox column is always empty.
At what point does the checkbox control actually get created? an dhow do I access it to attach the handler?

Thanks
Toadwart
Reply | PowerWEB LiveControls for ASP.NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX