This is a migrated thread and some comments may be shown as answers.

Refresh hierarchical RadGridView data

3 Answers 359 Views
GridView
This is a migrated thread and some comments may be shown as answers.
joseph_korn
Top achievements
Rank 1
joseph_korn asked on 20 May 2008, 06:41 PM
I have setup a hierarchical RadGridView with a 2 command button columns on the master rows (remove, and add new child row), and the child rows have 1 command button, remove.. When adding a new child row, a modal form is shown and after the info is filled out and saved, the gridview was completely rebound and reloaded.. The same thing occurs when I hit a remove button, except that the row is deleted.. I originally had this working in the Q3 2007 version without any problems, but in upgrading to q1 2008, my same code no longer works..

I realize my original setup was probably less than correct, and i now have the gridview setup with 2 global BindingLists.. One is bound to the mastertemplate, and the other is bound to the childtemplate.. Now when I add a new child row, I just add the proper object to the child bindinglist variable, and it automaticaly shows up in the gridview (much better!)..

The problem I am having is that when I try to remove/delete a row [bindinglist.removeat(index)], I get the following error:

"This row has been removed from a table and does not have any data.  BeginEdit() will allow creation of new data in this row."

I somewhat understand that the gridview is still bound to this object somehow.. What I don't understand is how to go about correcting the issue..

Any help would be appreciated, including any suggestions for how to accomplish refreshing the data on my gridview without the bindinglists

3 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 23 May 2008, 12:39 PM
Hello joseph_korn,

I could not reproduce the issue described. Please open a new support ticket and send me a sample application which reproduces the incorrect behavior. It will allow me to help you further.

As to the RadGirdView binding, BindingList is the most appropriate one when binding to a collection of custom objects. It creates a two-way binding mechanism which allows you to get the data in your RadGridView automatically refreshed.

If you have additional questions, feel free to contact me.

Kind regards,
Nikolay
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Anil kumar
Top achievements
Rank 1
answered on 21 Jan 2010, 06:59 AM
Hi have similar problem,

When i add child rows to binding list, it is creating empty rows in grid.

When i try to click on that empty row, it throws null ref exception.
0
Nikolay
Telerik team
answered on 26 Jan 2010, 09:57 AM
Hello Anil kumar,

You can find the asnwer to your question in the support ticket that you have opened about the same topic.

Sincerely yours,
Nikolay
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
joseph_korn
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Anil kumar
Top achievements
Rank 1
Share this question
or