Question

I have a radgrid that uses textboxes and RadNumericTextBoxes. I am able to style the regular text boxes like this:

        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%; 
}

But if try to use the same style on a RadNumericTextBox it doesn't work. I want to be able to style the same thing for a RadNumericTextBox. Does Anyone know how to do this?

        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);
Was it helpful?

Solution

radNumericTextbox has built-in style and you won't overwrite your style to them in normal way, so for add your style first addClass to your radgrid and then use:

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

also you can use firebug or inspector to find orginal radgrid numeric class and then overwrite the style with the !important like so:

.RadGrid .RadInput{
width:100% !important; 
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top