How to customize Telerik RadComboBox in RadGridView (GridViewComboBoxColumn) Height in WPF?

1 Answer 209 Views
ComboBox GridView
Barani
Top achievements
Rank 1
Iron
Iron
Barani asked on 26 Oct 2022, 02:16 PM | edited on 31 Oct 2022, 07:25 AM

Is it possible to reduce the Telerik RadComboBox in RadGridView (GridViewComboBoxColumn) Height?

We have an issue in our project, we cannot reduce the RadGridView RowHeight. 

For your reference, in the below screenshot, Column3 is Telerik RadComboBox in RadGridView (GridViewComboBoxColumn).

After adding the Column3 (Telerik RadComboBox in RadGridView (GridViewComboBoxColumn)), RowHeight becomes larger.

> Can you please suggest how to reduce RadComboBox height in RadGridView (GridViewComboBoxColumn)?

Thanks in advance.

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Dilyan Traykov
Telerik team
answered on 27 Oct 2022, 11:18 AM

Hello Barani,

Thank you for the provided image.

Based on it, I assume that you're using the Material theme. Please correct me if I'm wrong in this assumption.

If that is indeed the case, you can reduce the height of the RadComboBox by setting its MinHeight, Height, and Padding properties to appropriate values:

            <telerik:RadGridView.Resources>
                <Style TargetType="telerik:RadComboBox">
                    <Setter Property="MinHeight" Value="20" />
                    <Setter Property="Height" Value="20" />
                    <Setter Property="Padding" Value="2" />
                </Style>
            </telerik:RadGridView.Resources>

In addition, you also need to set the RowHeight property of the RadGridView control to the desired value (for example - 20).

Can you please give this a try and let me know if applying a similar style in your application provides the expected result?

Regards,
Dilyan Traykov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Barani
Top achievements
Rank 1
Iron
Iron
commented on 27 Oct 2022, 01:33 PM

Thanks for your quick reply. When I apply the above style in my application, its works as expected.

But after applying this style I faced another issue, it will reduce the RowHight on all pages globally in my application.

But in my case, i need to reduce Telerik RadComboBox in RadGridView (GridViewComboBoxColumn) Height for a particular page only.

Can you please suggest any way to apply this style to a particular page ?

 

Thanks in advance.

Dilyan Traykov
Telerik team
commented on 28 Oct 2022, 03:48 PM

Hello Barani,

To apply the style only to a particular page, you can add it to the Resources collection for only the page in question or directly to the RadGridView instance that you wish to target.

I've prepared a small sample project to demonstrate how you can apply the style only to one of two RadGridView instances present in it.

Can you please have a look at the attached project and let me know if a similar approach would work in your application? If that is not the case, please modify the project to better resemble your scenario and demonstrate your requirement and I will gladly assist you further.

Barani
Top achievements
Rank 1
Iron
Iron
commented on 31 Oct 2022, 07:24 AM

Thank you for attaching the project. When I apply a similar approach in my application, it works as expected. 
Tags
ComboBox GridView
Asked by
Barani
Top achievements
Rank 1
Iron
Iron
Answers by
Dilyan Traykov
Telerik team
Share this question
or