Greg,
On server side use ItemDataBound event to setup a javasript onclick event
handler for every cell in the row. Example:
private void dgList_ItemDataBound(object sender,
System.Web.UI.WebControls.DataGridItemEventArgs e)
{
ListItemType itemType = e.Item.ItemType;
if ((itemType == ListItemType.Pager) ||
(itemType == ListItemType.Header) ||
(itemType == ListItemType.Footer))
{
return;
}
e.Item.Attributes["onclick"] = "onRowClick(this)";
}
On client side in onRowClick(this) change the row visual properties to make
it visualy selected and save the key column value in a variable. If the grid
doesn't show the key value, pass it in an invisible column. When you need to
open the detail page, do it with showModalDialog call and pass the saved key
as a parameter.
Eliyahu
"gregoryenelson" <gr*******************@mail.codecomments.com> wrote in
message news:gr*******************@mail.codecomments.com.. .
Hi.
I am sitting here in a company with many people, but no other
programmers least of all asp.net ones.
I have created a 'view' form on the INTRAnet, where many lines are
displayed in a datagrid (SeLECT statement built in code and the Dataset
bound to datagrid).
I just need to allow the user to click a row, whereupon I take the key
from a field in that row and open up a Detail page.
I cannot find a way. OK, there is clientside and serverside scope, but
there must be a way to do this.
Possible?
Help greatly appreciated.
Greg
--
gregoryenelson
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------