Hi,
I was trying to get the example of simple filtering working that is located at this location http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/filtering/defaultcs.aspx. I was able to get it working without too much trouble. The issue is that when I removed the 'DataSourceID="SqlDataSource1' from the Grid and used code in the Page_Load method to set the Datasource of the grid the filtering did not work. I set the datasource to be a list of ints. I have also tried using the NeedDataSource event of the grid itself to populate the grid, but again the grid will be populated but when I go to filter it doesn't filter. Here is sample of the code I am using to set the datasource of the grid:
I was trying to get the example of simple filtering working that is located at this location http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/filtering/defaultcs.aspx. I was able to get it working without too much trouble. The issue is that when I removed the 'DataSourceID="SqlDataSource1' from the Grid and used code in the Page_Load method to set the Datasource of the grid the filtering did not work. I set the datasource to be a list of ints. I have also tried using the NeedDataSource event of the grid itself to populate the grid, but again the grid will be populated but when I go to filter it doesn't filter. Here is sample of the code I am using to set the datasource of the grid:
SqlCommand sql =
new SqlCommand();
SqlDataAdapter da =
new SqlDataAdapter();
string connectionString = WebConfigurationManager.ConnectionStrings["SBF"].ToString();
SqlConnection con =
new SqlConnection(connectionString);
//ConfigurationManager.ConnectionStrings[connectionString]
con.ConnectionString = connectionString;
sql.CommandText =
@"select A from SSA";
sql.Connection = con;
da.SelectCommand = sql;
DataTable dt =
new DataTable();
List<int> ints = new List<int>();
da.Fill(dt);
for (int i = 0; i < dt.Rows.Count; i++)
{
ints.Add(
Convert.ToInt32(dt.Rows[i]["A"]));
}
RadGrid1.DataSource = ints;
I am using the 2009.3.1208.35 version of the Telerik.Web.UI.
Thanks,
Jonathan Simon