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

Odd Behavior with FilterTemplate on RadComboBox

3 Answers 38 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Eric Klein
Top achievements
Rank 1
Eric Klein asked on 01 Dec 2011, 05:26 PM

I have a screen that contains a RadGrid where I set the GroupSetting CaseSensitive = false, and I allow filter b column.  This woks for all my columns except for a column I have set with a filter template that contains a RadComboBox.  When I select from the combo nothing gets returned.  When I run SQL Server Profiler I can see the OnNeedDataSouce query works and returns data.  If I change the grid to populate with the column being set to upper case it works.  If I Remove the CaseSensitive it works.  Why is it having an issue with the filter with a radcombo box?


<GroupingSettings CaseSensitive="false" />
 <ExportSettings>
    <Excel Format="Html" />
 </ExportSettings>
 <AlternatingItemStyle BackColor="#EEEEEE"></AlternatingItemStyle>
 <MasterTableView DataKeyNames="AdvisorBlotterID" PagerStyle-Mode="NextPrevNumericAndAdvanced">
     <Columns>
           <telerik:GridBoundColumn SortExpression="ClientName" DataField="ClientName" HeaderText="Client Name" >
                 <FilterTemplate>
                         <telerik:RadComboBox ID="RadComboBoxClientName" DataTextField="ClientName" DataValueField="ClientName" AppendDataBoundItems="true" Width="150px" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("ClientName").CurrentFilterValue %>' runat="server" OnClientSelectedIndexChanged="ClientNameIndexChanged" Skin="Office2007">
                          </telerik:RadComboBox>
                        <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
                               <script type="text/javascript">
                                    function ClientNameIndexChanged(sender, args) {
                                        var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                        if (args.get_item().get_value() == "0") {
                                                tableView.filter("ClientName", args.get_item().get_value(), "NoFilter");
                                         }
                                        else {
                                                tableView.filter("ClientName", args.get_item().get_value(), "EqualTo");
                                          }
                                 }
                              </script>
                           </telerik:RadScriptBlock>
                     </FilterTemplate>
                <ItemStyle VerticalAlign="Top" />
           </telerik:GridBoundColumn>

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 02 Dec 2011, 04:30 AM
Hello Eric,

Check the following demo which implements the same.
Grid / Filter Templates

-Shinu.
0
Eric Klein
Top achievements
Rank 1
answered on 02 Dec 2011, 02:29 PM
Yes I can see that but it does not take into account the GroupSetting CaseSenstivie = "false". I can ge the drop down to work but I also have plain text box filters that I would like to not be case sensitive. 
0
Vasil
Telerik team
answered on 07 Dec 2011, 09:03 AM
Hello Eric,

In a local copy of the demos I set: <GroupingSettings CaseSensitive="false" /> for the grid and then set AllowFiltering="true"  for the ContactName column.
Now the filtering is working fine for all ComboBoxes and for the ContactName column. See the attached screenshot.

Regards,
Vasil
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Grid
Asked by
Eric Klein
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Eric Klein
Top achievements
Rank 1
Vasil
Telerik team
Share this question
or