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

Grid Hierarchy Edit form does not go away

1 Answer 52 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Osmon
Top achievements
Rank 1
Osmon asked on 25 Sep 2010, 07:15 PM
Hi,
    I have a Hierarchy grid 3 levels. My data is all in the session. Grid is ViewState=false. Now in the update i have to also update all the levels for the item (parent, grand parent). The edit for is only at the deepest level (3). Update works fine with the detail table (3 level). now to update upper levels i have to set the grid data source = null so that i can call  the needdatasource, also need to call rebind() for the detail tables.
   If i do not Rebind(), after the update the edit form disappears ( proper behaviour) BUT when i use the datasource=null and Rebind() then data do get updated in all levels but the eidt form does not go away. I even tried calling clearedititems() but no avail. editmode makes no difference.
    Note : The edit form does go away if i click update again (2nd time) , also it does not call the updatecommand event the second time.
   As a quick fix, probably i can just redirect to the page so the edit form would not open initially.

whats the proper way of doing it ?

Thanks,

Regards,

Osman

plz : do not reply after 3 days asking for sample code ;)

I tried attaching ascreen shot, may be your radupload doesn't work properly...

1 Answer, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 29 Sep 2010, 05:48 AM
Hi Osmon,

I assume you are handling the updates on ItemCommand or UpdateCommand. There isntead of setting the RadGrid data source to null and rebinding the nested tableviews, perform the below code:

e.Canceled = true;
e.Item.Edit = false;
(sender as RadGrid).Rebond();


Sincerely yours,
Iana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Osmon
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Share this question
or