开发者

Add new row: ListView vs. DataGrid

I have been looking around and even found a couple of related answers and didn't get a certain answer to my question.

Is there a way to have in the WPF ListView an additional row like in a DataGrid? I prefer using the ListView since I use 3.5 and the DataGrid is not officially in the box and has many quirks.

I would prefer using th开发者_开发知识库e ListView if there is an official option to add new rows or else I use the DataGrid.

Thanks a lot.


I would use the DataGrid. That functionality already exists so there's no need to reinvent the wheel... besides you can make the DataGrid function exactly the way the ListView does if you have the burning desire to do so. Usually in my apps, I use a DataGrid that is by default read-only, then I provide a button to the user to allow them to modify the contents of the DataGrid (set the read-only property to false). I also restyle the DataGrid because I think it looks ugly out of the box... especially on XP machines.

On a side note, last week I installed a fresh copy of VS 2008 SP1 on a new PC and it came with the WPF Toolkit already loaded (which includes the DataGrid, DatePicker, etc.). So you might want to check it out.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜