The completion function is the page selected event, mouse event, and double-click the color of the TR. The code is simple, just a bit of JS operation.
JS file: GridControl.js
==============================
/ * ----------- DataGrid mouse event ------------
Function: Used for data 梆 Mouse event
Parameter Description:
OBJ: Objects this
Fontcolor: Font Color
Backcolor: Background Color
--------------------------------------------- * /
Var objState
// -----------------------
Function OnfoucsMouseover (Obj, Fontcolor, Backcolor)
{
IF (Obj.RowIndex> 0)
{
Obj.style.color = fontcolor;
Obj.Style.BackgroundColor = backcolor;
}
}
// -----------------------
Function OnfoucsMouseout (Obj, Fontcolor, Backcolor)
{
IF (Obj.RowIndex> 0)
{
IF (Obj! = ObjState)
{
Obj.style.color = fontcolor;
Obj.Style.BackgroundColor = backcolor;
}
}
}
// -----------------------
Function Onfouclick (Obj, Fontcolor, Backcolor)
{
IF (Obj.RowIndex> 0)
{
IF (ObjState! = NULL)
{
ObjState.StyLe.color = ""
ObjState.style.BackgroundColor = "";
}
Obj.style.color = fontcolor;
Obj.Style.BackgroundColor = backcolor;
ObjState = OBJ;
}
}
// -----------------------
Function OnfoucsDbClick (Obj, Fontcolor, Backcolor, OpenURL)
{
/ / Parameter OpenURL is the address of the new window you want to open
IF (Obj.RowIndex> 0)
{
IF (ObjState! = NULL)
{
ObjState.StyLe.color = ""
ObjState.style.BackgroundColor = "";
}
Obj.style.color = fontcolor;
Obj.Style.BackgroundColor = backcolor;
ObjState = OBJ;
WINDOW.OPEN (OpenURL);
}
}
=================================================== After the background data is:
=================================================================================================================================================================================
Private void DGLIST_ItemDatabase (Object Sender, System.Web.ui.WebControls.DataGriditeMeventArgs E)
{
//
IF (E.Item.ItemIndex! = -1)
{
E.Item.attributes.add ("OnMouseover", "OnfoucsMouseover (this, '# fffff', '# 000000');")
E.Item.attributes.add ("onmouseout", "onfoucsmouseout (this, '# 000000', '# fffff');");
E.Item.attributes.add ("Onclick", "Onfouclick (this, '# ffffff', '# 000000');");
E.Item.attributes.add ("OnDBLClick", "OnfoucsDbClick (this, '# fffff', '# 000000', 'About: Bank');")
}
}
=================================================================================================================================================================================
The front desk .aspx page calls JS file: