Prashant Singh

In my application, I have set column width so that it occupies 100% of datagrid width. However, when I add more rows, vertical scroll bar appears. I need to trap this event and resize my column.

Is there any way that a DataGrid can know when a vertical scroll bar is displayed or hidden


Re: Windows Forms Data Controls and Databinding Ho to capture event for datagrid scrolbars being hidden/shown

Bob zhu - MSFT

Hi£º

why not make datagrid autosize columns, you can refer to follow post

http://syncfusion.com/faq/windowsforms/search/877.aspx






Re: Windows Forms Data Controls and Databinding Ho to capture event for datagrid scrolbars being hidden/shown

Anonymous

Hi,

when you add rows to your datagrid you can check the visible row count if it's greater or equal to the rows count of your collection (i.e. datatable) you know that the scroll bars will be visible. Then you can use the "autowidth" columns or you can set the width by code.

Hope it helps you,


Manuel