Home Forums WPF controls Xceed DataGrid for WPF Automatic Column Width

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #24923 |

    Most of the time I would like my column width to automatically be as wide as it needs to be to show all the values in the column (included the title). <b>But</b> sometimes I would like the width to take the cellEditor Template (and its possible values) into account aswell.

    If I for example have a column where the Title is “Unit” and I have three rows with the values “cm”, “feet” and “inches”. I then have a cellEditor Template (showing when the mouse is over the cell), showing a ComboBox with the values “cm”, “feel”, “inches” and “a much longer word”. In that case I would like the column width to be so wide that when I look inside the ComboBox, the value “a much longer word” shows within the column boundaries.

    Are these two scenarios possible?

    Imported from legacy forums. Posted by Tove (had 727 views)

    Xceed Support
    Member
    Post count: 5658

    There is no automatic way of doing this…

    Maybe you could detect that a cell for the desired column is entering edition mode and you could change the Column.Width at that moment to accommodate your editor…

    Imported from legacy forums. Posted by Marcus [Xceed] (had 2563 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.