点击gridview的某一行的任何一个地方,如何能取到点击的是哪一行???
解决方案 »
- 从某个文件里边读取图片文件添加到ImageLIst中
- 在windows mobile项目里怎么给图片切块啊
- C#字符串数组常量?
- 写一个服务程序,提供一个服务,在客户端写个程序用来控制这个服务的启动和停止,求给个思路
- datagridview 显示的问题
- 模板列checkbox问题
- 高手们帮帮忙啊!关于ListView控件的问题!
- 光标文件怎样放入资源文件中,又怎样读取,为什么我读出来的是一块黑色的矩型?
- 菜鸟请问关于PropertyGrid 控件的简单问题,谢谢
- 调用DLL中的API时,出现错误:"其他信息:未将对象引用设置到对象的实例"
- Excel版本问题?
- 急!!如何将Graphics画的图象保存到内存中?
如此这般//datagrid的整行选择
private void dg_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
//整行选择
if(e.Button==System.Windows.Forms.MouseButtons.Left)
{
dg.Select(dg.CurrentRowIndex);
tt_id.Text=dg[dg.CurrentCell.RowNumber,0].ToString();
tt_name.Text=dg[dg.CurrentCell.RowNumber,1].ToString();
}
if(dg[dg.CurrentCell].GetType().ToString()=="System.Boolean")
{
if(dg[dg.CurrentCell].ToString()=="True")
{
dg[dg.CurrentCell]=false;
}
else
{
dg[dg.CurrentCell]=true;
}
}
}
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes["OnClick"] = ClientScript.GetPostBackEventReference(this,"Select$" + e.Row.RowIndex);
e.Row.Style["cursor"] = "hand";
}
}