This one's really stumping me. And it looks simple. I have a telerik: RadGrid on an aspx page and I'm using a web service to get a table and bind it. I bind it once on page_load and when a node from a tree is clicked i want to bind it again displaying new info. However, when trying to bind from this function the grid comes up null. For right, now I'm using the same service call to bind.
Here's my server code:
protected void Page_Load(object sender, EventArgs e)
{
using (ServiceReference1.Service1SoapClient myService = new ServiceReference1.Service1SoapClient())
{
CurrentDemog = Convert.ToInt32(Session["demog"].ToString());
DataTable lookupTbl = myService.getTable();
LookupGrid.DataSource = lookupTbl;
LookupGrid.DataBind();
}
}
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;
using (ServiceReference1.Service1SoapClient myService = new ServiceReference1.Service1SoapClient())
{
Util.ClearGrid(ref LookupGrid);
DataTable lookupTbl = myService.getTable();
LookupGrid.DataSource = lookupTbl;
LookupGrid.DataBind();
}
}
}
}``
Here's my client code:
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="LookupGrid">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="LookupGrid"></telerik:AjaxUpdatedControl>
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadGrid ID="LookupGrid" runat="server" BackColor="Gray"
BorderColor="#404040" BorderStyle="Solid" CellSpacing="0" GridLines="None"
Skin="MetroTouch">
</telerik:RadGrid>