We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridComboBoxColumn takes 2 clicks to open the dropdown

Thread ID:

Created:

Updated:

Platform:

Replies:

118922 Apr 23,2015 03:34 PM UTC Apr 28,2015 03:34 AM UTC WinRT 3
loading
Tags: SfDataGrid
Vasanth
Asked On April 23, 2015 03:34 PM UTC

Hi,
GridComboBoxColumn  in SfDataGrid takes 2 clicks to open the dropdown. I have EditTrigger="OnTap" set for grid and AllowFocus = True  set for combobox column. How do I make the combobox column to open dropdown in single click?

Elavarasan M [Syncfusion]
Replied On April 25, 2015 12:58 AM UTC

Hi Vasanth,
Thank you for using Syncfusion Products.
We have analysed your query and you can achieve your requirement by customizing default cell renderer of GridComboBoxColumn.
For customizing, you need to create customized combobox renderer by deriving it from GridCellComboBoxRenderer. In the customized combobox renderer, you need to override the OnEditElementLoaded method and enable IsDropDownOpen of property of combobox as true.
Please refer the below code snippet to create customize combobox cell renderer and override the OnEditElementLoaded method.
Code Snippet:

public class ComboBoxRenderer : GridCellComboBoxRenderer

{

protected override void OnEditElementLoaded(object sender, Windows.UI.Xaml.RoutedEventArgs e)

{

(sender as ComboBox).IsDropDownOpen = true;

base.OnEditElementLoaded(sender, e);

}
}


After creating customized combobox cell renderer, you need to remove default combobox cell renderer and add the customized cell renderer as shown in below code snippet,
Code Snippet:

//Default combobox cell renderer is removed.

this.sfgrid.CellRenderers.Remove("ComboBox");


//customized combobox cell renderer is added.
this.sfgrid.CellRenderers.Add("ComboBox",new ComboBoxRenderer());


We have prepared a sample for your requirement also and please refer the sample from below location.
Sample location:
http://www.syncfusion.com/downloads/support/forum/118922/ComboboxOnTapped1557069275.zip
Please let us know if you have any queries.

Thanks,
Elavarasan M

Vasanth
Replied On April 27, 2015 01:29 PM UTC

Worked like a champ, thanks!

Jayapradha S [Syncfusion]
Replied On April 28, 2015 03:34 AM UTC

Hi Vasanth,

Thank you for your update.

Please let us know if you have any other queries.

Regards,
Jayapradha


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;