Combobox in gridview

10 posts, 1 answers
  1. MGrassman
    MGrassman avatar
    92 posts
    Member since:
    Apr 2007

    Posted 24 Jan 2009 Link to this post

    Are there any examples on how to use a combo box as a column editor in the gridview.  I would need the example to show how to use the value of the column as the selected value of the combo box that is databound to lookup source other then the gridview.

    Found Solution
    http://www.telerik.com/community/forums/silverlight/combobox/selecteditem-after-setting-itemssource.aspx

    New Question
    How do I use the GridViewComboBoxEditor control.  The current implementation I'm using shows the combobox at all times.  I would like to only show the combobox when the cell is in edit mode.  Sort of like how a datetime value works. 

    Thanks,
  2. Answer
    Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 26 Jan 2009 Link to this post

    Hi MGrassman,

    Please check the attached application.

    Greetings,
    Vlad
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. DevCraft banner
  4. MGrassman
    MGrassman avatar
    92 posts
    Member since:
    Apr 2007

    Posted 26 Jan 2009 Link to this post

    Could you show this with a datasource that has a recid and display value.  Also can you not use the autogenerate columns.  I get the ddl to show my list when I edit it but the display value of the dataitem is a guid and not the string value.

    Thanks,
  5. Marc Roussel
    Marc Roussel avatar
    429 posts
    Member since:
    Dec 2009

    Posted 21 Jan 2010 Link to this post

    Searching for help resulting in obsolete things.
    so how do you set RadComboBox for a column in a Gridview by C# code behind.
  6. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 21 Jan 2010 Link to this post

    Hi,

    You can create your own column, override CreateCellElement/CreateCellEditElement and return desired control similar to this post:
    http://blogs.telerik.com/nedyalkonikolov/posts/09-11-12/how_to_create_custom_editor_with_radgridview_for_silverlight_and_wpf.aspx

    Kind regards,
    Vlad
    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.
  7. Marc Roussel
    Marc Roussel avatar
    429 posts
    Member since:
    Dec 2009

    Posted 21 Jan 2010 Link to this post

    Can you tell me how to stop this behaviour ?
    http://gearworld.dyndns.org:8082/?VIDEO=1&PL=0

    The popup of the combobox is adapting to what it sees in size
    Here's the code of my method :

    GridViewComboBoxColumn NewColumn = new GridViewComboBoxColumn();  
    if (FrenchCaption != "")  
        NewColumn.Header = FrenchCaption;  
    else 
        NewColumn.Header = EnglishCaption;  
     
    NewColumn.IsVisible = IsVisible;  
    NewColumn.IsReadOnly = IsReadOnly;  
     
    if (Width != -1)  
        NewColumn.Width = Width;  
     
    NewColumn.SortingState = SortingState;  
    NewColumn.SelectedValueMemberPath = SelectedValueMemberPath;  
    NewColumn.DisplayMemberPath = DisplayMemberPath;  
    NewColumn.DataMemberBinding = new System.Windows.Data.Binding(SelectedValueMemberPath);  
    NewColumn.ItemsSource = ItemsSource;  
     
    GridView.Columns.Add(NewColumn);  
     
  8. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 26 Jan 2010 Link to this post

    Hello Marc Roussel,

    Can you please paste me a sceenshot ( a picture ) as I could not open the video link provided.
    Alternatively you may use http://www.jingproject.com/ to take the screencapture and uplad a short movie.

    All the best,
    Pavel Pavlov
    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.
  9. Marc Roussel
    Marc Roussel avatar
    429 posts
    Member since:
    Dec 2009

    Posted 26 Jan 2010 Link to this post

    First could you tell me why you can't since everybody in the world can.  This could help me make sure my videos can really be seen by everybody

    Meanwhile.  Here's the direct link to the video : http://gearworld.dyndns.org:8082/ClientBin/Videos/PUBLIC_behaviour.wmv
    If you still can't I presume it's something about security.  Add the address in your exceptions.

    Let me know

    I can't exmplain with a single screenshot.  It needs to be seen as a video.

    A RadComboBox in a RadGridView column, once opened, and scrooling, it's adapting to what it sees and the size of the combobox resizes constantly to fit it's visible content.
  10. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 27 Jan 2010 Link to this post

    Hi,

    According to our admins the site is down - there are no access restrictions.

    You can use however Jing instead.

    Kind regards,
    Vlad
    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.
  11. Marc Roussel
    Marc Roussel avatar
    429 posts
    Member since:
    Dec 2009

    Posted 27 Jan 2010 Link to this post

    No thank you, I will not use Jing. but I understand now why you can't
    the server is my PC at home and it's open between 6:00am and 8:00PM EST only

    Make sure you go see the video between these hours.
    Here's the link again

    http://gearworld.dyndns.org:8082/?VIDEO=1&PL=0

    DOH, I tried to attach but seems your attach system is accepting only images.
    You should consider letting attatching zip at least.

    Ah well,

    Here's another way if nothing works  A downloadable link.
    http://pages.videotron.com/gear/PUBLIC_behaviour.zip

Back to Top
DevCraft banner