http://blog.9cbs.net/bgu/
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 processing ------------ Function: For data 梆 Mouse event parameters Description: OBJ: Objects ThisfontColor: Font Color Backcolor: Background Color ---------- ------------------------------------ * /
Var objState
// --------------------- Function OnfoucsMouseover (Obj, Fontcolor, BackColor) {iover (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 (objstate) {i (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 new window to open Address 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);}} =================================== ======== Background data 梆: ==================================== ====== Private void dglist_itemdatabase (Object sender, system.web.ui.webcontrols.dataGriditeMeventArgs e) {// if (E.Item.Item.Andex! = -1) {E.Item.attributes.add ("onmouseover "," OnfoucsMouseOver (this, '# ffffff', '# 000000'); "); E.Item.attributes.add (" onmouseout "," onfoucsmouseout (this, '# 000000', '# fffff'); " ); E.Item.attributes.add ("onclick", "onfouclick (this, '# fffff', '# 000000');"); E.Item.attributes.add ("OnDBLClick", "Onfouclick (this, '#Ffffff', '# 000000', 'About: Bank'); ");}} ============================ ============= = Front desk .aspx page call js file: