Multi-selection radcombobox filtering

8 posts, 0 answers
  1. Ratzai
    Ratzai avatar
    14 posts
    Member since:
    Oct 2007

    Posted 01 Feb 2013 Link to this post

    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. 
  2. Eyup
    Admin
    Eyup avatar
    3006 posts

    Posted 06 Feb 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ratzai
    Ratzai avatar
    14 posts
    Member since:
    Oct 2007

    Posted 07 Feb 2013 Link to this post

    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"))
  5. Eyup
    Admin
    Eyup avatar
    3006 posts

    Posted 12 Feb 2013 Link to this post

    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.
  6. Ratzai
    Ratzai avatar
    14 posts
    Member since:
    Oct 2007

    Posted 12 Feb 2013 Link to this post

    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.

  7. Eyup
    Admin
    Eyup avatar
    3006 posts

    Posted 15 Feb 2013 Link to this post

    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.
  8. Ratzai
    Ratzai avatar
    14 posts
    Member since:
    Oct 2007

    Posted 15 Feb 2013 Link to this post

    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
  9. Eyup
    Admin
    Eyup avatar
    3006 posts

    Posted 20 Feb 2013 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017