custom combobox for editing gridview

15 posts, 0 answers
  1. steve
    steve avatar
    83 posts
    Member since:
    Oct 2009

    Posted 06 Jan 2010 Link to this post

    I created a custom combobox that I want to use in the grid view during editing.  When the user is editing the data I want to allow then to beable to choose from a list of items, enter in new items (like a text box and save when done typing or lost focus) and also allow the user to click on an x next to an item and remove it from the list items.  Is this possible?  So, is it possible to customize the list itmes to have a image (x) and use a click event on the fire a method to delte the item?


    Stephen
  2. Nikolay
    Admin
    Nikolay avatar
    1805 posts

    Posted 11 Jan 2010 Link to this post

    Hello steve,

    I am attaching a sample project which demonstrates how you can dynamically add an item to your RadComboBoxEditor. As to the image, you can insert a button next to the RadComboBoxEditor as shown in this knowledge base article. You need to delete the currently selected item of the opened editor in the Click event of the button.

    If you have any additional questions, feel free to contact me.

    Greetings,
    Nikolay
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. steve
    steve avatar
    83 posts
    Member since:
    Oct 2009

    Posted 12 Jan 2010 Link to this post

    Hey Nikolay,
    That works great for my project except I think the users may find it a little confusing and a hostile if they want to delete more then one from the list.  Is it possible to add the item to the comboBox so that you can remove each item, instead of selecting an item then deleting it?  For example, if you go to google (I know this is a web app control) and type in "hello world" it is added to a list the drop down control binds to.  So that when you go back into the list the item is there.  The control also give you the option to delete that item from the list by including a image button for that item.  Is there a way to add a button to a comboBox RadItem?

    Thanks Stephen.
  4. Nikolay
    Admin
    Nikolay avatar
    1805 posts

    Posted 13 Jan 2010 Link to this post

    Hi steve,

    I modified a bit my sample project and now it supports the desired functionality - each RadComboBoxItem has a Remove button. Similar functionality is demonstrated in this knowledge base article.

    I hope this helps. If you have additional questions, feel free to contact me.

    Greetings,
    Nikolay
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. steve
    steve avatar
    83 posts
    Member since:
    Oct 2009

    Posted 13 Jan 2010 Link to this post

    That is perfect.  Thank you.
  6. paul
    paul avatar
    1 posts
    Member since:
    Jul 2010

    Posted 23 Jul 2010 Link to this post

    Hi
    Thanx this is exactly what I needed.
    But if a user add a new Item and then leave the cell without pressing the enter
    It wont add the new item in the combo cell of the gridview can you solve this please? 
  7. Nikolay
    Admin
    Nikolay avatar
    1805 posts

    Posted 29 Jul 2010 Link to this post

    Hi paul,

    The desired behavior cannot be achieved in the current version of RadGridView. We will try to address this case in Q2 2010 SP1.

    If you have additional questions, feel free to contact me.

    Regards,
    Nikolay
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  8. Jill-Connie Lorentsen
    Jill-Connie Lorentsen avatar
    118 posts
    Member since:
    Nov 2008

    Posted 12 Oct 2011 Link to this post

    I am also looking for a way to get this feature, and I hope there is a way.

    I want the user to be able to enter a value and press TAB to go to the next cell in the row, but it is not possible. 

    Any workaround?
  9. Nikolay
    Admin
    Nikolay avatar
    1805 posts

    Posted 13 Oct 2011 Link to this post

    Hi Jill-Connie Lorentsen,

    Our latest version Q2 2011 SP1 allows for creating a drop-down list editor that accepts custom values even when the TAB key is pressed. For additional information about the necessary approach, please refer to this documentation article.

    Kind regards,
    Nikolay
    the Telerik team

    Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

  10. Jill-Connie Lorentsen
    Jill-Connie Lorentsen avatar
    118 posts
    Member since:
    Nov 2008

    Posted 14 Oct 2011 Link to this post

    Thanks for your reply, but I don't get the behavior I want.

    I've done what you show in the documentation article, but I can't get the text to "stick" in the cell after leaving it. The typed value is added to the data source, and appears in the combo box the next time the combobox column is visited, but after it is typed and the TAB og Enter key is pressed the text disappears.

    Do you have a sample project that I can download and run?

    Thanks!

    Regards, Jill-Connie Lorentsen
  11. Nikolay
    Admin
    Nikolay avatar
    1805 posts

    Posted 19 Oct 2011 Link to this post

    Hello Jill-Connie Lorentsen,

    Thank you for writing back.

    Please find attached a sample project based on the documentation article. I am also attaching a movie of the steps that I perform in the customized editor. You can watch the movie in a web browser with Flash plug-in installed. As you can see in the video, after pressing TAB the value is correctly saved in the cell. If you continue experiencing issue, please open a new support ticket and send me your sample project where it occurs. This will allow me to assist you further.

    If you feel that the sample project differs from what is written in the documentation, please contact us accordingly. This will allow us to fill the missing gaps in the article.

    All the best,
    Nikolay
    the Telerik team

    Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

  12. Jill-Connie Lorentsen
    Jill-Connie Lorentsen avatar
    118 posts
    Member since:
    Nov 2008

    Posted 21 Oct 2011 Link to this post

    Thank you, it now works perfectly :)
  13. Nikolay
    Admin
    Nikolay avatar
    1805 posts

    Posted 21 Oct 2011 Link to this post

    Hi Jill-Connie Lorentsen,

    I am glad to hear that I was of help. If you have additional questions, feel free to write back.

    All the best,
    Nikolay
    the Telerik team

    Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

  14. Jill-Connie Lorentsen
    Jill-Connie Lorentsen avatar
    118 posts
    Member since:
    Nov 2008

    Posted 01 Nov 2011 Link to this post

    One more thing...

    When the user starts typing in the text field of the combo box, - is it possible that the text of existing items appears as suggestions, as it is in i.e Excel?

    I hope you understand what I mean.
  15. Nikolay
    Admin
    Nikolay avatar
    1805 posts

    Posted 03 Nov 2011 Link to this post

    Hello Jill-Connie Lorentsen,

    If I understand your requirement, you are after the AutoComplete functionality of our DropDownList. If this is the case, you can employ this feature in RadGridView by setting the AutoCompleteMode property of the GridViewComboBoxColumn, for example:

    categoriesColumn.AutoCompleteMode = AutoCompleteMode.Suggest;

    I hope this helps.

    All the best,
    Nikolay
    the Telerik team

    Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

Back to Top