By design, when there is no column width defined (the default behavior), the actual width of each column will be adjusted by the web browser using the best fit approach. If necessary, you can also set the GridViewDataColumn.Width property explicitly.
By the way, we have a similar suggestion in our wish list: Best fit the column on a double click, on the edge between two columns.. Start tracking that report for voting for this feature. For now, we count the number of trackers as a voting system.
Sorry, I'm late to reply. I think I can't explain the situation exactly. I don't want to set up columns width manually. Simply, I have a aspxgrid in a web form, and I fill it with data from sql codes. Then when page is loading, the data is on the grid columns doesn't fit .As you see In example in Grid.jpg, columns text is wrapping.
Thank you for replying, I attached grid.jpg and simple example about my problem. When I set ASPxGridView.SettingsBehavior.ColumnResizeMode property to disabled, unnecessary space appeared in grid columns (grid.jpg in WebSite4 folder). So I wanted to Autofit columns. All I want, automatic growing up columns, so I don't want to think about columns width or I want to Columns width, all depends Data text length on columns.
Thank you for sending the project to us. There are two different factors, which cause this behavior. First, you set the ASPxGridView's Width property to 100%. It means that the control's content should be spread over the whole browser window. Also, the column's width cannot be less than the column's Caption. Generally, we do not set the Width property of a column explicitly, and it is a browser responsibility to decide how to show the TABLE element, representing the grid on the client side.
Is your intention to post an answer to your own question?
- If so, then proceed.
- If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
- If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.