FilterTemplate - RadComboBox Default Value

3 posts, 1 answers
  1. Marc
    Marc avatar
    4 posts
    Member since:
    Aug 2014

    Posted 18 Nov 2014 Link to this post


    I tried to set a default-Filter-Value in my FilterTemplate.
    But my Default-Item doesn´t work as well... The filtering still shows "ALL" items

    I need to set the default filter-value as "bearbeitung" (translation: in process)

    With "<DefaultItem Text="Bearbeitung" Value="Bearbeitung"/>" it shows the correct value at the combobox.
    But still shows all items.

    If i choose the value "Bearbeitung" manually from the RadComboBox, the filtering works fine.

    <telerik:GridBoundColumn AllowFiltering="true" FilterControlWidth="100px" DataField="TicketStatusBezeichnung" HeaderText="Ticket Status" ShowFilterIcon="true"  AutoPostBackOnFilter="true"><br>                    <FilterTemplate>
    telerik:RadComboBox  ID="RadComboBoxTicketStatus" DataSourceID="SqlDataSource2" DataTextField="TicketStatusBezeichnung"<br>                            DataValueField="TicketStatusBezeichnung" Height="200px" AppendDataBoundItems="true"  SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("TicketStatusBezeichnung").CurrentFilterValue %>'<br>                            runat="server" OnClientSelectedIndexChanged="TitleIndexChanged" Sort="Descending"><br>                            <DefaultItem Text="Bearbeitung" Value="Bearbeitung"/><br>                            <Items><br>                                <telerik:RadComboBoxItem Text="Alle" /><br>                            </Items><br>                        </telerik:RadComboBox><br>                        <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server"><br>                            <script type="text/javascript"><br>                                function TitleIndexChanged(sender, args) {<br>                                    var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");<br>                                    tableView.filter("TicketStatusBezeichnung", args.get_item().get_value(), "EqualTo");<br>                                }<br>                            </script><br>                        </telerik:RadScriptBlock><br>                    </FilterTemplate><br>               

    Thanks in advance :)

    Marc B
  2. Answer
    Viktor Tachev
    Viktor Tachev avatar
    1440 posts

    Posted 21 Nov 2014 Link to this post

    Hi Marc,

    In order to set a filter that will be applied initially to RadGrid you can use the following approach:

    • Handle the PreRender event of RadGrid
    • Use the handler to set the FilterExpression property
    • Rebind RadGrid

    The approach is also illustrated in the article linked below.

    Viktor Tachev

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

  3. DevCraft R3 2016 release webinar banner
  4. Marc
    Marc avatar
    4 posts
    Member since:
    Aug 2014

    Posted 25 Nov 2014 in reply to Viktor Tachev Link to this post

    Thank you very much :)

    It works fine ;)
Back to Top