用CSS设计GridView [英] Designing GridView with CSS

查看:88
本文介绍了用CSS设计GridView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友,
朋友,我正在尝试使用母版页,在default.aspx中有gridview.我已将CSS应用于网格,问题是在运行时网格不可见.

以下是.aspx代码

Hello Friends,
Friends I was trying Master pages, in default.aspx there is gridview. I have applied CSS to grid, problem is at run time the grid is not visible.

Following is the .aspx code

<%@ Page Title="" Language="C#" MasterPageFile="~/Pages/SriSamarth.master" AutoEventWireup="true" CodeFile="frmClient.aspx.cs" Inherits="Pages_Default2" %>


<asp:Content ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <link href="../CSS/gridStyle.css" rel="stylesheet" type="text/css" />
<div id="divContent">
<span style="height:10px;"></span>
    <asp:GridView runat="server" ID="gvclient" AutoGenerateColumns="false" AllowPaging="true"
    CssClass="mGrid"  PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt">
        <columns>
            <asp:BoundField DataField="clientname" HeaderText="Client"/>
            <asp:BoundField DataField="contactno" HeaderText="Contact" />
        </columns>
        
    </div>



谁能告诉我我要去哪里错了?

在此先感谢



Can anyone tell where I''m going wrong?

Thanks in advance

推荐答案

我怀疑它与CSS有关.如果CSS有任何问题,则会应用并使用默认样式.

现在,如果您说网格不可见,请确保与网格绑定的数据表至少有一行.如果数据表为空(零行),则网格根本不会出现.
I doubt it is related to CSS. If there is any issue with CSS, default style would be applied and used.

Now, if you say grid is not visible, please make sure that the datatable that you bind with the grid has atleast one row. If the datatable is empty (zero rows), then the grid would not appear at all.


检查您的Gridview绑定代码,是否检索任何行.如果Gridview中没有行.则网格将不会显示在页面上.
Check your Gridview binding code, Its retrive any row or not. If no row in Gridview. then Grid not show on page.


这篇关于用CSS设计GridView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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