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

As RadGrid Filter

3 Answers 98 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
Colin Wright
Top achievements
Rank 2
Colin Wright asked on 13 Sep 2012, 03:38 PM
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>

3 Answers, 1 is accepted

Sort by
0
Kalina
Telerik team
answered on 19 Sep 2012, 01:32 PM
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.
0
Colin Wright
Top achievements
Rank 2
answered on 19 Sep 2012, 01:44 PM
It was purely for Aesthetic reasons. I see that you can acheive the same functionality with a radcombox.
0
Kalina
Telerik team
answered on 21 Sep 2012, 02:01 PM
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.
Tags
AutoCompleteBox
Asked by
Colin Wright
Top achievements
Rank 2
Answers by
Kalina
Telerik team
Colin Wright
Top achievements
Rank 2
Share this question
or