css - Telerik 样式数字文本框

标签 css telerik styles radgrid

我有一个使用文本框和 RadNumericTextBoxes 的 radgrid。我可以像这样设置常规文本框的样式:

        boundColumn = new GridBoundColumn();
        boundColumn.DataField = "Size";
        boundColumn.HeaderText = "Size";
        boundColumn.ItemStyle.Width = Unit.Pixel(5);
        boundColumn.ItemStyle.CssClass = "maximize";
        grid.MasterTableView.Columns.Add(boundColumn);


.maximize input[type=text] { 
    width:100%; 
}

但如果尝试在 RadNumericTextBox 上使用相同的样式,则它不起作用。我希望能够为 RadNumericTextBox 设置相同的样式。有谁知道如何做到这一点?

        GridNumericColumn nboundColumn = new GridNumericColumn();
        nboundColumn.DataField = "Quantity";
        nboundColumn.HeaderText = "Quantity";
        nboundColumn.ItemStyle.Width = Unit.Pixel(5);
        nboundColumn.ItemStyle.CssClass = "maximize";
        grid.MasterTableView.Columns.Add(nboundColumn);

最佳答案

radNumericTextbox 具有内置样式,您不会以正常方式将样式覆盖到它们, 所以要先将样式添加到 radgrid 中,然后使用:

.yourClass input[type=text] { 
    width:100% !important; 
}

您也可以使用 firebug 或 inspector 找到原始的 radgrid 数字类,然后用 !important 覆盖样式,如下所示:

.RadGrid .RadInput{
width:100% !important; 
}

关于css - Telerik 样式数字文本框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19714139/

相关文章:

javascript - 使用单选框选择显示多个DIV

IE8 中的 CSS Div 问题 - 我无法解释的巨大差距

javascript - 如何正确设计数据表?

javascript - Kendo UI - 将网格导出为没有页面 block 的 PDF

html - CSS 像素/计算机类字体 - 例如 Courier New

CSS 下拉菜单删除边框

wpf - 正确单击数据网格中的按钮时,Telerik RadGridView 选定项绑定(bind)不起作用

javascript - Telerik TreeView OnExpand 或类似的

php - JQUERY ToolTip - 特定词的样式

android - 如何使用默认通知样式?