ComboBoxEditorSettings and Cell Edit Mode

4 posts, 0 answers
  1. Ludovic Gerbault
    Ludovic Gerbault avatar
    226 posts
    Member since:
    Apr 2009

    Posted 03 Sep 2009 Link to this post

    Hello

    I created a GridViewDataColumn set with a ComboBoxEditorSetting.

    What I'd like to do is when my grid gets the focus, I want the first cell of the first row (wich is my ComboBox) to enter in edit mode and I want to set the IsDropDownOpen property to true.

    I've managed the first part, but I'm getting stucked with the second one (I can't get the RadComboBox in the GridViewCell)

    Here's what I've wrote from a piece of code in this forum

    1         private void FormGrille_GotFocus(object sender, RoutedEventArgs e) 
    2         { 
    3             FormGrille.GotFocus -=new RoutedEventHandler(FormGrille_GotFocus);             
    4             DataRecord record = (DataRecord)this.FormGrille.Records[0]; 
    5             var element = (GridViewRow)this.FormGrille.ItemsControl.ItemsGenerator.GenerateItemAtIndex(record.DataSourceIndex); 
    6             ((GridViewCell)element.Items[0]).IsInEditMode = true
    7         } 
  2. Ludovic Gerbault
    Ludovic Gerbault avatar
    226 posts
    Member since:
    Apr 2009

    Posted 04 Sep 2009 Link to this post

    Any ideas, anyone ?
  3. DevCraft banner
  4. Ludovic Gerbault
    Ludovic Gerbault avatar
    226 posts
    Member since:
    Apr 2009

    Posted 07 Sep 2009 Link to this post

    Please, I'm still stucked on this one.
  5. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 07 Sep 2009 Link to this post

    Hi Subileau Pascal,

    This is quite a specific scenario and is unfortunately not supported by the internal logic of the ComboBoxColumn and the ComboBoxEditorSettings.

    Indeed there is no way to get the ComboBox editor  as it loads on demand after the cell has entered edit mode. To serve such scenario , we have scheduled to add an EditorLoaded event to the RadGridView for our very next official version.

    Meanwhile there is a kind of solution:

    Since GridViewComboBoxColumn does not help much here , you may use  a templated GridViewColumn.

    You may place a ComboBox within the cell template and manually bind it to data and respond to selection changes, update datasource etc.

    Regards,
    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.
Back to Top