Hi again :)
I have a radgrid that I want to filter exactly like they do in this example:
http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridcomboajax/defaultcs.aspx?product=grid
the problem though is that I am not using a sqldatasource because the items in the grid need to be editable, so I am getting the source from the code behind.
Here is how the grid is getting it's data source:
How can I achieve this?
I have a radgrid that I want to filter exactly like they do in this example:
http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridcomboajax/defaultcs.aspx?product=grid
the problem though is that I am not using a sqldatasource because the items in the grid need to be editable, so I am getting the source from the code behind.
Here is how the grid is getting it's data source:
protected
void
Page_Load(
object
sender, EventArgs e)
{
if
(!IsPostBack)
{
loadGrid();
}
}
protected
void
loadGrid()
{
DATABASE dbcontext =
new
DATABASE();
IEnumerable<LineItem> newlineitem = from p
in
dbcontext.LineItems
select p;
gridDataSource = newlineitem;
RadGrid1.Rebind();
}
public
IEnumerable<LineItem> gridDataSource
{
set
{
Session[
"gridDataSource"
] = value;
}
get
{
if
(Session[
"gridDataSource"
] ==
null
)
return
null
;
else
{
return
((IEnumerable<LineItem>)Session[
"gridDataSource"
]);
}
}
}
protected
void
RadGrid1_NeedDataSource(
object
sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
RadGrid1.DataSource = gridDataSource;
}
How can I achieve this?