Is there a way to specify the size of the textboxes for the AutoGenerated Edit in the aspx page?
I have set MaxLength and also tried ItemStyle Width=100px but they do not affect the textbox width.
Or can this only be done with use FormTemplate?
I have set MaxLength and also tried ItemStyle Width=100px but they do not affect the textbox width.
Or can this only be done with use FormTemplate?
6 Answers, 1 is accepted
0
Shinu
Top achievements
Rank 2
answered on 09 Apr 2009, 05:12 AM
Hi Lenny,
I would suggest you to use Column Editors to style the autogenerated edit form. Go through the following help article to get more details about the Grid column editors.
Declarative style editors
Shinu
I would suggest you to use Column Editors to style the autogenerated edit form. Go through the following help article to get more details about the Grid column editors.
Declarative style editors
Shinu
0
Lenny_shp
Top achievements
Rank 2
answered on 09 Apr 2009, 05:24 PM
GridTextBoxColumnEditor cannot be multi-line, correct?
I could not get GridHTMLEditorColumnEditor to display in the edit form.
<telerik:GridHTMLEditorColumnEditor ID="TextEditorUsage" runat="server">
<Editor runat="server" AutoResizeHeight="true" EditModes="All" Width="300px" Height="300px"></Editor>
</telerik:GridHTMLEditorColumnEditor>
I could not get GridHTMLEditorColumnEditor to display in the edit form.
<telerik:GridHTMLEditorColumnEditor ID="TextEditorUsage" runat="server">
<Editor runat="server" AutoResizeHeight="true" EditModes="All" Width="300px" Height="300px"></Editor>
</telerik:GridHTMLEditorColumnEditor>
0
Hi Lenny,
Unfortunately you are right and the settings defined with the GridHTMLEditorColumnEditor are not applied. Our developers are aware of this issue and will hopefully address it soon.
In the mean time I can suggest you to try the following code which show how you can modify the textbox of a GridBoundColumn which shows in EditMode.
As a small token of gratitude for your feedback I have updated your Telerik points.
Sincerely yours,
Pavel
the Telerik team
Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Unfortunately you are right and the settings defined with the GridHTMLEditorColumnEditor are not applied. Our developers are aware of this issue and will hopefully address it soon.
In the mean time I can suggest you to try the following code which show how you can modify the textbox of a GridBoundColumn which shows in EditMode.
| protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) |
| { |
| if (e.Item is GridEditFormItem && e.Item.IsInEditMode) |
| { |
| GridEditableItem form = (GridEditableItem)e.Item; |
| TextBox tbx1 = (TextBox)form["ProductName"].Controls[0]; ; |
| tbx1.TextMode = TextBoxMode.MultiLine; |
| tbx1.Width = Unit.Pixel(300); |
| tbx1.Height = Unit.Pixel(300); |
| } |
| } |
As a small token of gratitude for your feedback I have updated your Telerik points.
Sincerely yours,
Pavel
the Telerik team
Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Lenny_shp
Top achievements
Rank 2
answered on 13 Apr 2009, 01:34 PM
Thanks, that made it a multi-line textbox. Is there additional script to enforce the maxlength property because now it allows infinite number of characters to be entered.
0
Accepted
Hi Lenny,
The MaxLength property does not work since the asp TextBox does not support it in Multiline mode. One solution is to use a TemplateColumn and add to it a RadTextBox similar to the following:
I hope this helps.
Best wishes,
Pavel
the Telerik team
Check out Telerik Trainer , the state of the art learning tool for Telerik products.
The MaxLength property does not work since the asp TextBox does not support it in Multiline mode. One solution is to use a TemplateColumn and add to it a RadTextBox similar to the following:
| <Columns> |
| <telerik:GridTemplateColumn HeaderText="ProductName" SortExpression="ProductName" |
| UniqueName="ProductNameTempplate"> |
| <ItemTemplate> |
| <asp:Label ID="Label1" runat="server" Text='<%# Bind( "ProductName" ) %>'></asp:Label> |
| </ItemTemplate> |
| <EditItemTemplate> |
| <telerik:RadTextBox ID="ProductName" runat="server" MaxLength="10" TextMode="MultiLine" Text='<%# Bind( "ProductName" ) %>'></telerik:RadTextBox> |
| </EditItemTemplate> |
| </telerik:GridTemplateColumn> |
| </Columns> |
I hope this helps.
Best wishes,
Pavel
the Telerik team
Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Lenny_shp
Top achievements
Rank 2
answered on 15 Apr 2009, 05:39 PM
scratch this