Hey people...
I have an issue with a user control I have created which is meant to provide search results through the use of a radgrid.
I have pasted the code below. As you will see, I have a button which causes a post back and a radgrid (bound to an objectdatasource) to show the results. The grid is configured to enable sorting and paging. There are other controls on the user control(e.g. comboxboxes and textboxes) which are the fields used to provide search criteria.
The problem I am having is that the page and grid loads fine with initial search results- all events are fired and the expected result is shown, then if I do a search/sort/page change it still works fine but the second and all subsequent postbacks (search/sort/page change) raise all the events but the results aren't being shown in the browser. I also don't see any exceptions being raised- the databinding seems to run correctly. All the parameters passed to the search method are correct.
If I remove the radajaxpanel around it all, it works fine (but with all the full page refreshes). I have tried to use RadAjaxManager/proxy and still get the exact same result. Also tried manual binding and still no luck.
<telerik:RadAjaxPanel ID="ajaxpnlSearch" runat="server"> |
<div class="form-row"> |
<div class="float-left" style="width: 100%;"> |
<asp:Button Text="Search" class="search" runat="server" ID="btnSearch" OnClick="btnSearch_Click" /> |
</div> |
<div class="clear no-text"> |
</div> |
</div> |
<div class="clear no-text"> |
</div> |
<telerik:RadGrid ID="grdSearchResults" runat="server" Width="100%" AllowPaging="True" |
AllowSorting="True" DataSourceID="odsOpportunities" GridLines="None"> |
<MasterTableView AutoGenerateColumns="False" DataSourceID="odsOpportunities" DataKeyNames="OppId" |
EnableViewState="true"> |
<Columns> |
<telerik:GridBoundColumn DataField="OppId" HeaderText="OppId" SortExpression="OppId" |
UniqueName="OppId" DataType="System.Int64"> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="BusinessName" HeaderText="BusinessName" ReadOnly="True" |
SortExpression="BusinessName" UniqueName="BusinessName"> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="ContactName" HeaderText="ContactName" SortExpression="ContactName" |
UniqueName="ContactName" ReadOnly="True"> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="OppExpireDate" DataType="System.DateTime" HeaderText="OppExpireDate" |
SortExpression="OppExpireDate" UniqueName="OppExpireDate"> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="CreatedDate" DataType="System.DateTime" HeaderText="CreatedDate" |
SortExpression="CreatedDate" UniqueName="CreatedDate"> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="CreatedBy" DataType="System.Int32" HeaderText="CreatedBy" |
SortExpression="CreatedBy" UniqueName="CreatedBy"> |
</telerik:GridBoundColumn> |
</Columns> |
</MasterTableView> |
<ClientSettings> |
<Selecting AllowRowSelect="True" /> |
</ClientSettings> |
</telerik:RadGrid> |
<asp:ObjectDataSource ID="odsOpportunities" runat="server" OldValuesParameterFormatString="original_{0}" |
SelectMethod="Search" TypeName="Hub.BLL.Opportunity.Opportunity"> |
<SelectParameters> |
<asp:ControlParameter ControlID="txtOppId" Name="inOppId" PropertyName="Text" Type="Int32" /> |
<asp:ControlParameter ControlID="cmbPartner" Name="inPartnerId" PropertyName="SelectedValue" |
Type="Int32" /> |
<asp:ControlParameter ControlID="cmbOppStatus" Name="inStatus" PropertyName="SelectedValue" |
Type="Int32" /> |
<asp:ControlParameter ControlID="cmbOppType" Name="inOppType" PropertyName="SelectedValue" |
Type="Int32" /> |
<asp:ControlParameter ControlID="dpWOOStartDate" Name="inStartDate" PropertyName="SelectedDate" |
Type="DateTime" /> |
<asp:ControlParameter ControlID="dpWOOEndDate" Name="inEndDate" PropertyName="SelectedDate" |
Type="DateTime" /> |
<asp:ControlParameter ControlID="cmbChannel" Name="inChannel" PropertyName="SelectedValue" |
Type="Int32" /> |
<asp:ControlParameter ControlID="cmbCampaign" Name="inCampaign" PropertyName="SelectedValue" |
Type="Int32" /> |
<asp:ControlParameter ControlID="cbNew" Name="inNew" PropertyName="Checked" Type="Boolean" /> |
</SelectParameters> |
</asp:ObjectDataSource> |
<br /> |
</telerik:RadAjaxPanel> |
protected void Page_Load(object sender, EventArgs e) |
{ |
} |
protected void btnSearch_Click(object sender, EventArgs e) |
{ |
grdSearchResults.DataBind(); |
} |
Any help would be appreciated!!!
Regards,
Andrew