1

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

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?

  • I am not sure if this is needed but you may need to handle the need_outsource event. In there you simply fill your dataset again. No need to rebind. http://demos.telerik.com/aspnet-ajax/grid/examples/programming/needdatasource/defaultcs.aspx – Icarus Aug 02 '11 at 12:37

2 Answers2

0

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).

FiveTools
  • 5,970
  • 15
  • 62
  • 84
0

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();
Gaurav Agrawal
  • 4,355
  • 10
  • 42
  • 61