Hello, I'm having a little bit of a problem, I'm binding my data source using the event "NeedDataSource"
However, in the case of no records available, if I hit the add new record button. I get the loading circle appears but then my "EditItemTemplate" Items don't. I tried adding a record directly though an SQL query, and then it worked.
What could be the reason for this? and how can I solve it? Thank.
However, in the case of no records available, if I hit the add new record button. I get the loading circle appears but then my "EditItemTemplate" Items don't. I tried adding a record directly though an SQL query, and then it worked.
What could be the reason for this? and how can I solve it? Thank.
13 Answers, 1 is accepted
0
Hi Hosam,
Thank you for contacting us.
I have created a sample RadGrid web site to test the described behavior. On my side the insert form appears as expected. Can you please check out the attached application and let me know if it runs correctly on your end, too?
Additionally, you can check out various demos for data editing using RadGrid:
http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/alleditablecolumns/defaultcs.aspx
Greetings,
Eyup
the Telerik team
Thank you for contacting us.
I have created a sample RadGrid web site to test the described behavior. On my side the insert form appears as expected. Can you please check out the attached application and let me know if it runs correctly on your end, too?
Additionally, you can check out various demos for data editing using RadGrid:
http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/alleditablecolumns/defaultcs.aspx
Greetings,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0

Arlene
Top achievements
Rank 1
answered on 03 Feb 2015, 09:39 PM
I'm having the same issue originally reported by Hosam. I tried the link to the application you suggested and it works fine. I downloaded the zip file provided and compared it to the aspx side of my code. I get an error when I click on the Add button in the RadGrid:
Unable to cast object of type 'Telerik.Web.UI.GridInsertionObject' to type 'System.Data.DataRowView'.
I had commented out all of the code in my code-behind associated with an insert and have messages displaying on the screen instead. As far as I can tell it isn't even accessing the code-behind.
Any suggestions as to where I should look to solve this?
Thank you in advance.
Unable to cast object of type 'Telerik.Web.UI.GridInsertionObject' to type 'System.Data.DataRowView'.
I had commented out all of the code in my code-behind associated with an insert and have messages displaying on the screen instead. As far as I can tell it isn't even accessing the code-behind.
Any suggestions as to where I should look to solve this?
Thank you in advance.
0
Hi Arlene,
I've created a new web site sample to test the described behavior. Can you check the attached sample on your side and let me know about the result?
In addition, please temporarily disable any ajaxification on the page if present
(RadAjaxManager, RadAjaxPanel, UpdatePanel, etc.) and enable your script debugger (FireBug or F12) to see whether there are any script errors interfering.
Regards,
Eyup
Telerik
I've created a new web site sample to test the described behavior. Can you check the attached sample on your side and let me know about the result?
In addition, please temporarily disable any ajaxification on the page if present
(RadAjaxManager, RadAjaxPanel, UpdatePanel, etc.) and enable your script debugger (FireBug or F12) to see whether there are any script errors interfering.
Regards,
Eyup
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0

Arlene
Top achievements
Rank 1
answered on 09 Feb 2015, 02:25 PM
The page you sent worked just fine. I compared your code and mine to see what the differences are. There are a few. First of all I'm using a custom Edit form definition since I want to include many more columns in the Edit template than I'm showing in the columns. Secondly I've put the definition of the edit screen in a control rather than including it in the RadGrid itself. This works fine for the editing process but perhaps that is where the problem is for adding a record. I use an <EditFormSettings... tag with a reference to the control in the UserControlName attribute. Is there an equivalent tag I need to include for the Add feature?
I turned on Firebug and I don't see any script errors, just the 'Unable to cast object of type 'Telerik.Web.UI.GridInsertionObject' to type 'System.Data.DataRowView' error when I click on Add a new record.
Thanks in advance.
Arlene
I turned on Firebug and I don't see any script errors, just the 'Unable to cast object of type 'Telerik.Web.UI.GridInsertionObject' to type 'System.Data.DataRowView' error when I click on Add a new record.
Thanks in advance.
Arlene
0

Arlene
Top achievements
Rank 1
answered on 10 Feb 2015, 04:57 PM
I've been doing a little more fiddling with this problem and I have one more piece of information to add to the problem. If I remove the need for a custom edit form and revert to:
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column">
</EditColumn>
</EditFormSettings>
then the Add new record works. I have to conclude that the problem is related to either a custom edit form or the fact that I have it set up as a control. If you have any insight into this please let me know.
Thanks,
Arlene
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column">
</EditColumn>
</EditFormSettings>
then the Add new record works. I have to conclude that the problem is related to either a custom edit form or the fact that I have it set up as a control. If you have any insight into this please let me know.
Thanks,
Arlene
0
Hello Arlene,
Please check for GridInsertionObject condition in your code, probably it is located in some button expression. You can check the following samples for similar implementations:
http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/form-template-update/defaultcs.aspx
http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/edit-form-types/defaultcs.aspx
Regards,
Eyup
Telerik
Please check for GridInsertionObject condition in your code, probably it is located in some button expression. You can check the following samples for similar implementations:
http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/form-template-update/defaultcs.aspx
http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/edit-form-types/defaultcs.aspx
Regards,
Eyup
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0

Arlene
Top achievements
Rank 1
answered on 13 Feb 2015, 09:21 PM
The second example you gave I believe is actually the example I started with for my own code. For debugging purposes I had actually commented out all of the code associated with the insertion in the code behind leaving just a message to be displayed on the page so I knew it got that far. It's not getting there. The message is never displayed. Something must be missing.
The one big difference between the second example you provided and the code I have is that my code has ALL of the edit form in a control whereas the example has part on the defaultcs.aspx page and part in a control. I have my insertion code in the equivalent of the defaultcs.aspx.cs page. Does there need to be something in the equivalent of the EmployeesDetailsCS.aspx.cs page since in my case the equivalent of the EmployeesDetailsCS.aspx.cs has all of the fields for a record?
The one big difference between the second example you provided and the code I have is that my code has ALL of the edit form in a control whereas the example has part on the defaultcs.aspx page and part in a control. I have my insertion code in the equivalent of the defaultcs.aspx.cs page. Does there need to be something in the equivalent of the EmployeesDetailsCS.aspx.cs page since in my case the equivalent of the EmployeesDetailsCS.aspx.cs has all of the fields for a record?
0

Arlene
Top achievements
Rank 1
answered on 17 Feb 2015, 07:45 PM
I've tried downloading the code for the second example you provided. I keep getting errors when I try to run it. First error was on the defaultcs.aspx page - <qsf:ConfiguratorPanel. I removed this along with the code behind that references it. I then got an error that Object reference not set to an instance of an object. No line numbers or other clues associated with that one. I saw a reference to Northwind in the code behind. Does the code require that I have access to the Northwind example database?
0

Arlene
Top achievements
Rank 1
answered on 17 Feb 2015, 08:14 PM
While waiting for verification on whether the example is dependent on Northwind, I decided to go ahead and create an 'Employees' table in my existing SQL database. I was able to get the screen to come up. However, when I click on 'Add a Record' nothing happens.
Next I added a test record directly in the database and tried again. After recycling the application pool and getting the record I added to show up I again tried to Add a Record. Again, it didn't work. The Edit also does not work.
Since it obviously works on your website, there has to be something different between the two - either the code or the environment. I don't see how it could have anything to do with the 'qsp' tag I removed.
Is there a particular version of .NET that I need to be using for this?
Do I need a particular version of Telerik.Web.UI for it to work?
Ideas?
Arlene
Next I added a test record directly in the database and tried again. After recycling the application pool and getting the record I added to show up I again tried to Add a Record. Again, it didn't work. The Edit also does not work.
Since it obviously works on your website, there has to be something different between the two - either the code or the environment. I don't see how it could have anything to do with the 'qsp' tag I removed.
Is there a particular version of .NET that I need to be using for this?
Do I need a particular version of Telerik.Web.UI for it to work?
Ideas?
Arlene
0

Arlene
Top achievements
Rank 1
answered on 17 Feb 2015, 09:14 PM
Another clue. I went back to my original code for the web application I'm creating and moved the code from the control I created directly into the aspx page. Lo and behold the Add a record button brought up a screen with empty fields in it. So this gets me back to the point that it looks like the problem has to do with using a control for the Edit Form. Now for several of the screens I have to do this approach will work just fine. But I've got one that is rather complicated and it would really be better if I could use a control rather than putting the code inline. So.. I'd really like to get it to work.
Help?.
Arlene
Help?.
Arlene
0
Hi Arlene,
I'm sending a runnable version of the mentioned demo which you can check and compare with your own project.
I believe this will prove helpful.
Regards,
Eyup
Telerik
I'm sending a runnable version of the mentioned demo which you can check and compare with your own project.
I believe this will prove helpful.
Regards,
Eyup
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0

Arlene
Top achievements
Rank 1
answered on 19 Feb 2015, 05:42 PM
Eyup -
Thank you very much for sending me the working example. I've been setting it up in my environment and have a question associated with the final solution. I'm currently getting an error message telling me that the Telerik version I have on my server is meant for DotNetNuke only and will not work with your example. Now I know I can download a trial version of Telerik that should work with your example, but my question is whether the solution used with your example ultimately won't work for me since I am in a DotNetNuke environment and our Telerik components are therefore not the same as the full Telerik version. If it's not going to work with the Telerik version I have I'm going to have to look for another solution anyway. On the other hand if it's a minor feature that won't work with the DotNetNuke version, that is an entirely different issue.
Thank you in advance for clearing this up for me.
Arlene
Thank you very much for sending me the working example. I've been setting it up in my environment and have a question associated with the final solution. I'm currently getting an error message telling me that the Telerik version I have on my server is meant for DotNetNuke only and will not work with your example. Now I know I can download a trial version of Telerik that should work with your example, but my question is whether the solution used with your example ultimately won't work for me since I am in a DotNetNuke environment and our Telerik components are therefore not the same as the full Telerik version. If it's not going to work with the Telerik version I have I'm going to have to look for another solution anyway. On the other hand if it's a minor feature that won't work with the DotNetNuke version, that is an entirely different issue.
Thank you in advance for clearing this up for me.
Arlene
0
Hi Arlene,
I'm afraid DotNetNuke is no longer in our support boundaries. I would suggest that you check your project with our latest trial DLLs and consider upgrading to dev:
http://www.telerik.com/purchase.aspx
Regards,
Eyup
Telerik
I'm afraid DotNetNuke is no longer in our support boundaries. I would suggest that you check your project with our latest trial DLLs and consider upgrading to dev:
http://www.telerik.com/purchase.aspx
Regards,
Eyup
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.