开发者

Silverlight ItemsControl wih ColumnHeader

How can I add column headers to a Silerlight ItemsControl? I need a fast way to display a Lis开发者_如何学JAVAt of items that contains also some header info.


This may seem like a simplistic question but why not use the DataGrid in readonly mode?

The downside with data grid is it doesn't use a virtualised ItemsControl so performance may suffer if you are trying to list hundreds of items with many columns.


There's nothing built into the ItemsControl itself, but there's nothing to stop you from making a custom control that has that kind of functionality. It's a little work up front for the ability to reuse it later if it's a piece of UI you need frequently.

Adding too much functionality to it might be overkill though; if you need column sorting or automatic column/header generation, you may find that a DataGrid (as Anthony pointed out already) would be a faster way of getting a lot of functionality for free.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜