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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to open the DropDown with a single click in the GridComboBoxColumn?

Platform: WinRT |
Control: SfDataGrid

You can open the DropDown with a single click in the GridComboBoxColumn by deriving a new class from the GridCellComboBoxRenderer and overriding the OnEditElementLoaded virtual method as follows.

 C# 

public class ComboBoxRenderer : GridCellComboBoxRenderer
{
    protected override void OnEditElementLoaded(object sender, System.Windows.RoutedEventArgs e)
        {
            base.OnEditElementLoaded(sender, e);
            var combobox = sender as ComboBox;
            combobox.IsDropDownOpen = true;
        }
}

Refer to the following code example to remove the default GridCellComboBoxRenderer and add the customized GridCellComboBoxRendererExt to the SfDataGrid.CellRenderer collection and Set EditTrigger as OnTap in SfDataGrid.

 

C#

public MainWindow()
        {
            InitializeComponent();
            //Default combobox cell renderer is removed.
            this.sfgrid.CellRenderers.Remove("ComboBox");
            //Customized combobox cell renderer is added.
            this.sfgrid.CellRenderers.Add("ComboBox", new ComboBoxRenderer()); 
        }

 

Xaml

  <syncfusion:SfDataGrid Name="sfgrid"
                               AllowEditing="True"
                               AutoGenerateColumns="False"
                               ColumnSizer="SizeToHeader"
                               EditTrigger="OnTap"
                               ItemsSource="{Binding StoreLists}">

 

 

Samples

WPF

WinRT

UWP

ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

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

Live Chat Icon For mobile