This is a migrated thread and some comments may be shown as answers.

WebService in Grid FilterTemplate

0 Answers 74 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kristijan
Top achievements
Rank 1
Kristijan asked on 07 Nov 2011, 10:58 AM

Dear Experts,

I am using RadGrid to show my application data. In order to filter the related values I am using FilterTemplate with RadComboBox as it is nicely describe in this example. I Have up to 5 columns using this kind of tiltering.

Due to performance reasons I would like to change the server side loading of the filtering RadComboBoxes with the use of Web Services. 

<telerik:GridBoundColumn DataField="OwnerId" UniqueName="OwnerId" DataType="System.Int32" />
<telerik:GridBoundColumn DataField="OwnerName" SortExpression="OwnerName" DataType="System.String"
    UniqueName="OwnerName" AutoPostBackOnFilter="true" FilterDelay="800" ShowFilterIcon="false">
    <FilterTemplate>
        <telerik:RadComboBox ID="RadComboBoxOwners" EnableAutomaticLoadOnDemand="True" Filter="StartsWith"
            AllowCustomText="true" AppendDataBoundItems="true" runat="server" OnClientSelectedIndexChanged="OwnerChanged"
            ViewStateMode="Enabled">
            <Items>
                <telerik:RadComboBoxItem Text="All" Value="" Selected="true" />
            </Items>
            <WebServiceSettings Path="~/DesktopModules/VipCrm/Wsi.asmx" Method="GetUsersFilter" />
        </telerik:RadComboBox>
        <telerik:RadScriptBlock ID="RadScriptBlockOwners" runat="server">
            <script type="text/javascript">
                function OwnerChanged(sender, args) {
                    $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>").filter("OwnerId", args.get_item().get_value(), "EqualTo");
                }
            </script>
        </telerik:RadScriptBlock>
    </FilterTemplate>
</telerik:GridBoundColumn>


When trying to implement this I encountered the following problems:

  1. If the <Items> are present no WSI request triggers.
  2. The RadComboBox loses its selected value though view state is enabled.


Has anyone tried this approach? Do you have suggestion to solve the above problems?

Regards,

Kristijan

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Kristijan
Top achievements
Rank 1
Share this question
or