Articles in this section
Category / Section

How to show the DropDown arrow in WPF DataGrid GridComboBoxColumn?

3 mins read

In WPF DataGrid (SfDataGrid), the drop-down arrow for GridComboBoxColumn will be shown only in the edit mode. You can differentiate the combo box column from other columns by showing the drop-down arrow in the display mode by using CellStyle property of the corresponding column.

<Window.Resources>
    <Style x:Key="comboBoxCellStyle" TargetType="syncfusion:GridCell">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="syncfusion:GridCell">
                    <Grid SnapsToDevicePixels="True">
                        <Border Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                SnapsToDevicePixels="True">
                            <Grid>
                                <ContentPresenter Margin="{TemplateBinding Padding}" />
                                <Path Width="5.3"
                                      Height="4.2"
                                      Margin="0,0,7,0"
                                      HorizontalAlignment="Right"
                                      VerticalAlignment="Center"
                                      Data="F1M0,0L2.667,2.66665 5.3334,0 5.3334,-1.78168 2.6667,0.88501 0,-1.78168 0,0z"
                                      Fill="Gray"
                                      Stretch="Uniform" />
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
 
    </Style>
</Window.Resources>
 
 
<Grid>
    <syncfusion:SfDataGrid Name="dataGrid"
                           Margin="20"
                           AutoGenerateColumns="False"
                           AllowEditing="True"
                           ColumnSizer="Auto"
                           ItemsSource="{Binding Employees}">
        <syncfusion:SfDataGrid.Columns>
            <syncfusion:GridComboBoxColumn MappingName="Country" ItemsSource="{Binding Countries}" CellStyle="{StaticResource comboBoxCellStyle}">
            </syncfusion:GridComboBoxColumn>
        </syncfusion:SfDataGrid.Columns>
    </syncfusion:SfDataGrid>
</Grid>

 

GridComboBoxColumn DropDown              

 

Take a moment to peruse the documentation, where you can find about GridComboBoxColumn in SfDataGrid, with code examples.

You can download the example from GitHub

 

Conclusion

I hope you enjoyed learning about how to show the DropDown arrow in WPF DataGrid (SfDataGrid) GridComboBoxColumn.

You can refer to our WPF DataGrid feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our WPF DataGrid example to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied