DataGrid:根据单元格B的内容修改前景单元格颜色A-可以吗? [英] DataGrid: Modify Foreground Cell Color A Based on Content Of Cell B - Is it possible?

查看:67
本文介绍了DataGrid:根据单元格B的内容修改前景单元格颜色A-可以吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好!

在此论坛中,我们可以找到两个有关datagrid格式的不错的话题:

In this forum we can found two nice thread about datagrid format:

更改Datagrid的RowBackground颜色

您还可以在此处找到一个很好的例子

You can also find a great example here:

DataGrid行和其他控件的LightSwitch控件颜色UI元素

所有示例都是关于根据其内容格式化单元格A .需要一个示例,其中根据单元格B的内容来格式化单元格A.

All the examples are about Format Cell A based on its content. A need an example where Cell A are formated based on Cell B content.

有可能吗?

最诚挚的问候,

Ciro

推荐答案

嗨!

您在实现行/单元格着色方面是否取得了成功?

Have you any success in implementing row/cell coloring?

也许我会听起来有点悲观,但我只丢了3个日子过得怎么样相似的工作东西.. LS仅仅是达不到的任务.现在我并不感到惊讶,它去它去的道路上(放弃) ..虽然这个主意很棒,但其他一切都只是->嗯.. (而且我从Beta 1开始就一直在这里).

Maybe I'll sound little pessimistic, but I just lost 3 days getting something similar to work.. LS is just not up to task.. Now I'm not surprised that it went on the road it went (abandoned).. While the idea is great, everything else is just -> meh.. (and i'm here all the way from beta 1)..

我有简单的"is_active"计算属性(但我感觉与相关表中的属性相同),并且需要相应地为行上色:绿色-活动,红色-非活动.它的工作方式不一致..如果您有一些复杂的屏幕,则需要 找到挂钩点,您可以在这些挂钩点上注入方法来告诉Datagrid刷新布局(例如"datagrid.OnApplyTemplate"),或者只是"collection.refresh()".在我使用的每个屏幕上,都有一些"catch"标记. ..  我已经 尝试了几乎所有我在网上都能找到的东西,戴夫(Dave)的例子,奥蒂斯(Otis)的例子,以及一些已经老化的类似SL帖子..  connect   ; 各种组合中的表格 像0..1->我什至将我的表逻辑转换为RIA服务,在该服务中主表没有计算出的属性,但整个表都以"real"返回.来自RIA服务的属性(因此,"is_active"是在到达之前进行计算的 仍然是相同的愚蠢,不一致,"loading_row".不会被解雇,更不用说在RIA&sbs; stables  &sbs; sstables< stables&hl = zh_CN

I have simple "is_active" computed property (but I feel it's the same with properties from related tables) and need to color rows accordingly: green - active, red - inactive.. It works inconsistently.. If you have some complex screen you need to find hook points where you could inject methods to tell datagrid to refresh layout (like "datagrid.OnApplyTemplate"), or just "collection.refresh()".. On every screen I used it there is some "catch".. I've tried almost everything I could find on net, Dave's example(s), Otis example, some already aged similar SL posts..  tried to connect tables in various combination like 0..1 -> 1.. I have even converted my tables logic to RIA services where main table does not have computed properties but whole table is returned with "real" properties from RIA service (so "is_active" is computed before arriving to client).. Still same stupidities, inconsistency, "loading_row" not being fired, not to mention troubles in plumbing all together between RIA tables and "real" tables...

简单"的东西如果有人有(某种)解决方案,我想听/读,那么这就是"LS物"的原因.有机会和我的电脑一起飞过我的窗户.

Something so "simple" shouldn't be so complicated to achieve.. If anyone have (kind of) solution I'd like to hear/read it cause right now this "LS thing" have big chance to fly trough my window together with my pc..

Kivito


这篇关于DataGrid:根据单元格B的内容修改前景单元格颜色A-可以吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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