This is a migrated thread and some comments may be shown as answers.

GridDateTimeColumnEditor TextBoxStyle CssClass not applied

1 Answer 31 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 06 Dec 2012, 03:06 AM
Unlike a GridTextBoxColumnEditor (which works), the CssClass on the TextBoxStyle for the GridDateTimeColumnEditor doesn't work - the class isn't applied on the "input" box. Can anyone please confirm?

<telerik:GridDateTimeColumn PickerType="DatePicker" DataField="InstallationDate" FilterControlAltText="Filter Install Date" HeaderText="Install Date" SortExpression="InstallationDate" UniqueName="InstallationDate" ReadOnly="false" AllowFiltering="true" MaxLength="50" ColumnEditorID="gceSmallDateBox">
                                    </telerik:GridDateTimeColumn>


<telerik:GridDateTimeColumnEditor runat="server" ID="gceSmallDateBox">
                            <TextBoxStyle CssClass="smallTextBox" />
                        </telerik:GridDateTimeColumnEditor>

1 Answer, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 06 Dec 2012, 03:35 AM
Hello,

Try with below code snippet.

protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
   {
       if (e.Item is GridEditableItem && e.Item.IsInEditMode)
       {
           GridEditableItem item = e.Item as GridEditableItem;
           RadDatePicker rdp = item["InstallationDate"].Controls[0] as RadDatePicker;
           rdp.CssClass = "smallTextBox";
       }
   }

If above code is not worked then please add !important in your style property.
<style type="text/css">
        .smallTextBox
        {
            color: Red !important;
        }
    </style>


Thanks,
Jayesh Goyani
Tags
Grid
Asked by
Peter
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Share this question
or