As RadGrid Filter

4 posts, 0 answers
  1. Colin Wright
    Colin Wright avatar
    26 posts
    Member since:
    Mar 2008

    Posted 13 Sep 2012 Link to this post

    I am trying to use the RACB as a filter for a RadGrid column, I have almost got it working only once I have selected a token when the Grid filter fires the token disappears from the RACB. The Grid does filter to the selected item of the RACB but after filter there is no way of removing it as it is no longer there. I am using an Entity Data Source to populate the RACB.

    I think I am missing a selected value on the RACB which doesnt exist.

    <telerik:GridBoundColumn DataField="Customer" HeaderText="Customer" ReadOnly="true" >

     

    <FilterTemplate>

     

    <telerik:RadAutoCompleteBox runat="server" ID="RadAutoCompleteBox2" DataSourceID="EntityDataSource3" Filter="Contains" OnClientEntryAdded="entryAdded" AllowCustomToken="true"

     

    DataTextField="Customer" DataValueField="Customer" InputType="Token">

     

    </telerik:RadAutoCompleteBox>

     

    <telerik:RadScriptBlock ID="RadScriptBlock3" runat="server">

    <

     

     

    script type="text/javascript">

     

    function entryAdded(sender, eventArgs) {

     

    var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");

    tableView.filter(

     

    "Customer", eventArgs.get_entry().get_text(), "EqualTo");

    }

    </

     

     

    script>

     

    </telerik:RadScriptBlock>

     

    </FilterTemplate>

     

    </telerik:GridBoundColumn>

  2. Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 19 Sep 2012 Link to this post

    Hello Colin,

    Could you please explain in more details why do you have decided to use the RadAutoCompleteBox as a RadGrid filter? Is there anything specific in your scenario that requires this?

    I am suggesting you use RadComboBox instead of RadAutoCompleteBox to perform filtering in RadGrid.

    Please take a look at the "Grid / Filter Templates" online demo.

    Greetings,
    Kalina
    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Colin Wright
    Colin Wright avatar
    26 posts
    Member since:
    Mar 2008

    Posted 19 Sep 2012 Link to this post

    It was purely for Aesthetic reasons. I see that you can acheive the same functionality with a radcombox.
  5. Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 21 Sep 2012 Link to this post

    Hi Colin,

    The RadGrid control can be filtered only by a single value. That is why the RadComboBox as a single-select control is more appropriate for filtering.
    The RadAutoCompleteBox is a multi-select control and
    I understand that you like the RadAutoCompleteBox TokenMode appearance but in contrast to RadComboBox, the RadAutoCompleteBox is a multi-select control.

    Let me suggest you take a look at the "The best fit for your project - Telerik's ASP.NET AJAX ComboBox or AutoCompleteBox?" blog post.


    All the best,
    Kalina
    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.
Back to Top