如何减少GridView的大小 [英] How to reduce the size of a gridview

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

问题描述

嗨 我在页面中使用了gridview,并且正在打印该gridview.但是在打印时,我无法打印完整的gridview.

Hi I am a using a gridview in my page and i am printing that gridview.But while i am printing it i was not able to print complete gridview.
how can i reduce the width of a gridview.

推荐答案

将其保存在HTML表中.根据需要固定表格的宽度(以像素为单位).
Have it inside an HTML table. fix the tables width in pixels as per you need.


固定表格的每一列的宽度(根据需要)


请参阅以下示例.

fix the width (as required )of each column of your gridview


see below example.

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False">
            <Columns>
                <asp:BoundField HeaderText="col1">
                    <ItemStyle Width="200px" />
                </asp:BoundField>
                <asp:BoundField HeaderText="col2">
                    <ItemStyle Width="50px" />
                </asp:BoundField>
            </Columns>
        </asp:GridView>


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

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