1. After Sorting, i click to a page site (Paging). After that, no data appears, why ?
2. I will an sorting only with Ascending and Descending. when i click the sort column, the column should asc or desc and NOT NONE. how can i set the sorting mode only for Asc or Desc. I wan't an 3. State !
http://www.sport-events.ch/sportarten.aspx
public
partial class sportarten : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
if (Master.FindControl("sportarten") != null)
{
((
HtmlAnchor)Master.FindControl("sportarten")).Attributes["class"] = "selected";
}
fillGrid();
}
}
private void fillGrid()
{
SqlDataAdapter da = null;
DataSet ds = new DataSet();
string query = "";
query =
"SELECT * FROM Sports";
try
{
da =
new SqlDataAdapter(query, ConfigurationManager.ConnectionStrings["ConnectionStringName"].ConnectionString);
DataTable dataTable = new DataTable();
da.Fill(dataTable);
dgSport.DataSource = dataTable;
}
catch (Exception ex)
{
}
finally
{
}
}
protected void dgSport_PageIndexChanged(object source, Telerik.Web.UI.GridPageChangedEventArgs e)
{
fillGrid();
}
protected void dgSport_SortCommand(object source, Telerik.Web.UI.GridSortCommandEventArgs e)
{
fillGrid();
}
protected void dgSport_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
{
fillGrid();
}
}