开发者

How to regenerate grid data on various button click event of a page while we are using telerik grid with LinqDataSource

I am using Telerik grid control and LinqDataSource control on a page.

code :

<asp:LinqDataSource ID="ldsFillGridData" runat="server" OnSelecting="ldsFillGridData_Selecting" />

all things working fine now i want to call its

开发者_JS百科
protected void ldsFillGridData_Selecting(object sender, LinqDataSourceSelectEventArgs e)
{
    e.Result = from tc in db.city select tc;
}

this selecting event calling from some button click event. How???

I am trying like

ldsFillGridData_Selecting(null, null);

but it throws an error.

How to regenerate grid data on various button click event of a page while we are using telerik grid with LinqDataSource?


Just use Rebind() function of this telerik grid control, it will automatically calls ldsFillGridData_Selecting event and it shows updated records in Grid.

RadGrid.rebind();


RadGrid1.Rebind();

Will rebind the grid, calling the select method of your datasource (as long as the linqdatasource is indicated as datasource for the grid).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜