DataGrid and DataList style

xiaoxiao2021-03-06  13

// DataGrid Style: private void DataGrid1_ItemDataBound (object sender, System.Web.UI.WebControls.DataGridItemEventArgs e) {if (e.Item.ItemType = ListItemType.Header!) {E.Item.Attributes.Add ( "onmouseover", "this.oldcolor = this.style.backgroundcolor; this.style.backgroundcolor = '# c8f7ff'"); E.Item.attributes.add ("onmouseout", "this.style.BackgroundColor = this.oldcolor"; e .Item.attributes.add ("onclick", "this.style.backgroundcolor = 'red'; this.style.cursor = 'hand';");}}

// DataList style:

Write a table in the DataList's itemtemplate, where TR is set

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

New Post(0)