如题,谢谢,最好是无刷新的
解决方案 »
- WebClient.DownloadString html标签异常问题
- Winfrom怎样才能引用Delphi6中的DLL?
- Firefox 中重复提交的BUG
- 父窗体中弹出子窗体后,怎样把子窗体中选中的值传回父窗体呀??
- 如何用radiobuttonlist控制一个TABLE的显示与否?
- 请问用CAPICOM控件签名时,hash算法是在哪里决定的?
- 我想把服务器上的数据用DataSet写成XML保存到本地,可是出现无法写的问题,请帮忙。
- 求大神讲解下怎么用.net实现监控交换机网络流量【谢谢了】
- 在 ServiceModel 客户端配置部分中,找不到引用协定“ServiceReference1.Service1Soap”的默认终结点元素。这可能是因为未找
- 我的MDAC不能更新?
- 求 解析 xml 的代码
- 弹出DIV在按钮触发后不关闭
根据点击行的Index
然后再获取选定行row = GridView.Rows[Index]
然后再tbxxx.Text = row.Cells[x].Text;
onselectedindexchanged="GridView1_SelectedIndexChanged">
<Columns>
<asp:CommandField ShowSelectButton="True" />
</Columns>
</asp:GridView>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
GridView1.SelectedRowStyle.BackColor = System.Drawing.Color.Red;
string[] s = new string[] { "sfa", "sfa", "sfa" };
GridView1.DataSource = s;
GridView1.DataBind(); }
}
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
if (GridView1.SelectedRow != null)
{
string s = GridView1.SelectedRow.Cells[1].Text;
}
}
for(int i GrieView.rows.count)
{
GridView1.SelectedRow.Cells[i].Text;
}
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
LinkButton _singleClickButton = (LinkButton)e.Row.Cells[0].Controls[0];
string _jsSingle = ClientScript.GetPostBackClientHyperlink(_singleClickButton, "");
_jsSingle = _jsSingle.Insert(11, "setTimeout(\"");
_jsSingle += "\", 300)";
e.Row.Attributes["onclick"] = _jsSingle;
}
} protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
GridView _gridView = (GridView)sender; // Get the selected index and the command name
int _selectedIndex = int.Parse(e.CommandArgument.ToString());
string _commandName = e.CommandName; switch (_commandName)
{
case ("SingleClick"):
_gridView.SelectedIndex = _selectedIndex;
this.Message.Text += "Single clicked GridView row at index " + _selectedIndex.ToString() + "<br />";
break;
}
} #endregionGOOD luck!
e.Item.Attributes.Add("onclick","onclick("+Index+")")index为行号
然后取得GridView : document.getElementByID('')
在通过GridView获得行中每列的值。赋给你所需要的TextBox
var tb = document.getElementById("GridView1");
for(var i=1;i<tb.rows.lenth;i++){
tb.rows[i].onclick=function(){
document.getElementById("TextBox1").value = tb.rows[i].innerText;
}
}
}