开发者

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

开发者 https://www.devze.com 2023-03-25 12:13 出处:网络
I am using Telerik grid control and LinqDataSource control on a page. code : <asp:LinqDataSource ID=\"ldsFillGridData\" runat=\"server\" OnSelecting=\"ldsFillGridData_Selecting\" />

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

精彩评论

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

关注公众号