ASP.NET in the DataGrid mouse through the perception and click on the line pop-up window

xiaoxiao2021-03-06  107

Many people say it is difficult, in fact, this few lines of code. As long as you write the code in the itemDatabase of DataGrid1

Private void DataGrid1_itemdatabase (ibject sender, system.web.ui.webcontrols.dataGriditeMeventargs e) {if (E.Item.itemindex> = 0) // This line can delete {// pop-up code E.Item.attributes.add ("OnClick", "Window.open ('Webform2.aspx? zoneno =" E.Item.cells [0] .Text "', '', 'Toolbar = no')"; E.Item.attributes. Add ("OnMouseOver", "this.style.backgroundColor = '# e9e9e9'; this.style.cursor = 'hand';"); E.Item.attributes.add ("onmouseout", "this.style.backgroundcolor = '# f7f7f7'; ");}}

转载请注明原文地址:https://www.9cbs.com/read-102820.html

New Post(0)