【问题标题】:Set RadGrid rows height smaller than default value?将 RadGrid 行高设置为小于默认值?
【发布时间】:2016-10-27 14:36:33
【问题描述】:

我试图使每一行的高度尽可能小,以Telerik post 为例。问题是,如果我将高度设置为大于默认值(在本例中为 150 像素),它可以正常工作。如果它在下面,那么它不起作用。

我还查看了以下Telerik link,这(我相信)与我在这里所做的相同(将CssClass 设置为ItemStyleAlternatingItemStyle)但这对他有用。

此外,此 radgrid 位于 masterpage 上,但这应该没什么区别。

这是我的 radgrid 标记:

<telerik:RadGrid ID="RadGridSets" runat="server" Width="100%" BorderColor="Silver" 
BorderStyle="Solid" BorderWidth="1px" onprerender="PreRender" >
<MasterTableView AutoGenerateColumns="False" CommandItemDisplay="Top" Font-Size="7" 
AllowAutomaticUpdates="true" >
    <ItemStyle CssClass="item-style" />
    <AlternatingItemStyle CssClass="item-style" />
    <CommandItemSettings ShowAddNewRecordButton="false" ShowRefreshButton="false" />
        <Columns>
        <telerik:GridBoundColumn datafield="carrier" headertext="sugbgroup"/>                        
        <telerik:GridBoundColumn datafield="count" headertext="count"/>                        
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

CSS:

<style type="text/css">
    .header, .cell
    {
        display:table-cell; 
        vertical-align:top; 
        padding-left:10px; padding-right: 10px; 
        font-size: 9pt;
        border: none;
        padding-top: 4px;
    }
    .even
    {
        background-color: #b2d3ec;
    }
    .odd
    {
        background-color: #d8e9f3;
    }
    .cell
    {
        padding-bottom: 5px;
        border-bottom: 1px;
    }
    html .RadMenu .rmRootGroup {
        background-image: none;
    }

</style>
<style type="text/css">
    .RadGrid .item-style td
    {
        padding-top: 0;
        padding-bottom: 0;
        height: 10px;
        vertical-align: middle;
    }
</style>

【问题讨论】:

    标签: c# asp.net telerik asp.net-4.0 radgrid


    【解决方案1】:

    由于没有人回复,我最终使用了GridView 控件。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-11-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-10-20
      • 1970-01-01
      相关资源
      最近更新 更多