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

How to refresh the RadGrid On Treeview Node Click.

1 Answer 115 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Munish
Top achievements
Rank 1
Munish asked on 17 Dec 2011, 08:52 AM
Hi,
I have one data bound tree view. 
On three view click i Need to refresh my Grid..

On Treenode click event handler. I called the RadGrid's Rebind Method and it call the RadGrid1_NeedDataSource method where i again reset the Datasource of the grid according to selection in the treeview. But my grid is not updating the datasource..

Here is some code..

protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
 {
     if (!String.IsNullOrEmpty(RadTreeViewContainers.SelectedValue))
         RadGrid1.DataSource = WorkBoard.Client.Task.GetTaskByContainerId(RadTreeViewContainers.SelectedValue);
     else
         RadGrid1.DataSource = WorkBoard.Client.Task.GetTaskByContainerId(TaskFolders[0].Id);
 }

Node click handler 

protected void RadTreeViewContainers_NodeClick(object sender, RadTreeNodeEventArgs e)
  {
       RadGrid1.Rebind();
  }

DataSource is perfect but Not refreshing the grid.. But when manually refresh the grid from refresh button in grid. work awesome..
Please help me its very urgent..
Thanks.



1 Answer, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 18 Dec 2011, 06:48 PM
Hello,

If your grid was ajaxified then please add below code in to your page
<telerik:RadAjaxManager ID="" runat="server">
          <AjaxSettings>
              <telerik:AjaxSetting AjaxControlID="RadTreeViewContainers">
                  <UpdatedControls>
                      <telerik:AjaxUpdatedControl ControlID="Radgrid1" />
                  </UpdatedControls>
              </telerik:AjaxSetting>
          </AjaxSettings>
      </telerik:RadAjaxManager>

or

if you used Asp:UpdatePanel then also set both control in same contentPanel.

Thanks,
Jayesh Goyani
Tags
Grid
Asked by
Munish
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Share this question
or