把这一列的visiable设为false不显示.但在程序中还是可以用的
解决方案 »
- 急.....textbox如何自动输入
- 用C#.net怎样实现收取邮件
- repeater的问题
- 紧急求救!用.net2005开发asp.net中DataGrid控件遇到的棘手问题!
- 为什么treeview在调试的时候节点打不开
- 急!申请了个国外免费.NET空间,网页中的中文显示乱码,求助!!!!
- webservice.htc是干什么用的?
- 为什么在Internet临时文件夹中(Temporary Internet Files)存在相同的文件?
- 帮帮忙,我不知道,乍么让一个控件获得焦点 在线等腰
- 救命呀,ASP.net网页看不到服务器组件,只有10分了
- 请问这段事务处理为何会出现错误?
- 怎样提取DropDownList的内容?
这是我的:
if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem){
String ContractName = DataBinder.Eval(e.Item.DataItem, "ContractName").ToString();
e.Item.Cells[0].ToolTip = ContractName;
DateTime date1 = DateTime.Parse(e.Item.Cells[4].Text);
string Result = e.Item.Cells[5].Text;
DateTime now = DateTime.Today;
TimeSpan diff1 = date1 - now ;
int days = (int)diff1.Days;
if((days < 3)&&(Result == "执行中")) {
int numj=e.Item.Cells.Count;
for(int j=0;j<numj;j++)
{
e.Item.Cells[j].ForeColor=Color.Black;
e.Item.Cells[j].Font.Bold=false;
e.Item.Cells[5].BackColor = Color.Red;
}
}
If (e.Item.ItemType = ListItemType.Item Or _
e.Item.ItemType = ListItemType.AlternatingItem) Then
If Convert.ToDateTime(e.Item.Cells(1).Text) < DateTime.Today Then _
e.Item.Cells(1).BackColor = System.Drawing.Color.FromName("#ffccff")
If e.Item.DataItem("UserID") = 590 Then _
e.Item.Cells(2).BackColor = System.Drawing.Color.DeepPink
End If
End Sub
e.Item.BackColor=Color.Blue;
if((e.Item.Cells[6].Text)=="Å®")
e.Item.BackColor=Color.Red;
private void change_color(Object sender, DataGridItemEventArgs e) {
if((e.Item.Cells[1].Text)=="ÄÐ")//
e.Item.BackColor=Color.Blue;
if((e.Item.Cells[1].Text)=="Å®")
e.Item.BackColor=Color.Red;
}http://www.csdn.net/expert/topic/733/733305.xml?temp=.9916498