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

RadGrid filterExpression empty uniquename

1 Answer 131 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 08 Nov 2011, 08:48 PM
I'm trying to do something similar to what is demonstrated here and am really stuck on a problem I am currently having and hoping someone can help.  Basically, in the ObjectDataSource1_Selecting method I am checking the FilterExpression (with linq expressions set to false) and the expression is missing the UniqueName of the column that I am passing to the javascript filter() function.  It looks like: "([] = 'Critical')". when I select "Critical" from the radcombo.

I've looked over it a bunch and am having trouble finding something configured wrong, here is the relevant code:

<telerik:GridTemplateColumn  DataType="System.String"
                    FilterControlAltText="Filter Urgency column" HeaderText="Urgency"  AllowFiltering="true"
                    SortExpression="Urgency" UniqueName="Urgency" Visible="true">
                    <FilterTemplate>
                            <telerik:RadComboBox ID="comboUrgencyFilter" DataSourceID="UrgencyTypeDataSource" DataTextField="Name"
                                DataValueField="Name" AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("Urgency").CurrentFilterValue %>'
                                runat="server" OnClientSelectedIndexChanged="UrgencyIndexChanged" Width="90px">
                                <Items>
                                    <telerik:RadComboBoxItem Text="All" />
                                </Items>
                            </telerik:RadComboBox>
                            <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
 
                                <script type="text/javascript">
                                    function UrgencyIndexChanged(sender, args) {
                                        var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                        tableView.filter("Urgency", args.get_item().get_value(), 5);
                                    }
                                </script>
 
                            </telerik:RadScriptBlock>
                        </FilterTemplate>
                    <ItemTemplate>
                            <%# Eval( "UrgencyType.Name") %>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>

Thanks for any help

1 Answer, 1 is accepted

Sort by
0
Brian
Top achievements
Rank 1
answered on 08 Nov 2011, 09:48 PM
Answering my own question... was missing the DataField property because it wasn't databound, just used and eval().  Putting one in fixed it right up.
Tags
Grid
Asked by
Brian
Top achievements
Rank 1
Answers by
Brian
Top achievements
Rank 1
Share this question
or