XAMDataGrid列模板 [英] XAMDataGrid column template

查看:81
本文介绍了XAMDataGrid列模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须在XAMDataGrid的(同一)列中显示文本"和图形"状态. 可以请别人为我推荐这个模板.

i have to show Text and Graphical status in one(same) column of the XAMDataGrid. can please someone suggest me template for this.

推荐答案

有两种方法可以实现此目的.第一种是在更改模板的位置使用针对CellValuePresenter的样式.如果不编辑值,则推荐使用这种方法,并且

There are two ways you can accomplish this. The first is to use a Style targeting the CellValuePresenter where you change the Template. If you are not editing the values, this is the recommended approach and there is an example in the Embedding a Custom Control in a Field help topic.

第二种方法是创建一个自定义ValueEditor,如果需要允许进行编辑,则更好.您可以使用安德鲁·史密斯(Andrew Smith)在其

The second way to do this is to create a custom ValueEditor which is better if you need to allow editing. You may be able to use the ControlHostEditor that Andrew Smith provides in the sample in his Hosting WPF Controls in a XamDataGrid Cell blog post.

这篇关于XAMDataGrid列模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆