问题描述
我有一个datagrid,其中有一个datagridcolumn。没有自定义的itemrenderer,我可以使用一个datatip函数来显示一个自定义数据提示,但是现在我想要一个自定义项目渲染来对行进行不同的着色。因此,我扩展了一个标签并更改了数据方法,但现在我的数据功能不再工作。任何想法?
提前感谢
Sebastian
我知道这个问题是一个有点老,但是我遇到了同样的问题,并通过查看标准的DataGridItemRenderer类来解决它。
所以基本上我最终复制了toolTipShowHandler()函数进入我的类(没有任何修改),实现IDropInListItemRenderer接口,并在我的渲染器的commitProperties()函数中添加几行,这些都是由DataGridItemRenderer启发的。
希望这有帮助。
I have a datagrid with one datagridcolumn in it. Without a custom itemrenderer I can use a datatipfunction for showing a custom datatip but now I want to have a custom item render for colouring the rows differently. Therefore I extended a label and changed the data method but now my datatipfunction does not work anymore.
Any ideas?
thanks in advance
Sebastian
I know this question is a wee bit old, however I just ran into the same problem and solved it by looking at how the standard DataGridItemRenderer class does it.
So basically I ended up copying that toolTipShowHandler() function into my class (without any modification), implementing the IDropInListItemRenderer interface and adding a few lines into my renderer's commitProperties() function, which were inspired by the DataGridItemRenderer, too.
Hope this helps.
这篇关于Datagrid中的自定义Itemrender与Datatip的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!