Hi! I have a problem with the RadGrid, I am show a lot data en grid using paging, but if I select another page the radgrid show-off
i hope your help.
This is my code:
RadGrid1.DataSource = data.Query("NoTarjeta", selectsNoTarjeta, "NoTarjeta", toSearch, "%");
RadGrid1.DataBind();
The method Query is:
public DataSet Query(String type, String selects, String paramWhere, String compare, String comodin)
{
List<string> byTable = new List<string>();
String Query = null;
byTable=searchTables(type);
foreach (string table in byTable) // Loop through List with foreach
{
Query = "SELECT " + selects + " FROM " + table + " WHERE " + paramWhere + " LIKE '" + compare + comodin + "' UNION ALL " + Query;
}
Query = Query.Substring(0, Query.Length - 10);
ConnectToDatabase("localhost", 3306, "data", "root", "xxx");
MySqlDataAdapter adapter = new MySqlDataAdapter(Query, Userconection);
adapter.Fill(Results);
Userconection.Close();
return Results;
}
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" height="200px"
width="994px">
<asp:TextBox ID="txSearch" runat="server" Width="343px"></asp:TextBox>
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
<br />
<telerik:RadGrid ID="rgResults" runat="server" AllowPaging="True"
AllowSorting="True" Skin="Telerik">
</telerik:RadGrid>
</telerik:RadAjaxPanel>