Hello All
i want bind my grid on client side after click on a button, my code is very very simple but when i want catch table view with this code,returns null
this is my full client side code:
this is my full server side code:
what is the problem do you think.
Special thanks
Mohammd
i want bind my grid on client side after click on a button, my code is very very simple but when i want catch table view with this code,returns null
var tableView = $find("<%= RadGrid1.ClientID %>").get_masterTableView();this is my full client side code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title> <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> <script language="javascript" type="text/javascript"> function Button1_onclick() { var tableView = $find("<%= RadGrid1.ClientID %>").get_masterTableView(); PageMethods.GetData(1, true, updateGrid); } function updateGrid(result) { var tableView = $find("<%= RadGrid1.ClientID %>").get_masterTableView(); tableView.set_dataSource(result); tableView.dataBind(); } </script> </telerik:RadCodeBlock></head><body> <form id="form1" runat="server"> <input id="Button1" type="button" value="button" onclick="return Button1_onclick()" /> <telerik:RadScriptManager ID="RadScriptManager1" Runat="server" EnablePageMethods="true"> </telerik:RadScriptManager> <br /> <telerik:RadGrid ID="RadGrid1" runat="server" EnableViewState="false"> <MasterTableView> <Columns> <telerik:GridBoundColumn DataField="pic" HeaderText="pic" /> </Columns> </MasterTableView> </telerik:RadGrid> </form></body></html>this is my full server side code:
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.Services;using System.Data;public partial class Default2 : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) { } [WebMethod] public static List<object> GetData(int departmentID, bool SelectSubNodesPersonels) { DAL.Personels ObjPersonels = new DAL.Personels(); DataTable DT = ObjPersonels.Personels_SELECT_BY_DepartmentID(departmentID, SelectSubNodesPersonels); return ObjPersonels.Convert_DataTable_To_List_Object(DT); }}what is the problem do you think.
Special thanks
Mohammd