How to open a model window on click on any row of datagrid?
Hi i want to open a model window on click on datagrid. Can it be possible??
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Niradhip ChakrabortyPosted Jun 26, 2008, 6:45 AM
Say your datagrid id is : dgrdExhibitorInfo
public void dgrdExhibitorInfo_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.AlternatingItem ||
e.Item.ItemType == ListItemType.Item)
{
e.Item.Attributes.Add("onclick", "OpenWin(this)");
}
}
Milton SmithPosted Jun 26, 2008, 7:21 AM
Niradhip ChakrabortyPosted Jun 26, 2008, 7:11 AM
function OnMenuMouseOver(obj)
{
obj.style.cursor='hand';
}
call this javascript function on itemdatabound event.
public void dgrdExhibitorInfo_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.AlternatingItem ||
e.Item.ItemType == ListItemType.Item)
{
e.Item.Attributes.Add("onclick", "OpenWin(this)");
e.Item.Attributes.Add("onmouseover", "OnMenuMouseOver(this)");
}
}
Milton SmithPosted Jun 26, 2008, 6:57 AM
Milton SmithPosted Jun 26, 2008, 6:31 AM
Niradhip ChakrabortyPosted Jun 26, 2008, 6:24 AM
the java script function to open the page.