日期:2014-05-18  浏览次数:20879 次

DATAGRADE怎么自动选中一行?
有个什么属性可以使选择的时候自动选中一行而不是选中一个单元格?
谢谢.在线等 .

------解决方案--------------------
写在DataGrid的_ItemDataBound里

if (e.Item.ItemType == ListItemType.Item ||e.Item.ItemType == ListItemType.AlternatingItem)
{
e.Item.Attributes.Add("onmouseover","this.style.backgroundColor=’#99cc00’;
   this.style.color=’buttontext’;this.style.cursor=’default’;");
e.Item.Attributes.Add("onmouseout","this.style.backgroundColor=’’;this.style.color=’’;");
}