PageMethod bound Grid with FilterTemplates

5 posts, 0 answers
  1. Nick
    Nick avatar
    86 posts
    Member since:
    Mar 2008

    Posted 15 Nov 2010 Link to this post

    I have a grid that is using declarative client side binding to a aspx pagemethod to get data which works fine.

    <telerik:RadGrid ID="rgDiscoveries"
                     runat="server"
                     AllowFilteringByColumn="True"
                     AllowSorting="true"
                     AllowPaging="True"
                     GridLines="None"
                     AutoGenerateColumns="true" Culture="en-GB">
      <ClientSettings>
        <DataBinding Location="Default.aspx" SelectMethod="GetDataAndCount" />
      </ClientSettings>
    ...

    I have added a FilterTemplate to one column which has a ComboBox in which pulls a listing from a second page method.
    <telerik:GridBoundColumn DataField="ScriptName"
                             HeaderText="Script Name"
                             UniqueName="scriptName"
                             DataType="System.String">
      <FilterTemplate>
        <telerik:RadComboBox ID="filterScriptName"
                             runat="server"
                             EmptyMessage="Select a script"
                             EnableLoadOnDemand="true"
                             ShowMoreResultsBox="true"
                             EnableVirtualScrolling="true"
                             OnClientSelectedIndexChanged="filterScriptName_SelectedIndexChanged">
          <WebServiceSettings method="GetScriptNames" Path="Default.aspx" />
        </telerik:RadComboBox>
      </FilterTemplate>
    </telerik:GridBoundColumn>

    The combobox is populated but I don't know how to trigger the grid to repopulate when the combobox SelectedIndexChanged event fires.
    function filterScriptName_SelectedIndexChanged(sender,args) {
      var tableView = $find("<%= rgDiscoveries.MasterTableView.ClientID %>");
      tableView.filter("ScriptName", args.get_item().get_value(), "EqualTo");
      // What goes here??
    }

    Is there an example of this somewhere please?

    Cheers,
    Nick
  2. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 18 Nov 2010 Link to this post

    Hi Nick,

    Could you pelase try calling the dataBind() client method for the grid and see if it helps?

    Kind regards,
    Iana
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Nick
    Nick avatar
    86 posts
    Member since:
    Mar 2008

    Posted 18 Nov 2010 Link to this post

    Hi Iana,

    I'm afraid I got impatient and opened a support ticket (367214)

    If you have any ideas on that they would be most gratefully received.

    Cheers,
    Nick
  5. Nick
    Nick avatar
    86 posts
    Member since:
    Mar 2008

    Posted 23 Nov 2010 Link to this post

    Ok, turns out that the reason this didn't work is that the parameters passed into the filter function are case-sensitive  :(

    tableView.filter("ScriptName", args.get_item().get_value(), "EqualTo");

    needs to be

    tableView.filter("scriptName", args.get_item().get_value(), "EqualTo");

    I hate case sensitive languages....
  6. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts

    Posted 26 Nov 2010 Link to this post

    Nick,

    Programming language case-sensitivity has nothing to do with RadGrid's column names keeping a case-sensitive naming convention. This is by design and we cannot change it as it may lead to breaking changes in other customers' applications who prefer having case-sensitive column names and have incorporated some application logic based on that.

    Regards,
    Tsvetoslav
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017