• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            posts - 124,  comments - 29,  trackbacks - 0
            運行效果見上圖, 可以根據(jù)單元格中的值來設(shè)置顏色,100%為紅色,其他為綠色。
            實現(xiàn)方法:用列模板綁定數(shù)據(jù)源中定義的顏色數(shù)據(jù)項。
            其中列模板用Border加TextBox構(gòu)成,代碼如下:
            private static DataTemplate MakeCellTemplate(MyColumn col)
                    {
                        try
                        {
                            DataTemplate dt1 = new DataTemplate();
                            StringBuilder xaml = new StringBuilder();
                            xaml.Append("<DataTemplate ");
                            xaml.Append("xmlns='http://schemas.microsoft.com/client/2007' ");
                            xaml.Append("xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml' ");
                            xaml.Append(">");
                            xaml.Append("<Border ");
                            xaml.Append("BorderThickness='0.5' BorderBrush='LightGray' Background='Orange'>");
                            xaml.Append("<TextBox ");
                            xaml.Append("IsReadOnly='True' Text='{Binding " + col.Name + "}' Foreground='Black' BorderBrush='White' BorderThickness='0' Background='{Binding " + col.colorValue + "}'");
                            xaml.Append("/>");
                            xaml.Append("</Border>");
                            xaml.Append("</DataTemplate>");
                            dt1 = (DataTemplate)XamlReader.Load(xaml.ToString());
                            return dt1;
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.Message + ex.StackTrace);
                            return null;
                        }
                    }
            posted on 2010-12-07 16:17 天書 閱讀(2544) 評論(0)  編輯 收藏 引用

            <2010年12月>
            2829301234
            567891011
            12131415161718
            19202122232425
            2627282930311
            2345678

            常用鏈接

            留言簿(5)

            隨筆檔案

            文章分類

            文章檔案

            好友的Bolg

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            久久精品国产精品亚洲人人| 欧美性猛交xxxx免费看久久久| 久久99精品国产99久久6男男| 波多野结衣AV无码久久一区| 久久久久久久97| 伊人久久大香线蕉综合影院首页| 亚洲国产精品一区二区三区久久| 久久国产精品偷99| 久久人妻少妇嫩草AV无码蜜桃| 伊人 久久 精品| 久久久久久久久久久久中文字幕 | 国产人久久人人人人爽| 久久久WWW成人免费精品| 午夜精品久久影院蜜桃| 99久久国产亚洲高清观看2024| 国产精品久久久久久久久久影院 | 97精品伊人久久大香线蕉app| 四虎国产永久免费久久| 午夜不卡久久精品无码免费| 亚洲一本综合久久| 少妇久久久久久被弄高潮| 久久人人青草97香蕉| 久久综合色之久久综合| 久久精品国产一区| 大伊人青草狠狠久久| 精品久久人妻av中文字幕| 99精品久久久久久久婷婷| 亚洲AV无码久久| 色婷婷久久综合中文久久蜜桃av| 99久久www免费人成精品 | 九九热久久免费视频| 93精91精品国产综合久久香蕉| 国产一区二区精品久久岳| 国产2021久久精品| 久久人人爽人人爽人人片AV高清| 久久人人爽人人爽人人片AV麻豆 | 思思久久99热只有频精品66| 久久人人爽人人爽人人片AV不| 一本大道久久东京热无码AV| 久久精品国产亚洲av瑜伽| 亚洲AV无码一区东京热久久 |