开发者

Is there any alternate control to grid view which has same facility as grid view?

I am trapped in one problem. I have a page which contains some taxboxes. When I click in one particular texbox,it should open another page in ModelPopUpExtender. Now what I want is when the child page is loaded, it should fill gridview(Or Alternate) and when I click anywhere in gridview, the data from that row should be saved in some collection and popup should be closed. I dont know how to get data from grid view without using any button in that gridview. Plea开发者_开发知识库se suggest me some way to achieve this task or any other control that can give such facility.


You need to add an onclick event to each row in the OnRowDataBound event of the GridView, like this:

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
    e.Row.Attributes["onclick"] = ClientScript.GetPostBackClientHyperlink(e.Row, String.Empty);
}

When you click in the row, a postback will occur. Then you can perform whatever logic is needed.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜