Dear All
I created a page method that return the result data source in json string format to bind the RadGrid:
and then i call the page method at client side at user button click:
The problem is that there no action done on the RadGrid ??
It doesn't bind any data!
Is there something miss ?
Thanks
I created a page method that return the result data source in json string format to bind the RadGrid:
[WebMethod]
public
static
string
GetRows(
int
from,
int
len)
{
DataTable dt = MyEntity_BL.GetData();
//convert DataTable into Json string
System.Web.Script.Serialization.JavaScriptSerializer serializer =
new
System.Web.Script.Serialization.JavaScriptSerializer();
List<Dictionary<
string
,
object
>> rows =
new
List<Dictionary<
string
,
object
>>();
Dictionary<
string
,
object
> row =
null
;
foreach
(DataRow dr
in
dt.Rows)
{
row =
new
Dictionary<
string
,
object
>();
foreach
(DataColumn col
in
dt.Columns)
{
row.Add(col.ColumnName, dr[col]);
}
rows.Add(row);
}
return
serializer.Serialize(rows);
}
and then i call the page method at client side at user button click:
function btnShowClientClick(clickedButton) {
PageMethods.GetRows(0, 0, Succsess);
}
function Succsess(result) {
var masterTable = $find("<%= grd.ClientID %>").get_masterTableView();
masterTable.set_dataSource(result);
masterTable.rebind();
}
The problem is that there no action done on the RadGrid ??
It doesn't bind any data!
Is there something miss ?
Thanks