在DataGrid中的ItemDataBound事件中加入以下代码即可实现鼠标指定列的特殊显示,当鼠标移到DataGrid中一条数据时,该条数据以特殊颜色显示,当鼠标移开时,该条数据又以另外一种特殊颜色显示。
    If (e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem) Then
        e.Item.Attributes.Add("onmouseover", "this.style.backgroundColor='#E4EDF9'")
        e.Item.Attributes.Add("onmouseout", "this.style.backgroundColor='#F1F3F5'")
    End If

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-21
  • 2022-12-23
  • 2022-01-03
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-07
  • 2021-11-12
  • 2021-06-20
  • 2022-01-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案