Hi, I have a problem with sorting and pagination in a radgrid.It is connected to a DataSource (dsMAV). If i set the SelectCommand in declarative mode then paging and sorting work.
If I declare the SelectCommand as empty string and then modify it at runtime when the page loads:
the first load works fine but pagination and sorting don't work, returning an empty result set.
If i take the assignment out of the if then it works. But I do not understand why in the first case doesn't work because the viewstate is enabled as default.
I need to understand this because the next step is to build a filter using a form and not the radgrid filter and I must change at runtime the SelectCommand.
Thanks a lot
If I declare the SelectCommand as empty string and then modify it at runtime when the page loads:
protected
void
Page_Load(
object
sender, EventArgs e)
{
if
(!IsPostBack)
{
dsMAV.SelectCommand =
"SELECT IDRendicontazione, [Matricola], [CodiceFiscale], [Nominativo], [Importo], [F_Scrigno], [DataIncasso], [DataContabile], Disposizione, Transazione, [Causale], [NProvvisorio], [MavKey] FROM [Rendicontazioni]"
;
}
}
the first load works fine but pagination and sorting don't work, returning an empty result set.
If i take the assignment out of the if then it works. But I do not understand why in the first case doesn't work because the viewstate is enabled as default.
I need to understand this because the next step is to build a filter using a form and not the radgrid filter and I must change at runtime the SelectCommand.
Thanks a lot