Hi
I am new with Telerik controls. They seem simple enough, but I am having an issue with the RadGrid.
When binding data to my RadGrid, I receive this message:
Unable to cast object of type 'Telerik.Web.UI.GridTableRow' to type 'Telerik.Web.UI.GridItem'.
Here is my aspx code:
Here is my .cs code:
Stack trace:
Any ideas?
I am new with Telerik controls. They seem simple enough, but I am having an issue with the RadGrid.
When binding data to my RadGrid, I receive this message:
Unable to cast object of type 'Telerik.Web.UI.GridTableRow' to type 'Telerik.Web.UI.GridItem'.
Here is my aspx code:
<telerik:RadGrid ID="ugMessages" runat="server"></telerik:RadGrid> |
Here is my .cs code:
ugMessages.DataSource = ds.Tables[0]; |
ugMessages.DataBind(); |
Stack trace:
Server Error in '/pcs' Application. |
-------------------------------------------------------------------------------- |
Unable to cast object of type 'Telerik.Web.UI.GridTableRow' to type 'Telerik.Web.UI.GridItem'. |
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. |
Exception Details: System.InvalidCastException: Unable to cast object of type 'Telerik.Web.UI.GridTableRow' to type 'Telerik.Web.UI.GridItem'. |
Source Error: |
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
Stack Trace: |
[InvalidCastException: Unable to cast object of type 'Telerik.Web.UI.GridTableRow' to type 'Telerik.Web.UI.GridItem'.] |
Telerik.Web.UI.GridTableRow.get_ClientID() +86 |
Coolite.Utilities.<>c__DisplayClass1.<FindControlByClientID>b__0(Control c) +37 |
Coolite.Utilities.ControlUtils.RecurseControls(ControlCollection controls, FindControlDelegate callback) +131 |
Coolite.Utilities.ControlUtils.RecurseControls(ControlCollection controls, FindControlDelegate callback) +181 |
Coolite.Utilities.ControlUtils.RecurseControls(ControlCollection controls, FindControlDelegate callback) +181 |
Coolite.Utilities.ControlUtils.RecurseControls(ControlCollection controls, FindControlDelegate callback) +181 |
Coolite.Utilities.ControlUtils.RecurseControls(ControlCollection controls, FindControlDelegate callback) +181 |
Coolite.Utilities.ControlUtils.RecurseControls(ControlCollection controls, FindControlDelegate callback) +181 |
Coolite.Utilities.ControlUtils.RecurseControls(ControlCollection controls, FindControlDelegate callback) +181 |
Coolite.Utilities.ControlUtils.RecurseControls(ControlCollection controls, FindControlDelegate callback) +181 |
Coolite.Utilities.ControlUtils.RecurseControls(ControlCollection controls, FindControlDelegate callback) +181 |
Coolite.Utilities.ControlUtils.RecurseControls(ControlCollection controls, FindControlDelegate callback) +181 |
Coolite.Utilities.ControlUtils.RecurseControls(ControlCollection controls, FindControlDelegate callback) +181 |
Coolite.Utilities.ControlUtils.RecurseControls(ControlCollection controls, FindControlDelegate callback) +181 |
Coolite.Utilities.ControlUtils.RecurseControls(ControlCollection controls, FindControlDelegate callback) +181 |
Coolite.Utilities.ControlUtils.RecurseControls(ControlCollection controls, FindControlDelegate callback) +181 |
Coolite.Utilities.ControlUtils.FindControlByClientID(ControlCollection controls, String clientID) +95 |
Coolite.Utilities.ControlUtils.FindControl(ControlCollection controls, String idOrClientID) +35 |
Coolite.Ext.Web.Window.OnBeforeClientInit(Component sender) +254 |
Coolite.Ext.Web.Component.OnBeforeClientInitHandler() +35 |
Coolite.Ext.Web.Component.OnClientInit() +26 |
Coolite.Ext.Web.WebControl.SetResources() +81 |
Coolite.Ext.Web.WebControl.OnPreRender(EventArgs e) +108 |
System.Web.UI.Control.PreRenderRecursiveInternal() +86 |
System.Web.UI.Control.PreRenderRecursiveInternal() +170 |
System.Web.UI.Control.PreRenderRecursiveInternal() +170 |
System.Web.UI.Control.PreRenderRecursiveInternal() +170 |
System.Web.UI.Control.PreRenderRecursiveInternal() +170 |
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2041 |
-------------------------------------------------------------------------------- |
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433 |
Any ideas?