I have this two diferent classes to use in my ObjectDataSource:
"getColection" and "getLastColectionByUser"
This is my ObjectDataSource at aspx.
`
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="getColection"TypeName="HepatiteNegocio.ViewProtocoloCol" SelectCountMethod="getColectionCount"
EnablePaging="True">
<SelectParameters>
<asp:Parameter Name="pWhere" Type="String" />
<asp:Parameter Name="pOrderBY" Type="String" />
<asp:Parameter Name="startRowIndex" Type="Int32" />
<asp:Parameter Name="maximumRows" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>`
If radio button selected value is "all" select method is "getColection" else is "getLastColectionByUser", all right?
`if(radioButton.SelectedValue.Equals("all"))
{
ObjectDataSource1.SelectMethod = "getColection";
ObjectDataSource1.SelectCountMethod = "getColectionCount";
try
{
validation();
ObjectDataSource1.SelectParameters[0].DefaultValue = getWhere();
ObjectDataSource1.SelectParameters[1].DefaultValue = "protocolNumber";
}
catch
{
set an error message
}
}
else
{
ObjectDataSource1.SelectMethod = "getLastColectionByUser";
ObjectDataSource1.SelectCountMethod = "getLastCountColectionByUser";
try
{
validation();
ObjectDataSource1.SelectParameters[0].DefaultValue = getWhere();
ObjectDataSource1.SelectParameters[1].DefaultValue = "protocolNumber";
}
catch
{
set an erron message
}
}
ObjectDataSource1.DataBind();
GridView1.DataBind();`
When I debug it works fine. The SelectMethod and SelectCountMethod are changing BUT the gridView is still showing old values. The Classes are ok. What is going wrong?