线不会出现在网格中的行下方 [英] Line doesn't appear below the row in a grid

查看:81
本文介绍了线不会出现在网格中的行下方的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在网格的每一行下面显示一行。但它似乎没有出现我使用css class =table并将网格放入表格中并使用正确的tr和td。做什么,以便每一行分开。



我尝试过:



< asp:GridView runat =serverID =GridstoremanagerAutoGenerateColumns =falseGridLines =NoneAllowPaging =trueOnPageIndexChanging =Gridstoremanager_PageIndexChangingPageSize =10CssClass =table宽度=100%EmptyDataText =未找到商店经理!!! OnRowDataBound =Gridstore_RowDataBound>

< columns> < asp:TemplateField HeaderText =Sr.No。>

< itemtemplate>

<%#Container.DataItemIndex + 1%>





< asp:BoundField DataField =NameHeaderText =经理名称/>

< asp:BoundField DataField =EmailIdHeaderText =EmailId/>

< asp:BoundField DataField =StoreNameHeaderText =商店名称/>

< asp:BoundField DataField =MobileNoHeaderText =Mobile No. />

< asp:BoundField DataField =EmpStatusHeaderText =Status/>

< asp:TemplateField ItemStyle-Horizo​​ntalAlign =RightHeaderText =查看>

< itemtemplate>

< asp:ImageButton ID =ImageBtnEditImageUrl =〜/ Icons / btn-edit.pngCommandArgument ='<%#Eval(EmpId)%>'runat =serverToolTip =点击此处编辑管理器OnClick =ImageBtnEdit_Click/>

< asp: ImageButton ID =ImagebtnactCommandArgument ='<%#Eval(EmpId)%>'runat =serverOnClick =Imagebtnact_Click/>

< asp:ImageButton ID =ImageBtndelImageUrl =〜/ Icons / delete-icon.pngToolTip =点击此处删除管理器CommandArgument ='<%#Eval(EmpId)%>'runat =serverOnClie ntClick =return fnConfirm(); OnClick =ImageBtndel_Click/>





< pagerstyle cssclass =pagination-ys>


i want to show line below every row of grid. but it doesn't appear i used css class="table" and put grid inside table with proper tr and td. what to do so that every row separated by line.

What I have tried:

<asp:GridView runat="server" ID="Gridstoremanager" AutoGenerateColumns="false" GridLines="None" AllowPaging="true" OnPageIndexChanging="Gridstoremanager_PageIndexChanging" PageSize="10" CssClass="table" Width="100%" EmptyDataText="Store Manager Not Found!!!" OnRowDataBound="Gridstore_RowDataBound">
<columns> <asp:TemplateField HeaderText="Sr. No.">
<itemtemplate>
<%#Container.DataItemIndex+1 %>


<asp:BoundField DataField="Name" HeaderText="Manager Name" />
<asp:BoundField DataField="EmailId" HeaderText="EmailId" />
<asp:BoundField DataField="StoreName" HeaderText="Store Name" />
<asp:BoundField DataField="MobileNo" HeaderText="Mobile No." />
<asp:BoundField DataField="EmpStatus" HeaderText="Status" />
<asp:TemplateField ItemStyle-HorizontalAlign="Right" HeaderText="View">
<itemtemplate>
<asp:ImageButton ID="ImageBtnEdit" ImageUrl="~/Icons/btn-edit.png" CommandArgument='<%#Eval("EmpId") %>' runat="server" ToolTip="Click here to Edit Manager" OnClick="ImageBtnEdit_Click" />
<asp:ImageButton ID="Imagebtnact" CommandArgument='<%#Eval("EmpId")%>' runat="server" OnClick="Imagebtnact_Click" />
<asp:ImageButton ID="ImageBtndel" ImageUrl="~/Icons/delete-icon.png" ToolTip="Click here to Delete Manager" CommandArgument='<%#Eval("EmpId") %>' runat="server" OnClientClick="return fnConfirm();" OnClick="ImageBtndel_Click" />


<pagerstyle cssclass="pagination-ys">

推荐答案

更改 GridLines [ ^ ]属性为水平两者



change the GridLines[^] Property to Horizontal or Both

GridLines="Horizontal"







< asp:gridview runat =serverid =Gridstoremanagerautogeneratecolumns =false GridLines =无 AllowPaging =trueOnPageIndexChanging =Gridstoremanager_PageIndexChanging PageSize =10CssClass =tableWidth =100%EmptyDataText =找不到商店经理!!! OnRowDataBound =Gridstore_RowDataBound>





为gridview创建行创建事件并将其更新为






<asp:gridview runat="server" id="Gridstoremanager" autogeneratecolumns="false" GridLines="None" AllowPaging="true" OnPageIndexChanging="Gridstoremanager_PageIndexChanging" PageSize="10" CssClass="table" Width="100%" EmptyDataText="Store Manager Not Found!!!" OnRowDataBound="Gridstore_RowDataBound">


Create Row Created Event for the gridview and update it as

protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
       {
           if (e.Row.RowType == DataControlRowType.DataRow)
           {
               for (int i = 0; i < e.Row.Cells.Count; i++)
               {
                   e.Row.Cells[i].Style.Add("border-bottom", "3px solid red");
               }

           }
       }


这篇关于线不会出现在网格中的行下方的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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