开发者

Custom DataGrid Silverlight

开发者 https://www.devze.com 2023-04-10 05:51 出处:网络
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 (

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消