1

我有一个使用文本框和 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);
4

1 回答 1

1

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

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

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

.RadGrid .RadInput{
width:100% !important; 
}
于 2013-10-31T19:04:21.053 回答