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

RadGrid for ASP.Net Ajax expand programatically

2 Answers 120 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Stephen
Top achievements
Rank 1
Stephen asked on 11 Jul 2008, 05:38 PM
I have a RadGrid with a MasterTable and inner Details table. After an event causes the details datasource to insert a new row the details table of the grid view does not display the new data. If I call  RadGrid1.DataBind();  that will cause the inner table to close and then when the user manually expands it the new data shows ... what I want is for a databind to update both pieces of the RadGrid.

Thanks
 

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 14 Jul 2008, 05:23 AM
Hi Stephen,

Hierarchichal structure is not supported with Simple data-binding( calling DataBind()).Use AdvanceDataBinding techniques to bind the Grid.

Advanced data-binding

Use RadGrid1.Rebind() instead of RadGrid1.DataBind()

Thanks
Shinu
0
Stephen
Top achievements
Rank 1
answered on 14 Jul 2008, 02:20 PM
Sorry, the documentation lost me ... I do not understand.

My scenario is as follows.  My web page has 2 SQL datasources, one for the master table and the other for the detail table. When the user clicks a button I have code that does some input validatation and then if appropriate I call each dataset's Insert() to get the new data into the database tables. This is when I want to have the RadGrid display fully expanded with the new rows of data in both the master and detail view. But the new rows do not show up in the detail table.

In the RadGrid1 MasterTableView properties I tried changing the setting on the HierachyDefaultExpanded to True and tried HierachyLoadMode at various values (ServerBind, ServerOnDemand, Client).  These combinations did NOT work for me.  The new data rows do not appear in the RadGrid unless the user manually collapses and expandeds the detail table.

What should there 2 properties be set at and do you have a SIMPLE example of what code I should use & what event I should do it in?

Regards.

Tags
Grid
Asked by
Stephen
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Stephen
Top achievements
Rank 1
Share this question
or