Binding RadGrid on button click?

3 posts, 0 answers
  1. Will
    Will avatar
    6 posts
    Member since:
    Aug 2013

    Posted 06 Sep 2013 Link to this post

    Hi there. I have an aspx page that initially shows a treeview. When a child node on the tree is pressed, i want a RadGrid on the page to be popualated. I set the datasource and do a databind() call but it doesn't seem to be working. I've also tried using needDataSource but it has the same problem. Here's my code:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Data;
    using Telerik.Web.UI;
    using MCMwebapp.Utilities;
    namespace MCMwebapp
        public partial class frmLookupTables : System.Web.UI.Page
            int CurrentDemog;
            bool LookupDataLoaded;
            bool isOPS = false;
            string selectedNode;
            protected void Page_Load(object sender, EventArgs e)
                if (!IsPostBack)
            protected void LookupsTree_NodeClick(object sender, Telerik.Web.UI.RadTreeNodeEventArgs e)
                RadTreeNode currNode = e.Node;
                if (currNode.Nodes.Count == 0) {
                    if (currNode.ParentNode.Text != "Treatments" && !String.IsNullOrEmpty(currNode.Text))
                        selectedNode = currNode.Text;
                        Session["selectedNode"] = selectedNode;
            protected void loadLookupGrid()
                using (ServiceReference1.Service1SoapClient myService = new ServiceReference1.Service1SoapClient())
                    if (Session["selectedNode"] != null)
                        LookupGrid.DataSource = myService.getTable();

    My aspx code:

    <%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="frmLookupTables.aspx.cs" Inherits="MCMwebapp.frmLookupTables" %>
    <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
        <asp:Label ID="LookupLabel" runat="server"></asp:Label>
          <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                <telerik:AjaxSetting AjaxControlID="LookupGrid">
                        <telerik:AjaxUpdatedControl ControlID="LookupGrid" LoadingPanelID="TablePanel"></telerik:AjaxUpdatedControl>
         <telerik:RadAjaxPanel ID="TreePanel" runat="server" HorizontalAlign="NotSet" style="background-color:#808080; float:left" Width="40%">
             <telerik:RadTreeView ID="LookupsTree" runat="server" OnClientNodeClicked="ClientNodeClicked" OnNodeClick="LookupsTree_NodeClick">
         <telerik:RadAjaxLoadingPanel ID="TablePanel" runat="server" HorizontalAlign="Right"
            style="background-color:#E92326; float:right" Width="40%" >
             <telerik:RadGrid ID="LookupGrid" runat="server" BackColor="Gray"
                 BorderColor="#404040" BorderStyle="Solid" CellSpacing="0" GridLines="None"
                 <FilterMenu EnableImageSprites="False">
       <script type="text/javascript">
           function ClientNodeClicked(sender, eventArgs) {
               var node = eventArgs.get_node();

    Any ideas? thanks

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 08 Sep 2013 Link to this post


    Please try setting the RadGrid outside the RadAjaxLoadingPanel tag. You can set the RadGrid either inside or outside the RadAjaxPanel. Please note that using RadAjaxManager simultaneously with RadAjaxPanel or UpdatePanel ( or implementing multiple wrapped RadAjaxPanels ) is not a supported scenario and we highly recommend to avoid such implementation. Please either use just the manager to update your controls replacing the RadAjaxPanel with a regular asp:Panel, or use the RadAjaxPanel alone to wrap your page.

  3. Will
    Will avatar
    6 posts
    Member since:
    Aug 2013

    Posted 09 Sep 2013 Link to this post

    Thanks! I had figured out there was an issue with the loading panel earlier, but thanks for clarifying.
Back to Top