突出显示所选行的GridView [英] Highlighting the Selected Row GridView

查看:148
本文介绍了突出显示所选行的GridView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在上编辑用户从点击我想强调的行和这里的gridview的是我做了什么,但没有效果。还有什么我失踪?

  .SelectedRowStyle
{
    背景色:黄色;
}< ASP:GridView控件=服务器的CssClass =DataWebControlStyle>
   < AlternatingRowStyle的CssClass =AlternatingRowStyle/>
   < RowStyle的CssClass =RowStyle/>
   < HeaderStyle的CssClass =HeaderStyle/>
   < SelectedRowStyle的CssClass =SelectedRowStyle/>
< / ASP:GridView的>


解决方案

这是我如何能够解决:

  IF((e.Row.RowType == DataControlRowType.DataRow及((e.Row.RowState&安培; DataControlRowState.Edit)== DataControlRowState.Edit))){
         e.Row.BackColor = Drawing.Color.Yellow;
     }

when the user click on Edit from the gridview i want to highlight the row and here is what i have done but no effect. what else i am missing?

.SelectedRowStyle
{
    background-color: Yellow;
}

<asp:GridView runat="server" CssClass="DataWebControlStyle">
   <AlternatingRowStyle CssClass="AlternatingRowStyle" />
   <RowStyle CssClass="RowStyle" />
   <HeaderStyle CssClass="HeaderStyle" />
   <SelectedRowStyle CssClass="SelectedRowStyle" />
</asp:GridView>

解决方案

here is how i able to fix:

if ((e.Row.RowType == DataControlRowType.DataRow & ((e.Row.RowState & DataControlRowState.Edit) == DataControlRowState.Edit))) {   
         e.Row.BackColor = Drawing.Color.Yellow;   
     }  

这篇关于突出显示所选行的GridView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆