带有突出显示值的datagridview [英] datagridview with highlighting value

查看:68
本文介绍了带有突出显示值的datagridview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须在表单加载事件中创建一个页面,其中datagridview与access数据库绑定并比较第一列单元格的值,如果value小于特定行的标准十进制值颜色应该chnge到其他颜色在c#窗口应用程序中。

请紧急帮助

解决方案

  protected   string  GetText( object  oItem)
{

if (您的逻辑)
{
return DataBinder.Eval (oItem, _ adTitle)。ToString()。Replace(keyword, < b style = color:#92BF08; size:144px> + keyword + < / b>);
}

}





将以上方法添加到cs代码



 <   asp:Label     ID   =  lbltitle    runat   =  server   文本  ='  <% #GetText(Container.DataItem )%> '   字体粗体  = 错误    ForeColor   = #3399FF   字体大小  =  12 >  <   / asp:标签 >  





这个用于ASPX


I have to create a page in which on form load event the datagridview bind with access database and compare value of the cell of first column if value is less than the standard decimal value color of the particular row should be chnge to other color in c# window application.
Please help it urgent

解决方案

protected string GetText(object oItem)
   {

       if (your logic)
       {
           return DataBinder.Eval(oItem, "_adTitle").ToString().Replace(keyword, "<b style=color:#92BF08;size:144px>" + keyword + "</b>");
       }
       
   }



add above method to cs code

<asp:Label ID="lbltitle" runat="server" Text='<%#GetText(Container.DataItem)%>' Font-Bold="False" ForeColor="#3399FF" Font-Size="12"></asp:Label>



this for Aspx


这篇关于带有突出显示值的datagridview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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