Friday, 27 January 2012

how to open a panel inside gride view in javascript

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>





















 
DID
DNAME
 




Please Wait....












C# code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;

public partial class _Default : System.Web.UI.Page
{
DataClassesDataContext o=new DataClassesDataContext(ConfigurationManager.ConnectionStrings["DatabaseConnectionString"].ToString());
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
fill();
}
void fill()
{
var m = from x in o.EMPs select x;
gv.DataSource = m;
gv.DataBind();
}

protected void btn_Click(object sender, EventArgs e)
{
System.Threading.Thread.Sleep(5000);
}
protected void gv_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
LinkButton ln1 = (LinkButton)e.Row.FindControl("lbt");
Panel pn1 = (Panel)e.Row.FindControl("pn");
ln1.Attributes.Add("onmouseover","x('"+pn1.ClientID+"')");
}
}
}

No comments:

Post a Comment