Handle Double click on Gridview Header resize the column as per the content

1 Answer 88 Views
GridView
Gaurav
Top achievements
Rank 1
Gaurav asked on 21 Nov 2023, 04:10 AM

Hi 

I am using RadGridView with sorting enabled. Also Allowing resize columns.

But when I am double clicking on column text in header, it do sorting but also have extra behavior to expand (resize) the column width based on data, which we do not want.

Is there any way we can stop this behavior?

 

 

1 Answer, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 23 Nov 2023, 01:21 PM

Hi Gaurav,

Thank you for reaching out to us.

By default, double-clicking on the right border of the column header cell will expand the column to fit the value inside. To disable this behavior you can set the AllowAutoSizeColumns property of the RadGridView to false.

this.radGridView1.AllowAutoSizeColumns = false;

Let me know if this property works for you.

Regards,
Dinko | Tech Support Engineer
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
GridView
Asked by
Gaurav
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Share this question
or