datagrid 如何选中一行,选中的行背景颜色更改。
解决方案 »
- listbox选中值的问题
- 无法将类型“System.Data.DataColumn”隐式转换为“System.Data.DataColumn[]”
- C#中的SerialPort控件的读写问题
- 关于提交页面请求
- listview行间距问题
- 使用SaveFileDialog时候的问题
- 各侠大侠,我真的是没分了!为什么我放在.aspx中的用windows应用程序写的.dll无法做数据库写入的工作。报错,权限问题
- 汉字编码问题
- dotnetbar.datagridviewx的checkboxcolumn问题
- winform怎么实现凹凸按键 点击后处于凹陷状态 再次点击弹起
- 想找一本C#的书
- 关于c# 中线程结束是否需要Join()
private void DataGrid1_ItemCreated(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if(e.Item.ItemIndex!=-1)
{
e.Item.Attributes.Add("onmouseover","this.setAttribute('BKC',this.style.backgroundColor);this.style.backgroundColor='#999999';this.style.cursor='hand';");
e.Item.Attributes.Add("onmouseout","this.style.backgroundColor=this.getAttribute('BKC');");
}
on error resume next
'window.mainform.selectId.value=id
set obj=window.event.srcElement.ParentElement
if not oldobj is nothing then
if obj is oldobj then
exit sub
else
oldobj.className=oldclass '"unselected"
end if
end if
oldclass = obj.className
obj.className="selected"
set oldobj=obj
window.mainForm.SelectedId.value=id'SelectedID是一个display:none的txtBox,我用它来记录当前选中的行的一个id
end sub