原創(chuàng)|使用教程|編輯:龔雪|2020-07-13 10:43:24.650|閱讀 443 次
概述:通過DevExpress WPF Controls,您能創(chuàng)建有著強大互動功能的XAML基礎應用程序,本文將為大家介紹如何更改DataBarFormatConditions中的填充顏色。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關(guān)鏈接:
下載DevExpress v20.1完整版 DevExpress v20.1漢化資源獲取
通過DevExpress WPF Controls,您能創(chuàng)建有著強大互動功能的XAML基礎應用程序,這些應用程序?qū)W⒂诋敶蛻舻男枨蠛蜆?gòu)建未來新一代支持觸摸的解決方案。
在網(wǎng)格中有2列 - Side和Percentage Done,想添加類似條的內(nèi)容來直觀地指示完成的百分比以及當前顯示的數(shù)字,同時還想通過在下面的代碼中添加FormatCondition來更改基于"Side"值的顏色(以下內(nèi)容將無法正常工作,因為該條相對于其他條顯示)。
var dataBarPercentDoneFormatCondition = new DataBarFormatCondition { FieldName = nameof(PercentDone), PredefinedFormatName = "GreenSolidDataBar" // I want the color to be red if the "side" is "sell" and green if its "buy" };
這個問題如何解決呢?
在這種情況下,您需要定義兩個具有不同SelectiveExpression值的DataBarFormatCondition元素。 這些值使您可以指定何時顯示某些DataBarFormatCondition:
<dxg:DataBarFormatCondition FieldName="PercentageDone" SelectiveExpression="[Side] = 'Sell'" PredefinedFormatName="GreenSolidDataBar" /> <dxg:DataBarFormatCondition FieldName="PercentageDone" SelectiveExpression="[Side] = 'Buy'" PredefinedFormatName="RedSolidDataBar" />
DevExpress技術(shù)交流群2:775869749 歡迎一起進群討論
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請務必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自:慧都網(wǎng)