Home Forums WPF controls Xceed DataGrid for WPF Cells in column doesn’t have the same size

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

    I found a funny bug;) If I set column width to Double.NaN, each cell in grid has its own individual size;)
    But originally I was trying to find a way to make grid columns fit their content. Does your grid have this feature implemented?

    Imported from legacy forums. Posted by Nick (had 460 views)

    Xceed Support
    Member
    Post count: 5658

    There is a method GetFittedWidth() on column that allows determining the column widht based on the content of currently “realized” DataRows. There is no automatic sizing of the columns yet… but at any moment in time, you can call GetFittedWidth() and assign it to the Column.Width property.

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

    User (Old forums)
    Member
    Post count: 23064

    What are realized DataRows? Do you mean already visualized DataRows?
    I tried to call GetFittedWidth, but it returns width only for column title. I guess you check only already generated items, so just after I modified source DataTable, items aren’t generated yet. For MS ItemsControl I can use handle StatusChanged event of its ItemContainerGenerator, but you marked it as Obsolete. So what event can I handle where I can call GetFittedWidth?

    Imported from legacy forums. Posted by Nick (had 3287 views)

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