private void MyDataGrid_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if (e.Item.ItemIndex!=-1)
{
int aa=e.Item.ItemIndex+1;
e.Item.Cells[0].Text =aa.ToString();
}
}
{
if (e.Item.ItemIndex!=-1)
{
int aa=e.Item.ItemIndex+1;
e.Item.Cells[0].Text =aa.ToString();
}
}
解决方案 »
- 麻烦一下大家,字符串排序问题
- 一个很基础但我查找了很多资料都没有弄清楚的问题。第一次在CSDN发贴,只有100分,全给了。望高人指点,谢谢
- C#用什么方法可以减少或不使用switch
- 怎么实现移动鼠标 SCRollView跟着滑动
- 【操作WORD问题】无法将类型为“Word.ApplicationClass”的 COM 对象强制转换为接口类型“Word._Application”
- C# winform 创建窗扣时句柄出错
- 客户端回调机制
- 关于C#线程间访问的问题,高手请帮忙看看!
- 如何用GPS结合visual2003(C#)获取本地的坐标?
- 有什么方法可以把界面上遗失的控件(实际存在)找回来?
- 编译时没有问题,浏览时报的错误CS1595: 已在多处定义IntelligentOffice.Desktop._Default
- 怎样扫描得到局域网中每台机器正在活动(连接)的端口
{
int row =0;
int y = 0;
string text="";
e.Graphics.DrawString("序号",this.dataGrid1 .Font, new SolidBrush(Color.Black), 4, this.dataGrid1.Top -10);
for(int i =0;i<this.ds.Tables[0].Rows.Count;i++)
{
text =" " + (row+1);
y=this.dataGrid1.GetCellBounds(row, 0).Y +2;
e.Graphics.DrawString(text,this.dataGrid1.Font, new SolidBrush(Color.Black), 4, y);
row++;
}
}