Custom DataGrid Silverlight
I'm writing custom DataGrid control. I have one collection of column headers and other collection of rows, which has collection of cells itself. I want all the cells in the column be the same width (the width of the widest cell). How can i do it?
Solution: Every cell knows the column which keep it. In cell's OnApplyTemplate i use Measure and assign the maximum between column's and cell's width to the colunm. When the whole DataGrid is loaded, i iterate through the cells of each row and assign the width of the c开发者_C百科olumn to each cell.
精彩评论