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

Refresh mastertable after inserting/updateing detail

3 Answers 154 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chayady
Top achievements
Rank 1
Chayady asked on 21 Aug 2008, 09:50 AM
Halo all

I have 2 level grid.
Master - Detail.
I use NeedDataSource to bind to db.
When i insert/update the detail,
i need to sum the detail and show on master.

On UpdateCommand event,
i use grid.Rebind() to refresh the grid.
It works as i want, but the edit form is not close.
Edit form will close (as normal) if i am not using rebind()

I have tried to rebind and call the e.item.edit = false,
but it will close all the hierarchy.

Is there any way to call Rebind() in UpdateCommand event
and close the editform template?

Or is there any other better way, to refresh the master when any changed on the detail?

Thanks in advanced.
Chayady

3 Answers, 1 is accepted

Sort by
0
Leon
Top achievements
Rank 1
answered on 21 Aug 2008, 08:37 PM
Chayady,

I think that's indeed possible. I mean calling Rebind in UpdateCommand the Grid cannot finish updating the item, i.e. closing the edit form. Instead, have you tried using the ItemUpdated?

As to the detail table collapsing, I'm afraid it will be collapsed unless you explicitly expand that again (it thats possible at all). Rebinding the master table (or the Grid if you prefer) will surely collapse its details.

Hope this helps!
~Leon
0
Carlos
Top achievements
Rank 1
answered on 22 Aug 2008, 12:09 AM
Leon.

I also have the same issue, i need to rebind the grid when a child is updated, i already tried to use it on ItemUpdated and it does not work either, it still leaves edit mode open, do you have any other suggestion or is there any other solution?

thanks in advance.
0
Chayady
Top achievements
Rank 1
answered on 22 Aug 2008, 01:32 AM
Halo Leon

Thanks for your answer.
Do you mean i have to do "retain expanded/selected state in hierarchy on rebind" (http://www.telerik.com/community/code-library/submission/b311D-ghhmh.aspx)

Thanks in advance
Chayady Sarpin
Tags
Grid
Asked by
Chayady
Top achievements
Rank 1
Answers by
Leon
Top achievements
Rank 1
Carlos
Top achievements
Rank 1
Chayady
Top achievements
Rank 1
Share this question
or