datagrid控件,紧急支援??? http://xml.sz.luohuedu.net/xml/ShowDetail.asp?id=F73EF6AD-6878-4748-B963-5181252E5AED 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 可以把添加一个bool列,转换一下.添加dataGridBoolColumn1,设置MappingName为该bool列就可以了。 可以在<asp:datagrid id="myStyleCGrid" runat="server" Height="95%" Width="600px" BorderStyle="None" BorderColor="#CC9966" AutoGenerateColumns="False" BorderWidth="1px" CellPadding="1" OnItemDataBound="ItemDataBound" OnItemCreated="ItemCreated">,然后: /// <summary> /// 控制网格显示风格 /// </summary> public void ItemDataBound(Object sender, DataGridItemEventArgs e) { int intCellCount=e.Item.Cells.Count; DataRowView drv = (DataRowView) e.Item.DataItem; if (drv == null) return; #region 控制网格显示风格 //序号 if (drv["序号"]!=null) { e.Item.Cells[0].Attributes["Width"]="30px"; e.Item.Cells[0].Attributes["Height"]="18px"; } //是否显示 if (drv["是否显示"]!=null) { TableCell tc = e.Item.Cells[3]; tc.Attributes["Width"]="50px"; string strTemp=tc.Text.Trim(); CheckBox cb = new CheckBox(); cb.ID="cb"+e.Item.Cells[3].ClientID; tc.Attributes["Align"]="center"; if (drv["是否显示"].ToString()!="0") cb.Checked=true; else cb.Checked=false; //cb.Enabled=!(drv["mustdisp"].ToString().Equals("1")); tc.Controls.Add(cb); } ...... } c#程序除了vs自带的安装向导,还有别的打包的软件吗。 简单的调色板问题 C#获取方法的名称 System.timers.timer问题 c# 刷新本页面用什么函数? 求解决思路! findwindow的问题? 从窗口如何使用主窗口的数据库连接组件 我要做一个右键菜单,遇到问题了 部署问题,制作安装程序时如何得到用户选择的路径和在开始菜单中添加卸载选项? 如何实现winform的可伸缩菜单(up有分) 请问使用C#需要那些东西??
添加dataGridBoolColumn1,设置MappingName为该bool列就可以了。
/// <summary>
/// 控制网格显示风格
/// </summary>
public void ItemDataBound(Object sender, DataGridItemEventArgs e)
{
int intCellCount=e.Item.Cells.Count;
DataRowView drv = (DataRowView) e.Item.DataItem;
if (drv == null) return; #region 控制网格显示风格
//序号
if (drv["序号"]!=null)
{
e.Item.Cells[0].Attributes["Width"]="30px";
e.Item.Cells[0].Attributes["Height"]="18px";
}
//是否显示
if (drv["是否显示"]!=null)
{
TableCell tc = e.Item.Cells[3];
tc.Attributes["Width"]="50px";
string strTemp=tc.Text.Trim();
CheckBox cb = new CheckBox();
cb.ID="cb"+e.Item.Cells[3].ClientID;
tc.Attributes["Align"]="center";
if (drv["是否显示"].ToString()!="0")
cb.Checked=true;
else
cb.Checked=false;
//cb.Enabled=!(drv["mustdisp"].ToString().Equals("1"));
tc.Controls.Add(cb);
}
......
}