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

Multi-selection radcombobox filtering

7 Answers 83 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ratzai
Top achievements
Rank 1
Ratzai asked on 01 Feb 2013, 12:49 PM
Hi

I've tried to use this example Multi-selection radcombobox in a project, but I have run in to a  problem because my case differs a bit from the example code.

My gridview is bound to a custom collection of Chemical objects. The Chemical object have a sub-property ChemicalLabels collection of which each item is bound to a gridcolumn as a commaseparated string.

How can I set the filterexpression in the gridview, so that it only shows object with chemicallabels selected in the radcombobox?

The filterexpression used in the example is: (it[\"ShipCountry\"].ToString().Contains(\"" + item.Text + "\")) but this does not work with my custom collection. 

7 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 06 Feb 2013, 11:16 AM
Hello Ratzai,

Can you please confirm that the filtering works as expected without implementing this approach?

Please check out the attached application which should work with all kind of datasources.

All the best,
Eyup
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
Ratzai
Top achievements
Rank 1
answered on 07 Feb 2013, 12:09 PM
Hi Eyup

I tried to use the attached sample you posted, but unfortunately I still have a problem. 
In the RadGrid PreRender method, this error pops up when the rebind method is called
"Neither of the types 'String' and 'List`1' converts to the other

I think it's because the ChemicalLabels field is not bound to a string, but to a List like this:     
<telerik:GridTemplateColumn DataField="ChemicalLabels"
             FilterControlAltText="Filter ChemicalLabels column" HeaderText="Effekter"
              SortExpression="ChemicalLabels" UniqueName="ChemicalLabels" HeaderStyle-Width="145px">
          <ItemTemplate>
              <asp:Label ID="LblChemicalLabel" runat="server" Text=""></asp:Label>
          </ItemTemplate>
</telerik:GridTemplateColumn>


The filterexpression generated looks like this

(iif(ChemicalLabels == null, ", ChemicalLabels).ToString().Contains("Parfume"))
0
Eyup
Telerik team
answered on 12 Feb 2013, 07:57 AM
Hello Ratzai,

In that case we will need an actual sample demonstrating your specific scenario. Please prepare a very basic runnable web site and open a support ticket to send it to us. Thus, we will be able to further analyze the application and provide you with a reply whether the requested functionality is achievable in your case or not.

Regards,
Eyup
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
Ratzai
Top achievements
Rank 1
answered on 12 Feb 2013, 09:50 AM
Hi Eyup,

We haven't purchased a license yet, so unfortunately I am not able to submit the small sample project with the error as a formal support ticket. I have uploaded the sample project here and hope that you might be able to see what causes the error.

0
Eyup
Telerik team
answered on 15 Feb 2013, 08:58 AM
Hello Ratzai,

The attached file in provided link seems to be broken. When I try to download it, nothing happens and the request is canceled.

All the best,
Eyup
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
Ratzai
Top achievements
Rank 1
answered on 15 Feb 2013, 03:07 PM
That's weird, I just tested it and it downloads fine. Anyway heres a new link that might work out better.
https://dl.dropbox.com/u/1890081/RGFilterTest.zip
0
Eyup
Telerik team
answered on 20 Feb 2013, 09:43 AM
Hi Ratzai,

I have modified the provided project to implement the requested functionality. Please check out the attached application and let me know about the result.

Greetings,
Eyup
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
Ratzai
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Ratzai
Top achievements
Rank 1
Share this question
or