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

PageMethod bound Grid with FilterTemplates

4 Answers 47 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nick
Top achievements
Rank 1
Nick asked on 15 Nov 2010, 02:03 PM
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

4 Answers, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 18 Nov 2010, 02:11 PM
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.
0
Nick
Top achievements
Rank 1
answered on 18 Nov 2010, 02:35 PM
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
0
Nick
Top achievements
Rank 1
answered on 23 Nov 2010, 03:28 PM
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....
0
Tsvetoslav
Telerik team
answered on 26 Nov 2010, 02:46 PM
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.
Tags
Grid
Asked by
Nick
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Nick
Top achievements
Rank 1
Tsvetoslav
Telerik team
Share this question
or