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

RadMaskedTextBox / MaxLenght when Bind()

1 Answer 49 Views
Input
This is a migrated thread and some comments may be shown as answers.
Alexandre Lepage
Top achievements
Rank 1
Alexandre Lepage asked on 06 Jan 2009, 09:17 PM
Good afternoon :-)

RadTextBox

Is it possible to set the "MaxLength" to the size of SQL 2005 DB field "automagicly" :-)
(RadTextBox, RadMaskedTextBox, RadNumericTextBox...)

Ex.:
CREATE TABLE [dbo].[Locale](
    [idLocale] [nchar](10) NOT NULL,
    [Description] [nvarchar](50) NULL,
 CONSTRAINT [PK_Locale] PRIMARY KEY CLUSTERED

                        <telerik:RadTextBox ID="Description" Text='<%# Bind("Description") %>' Runat="server" Skin="WebBlue" 
                            Width="200px"  ReadOnly="true" MaxLength="50"
                        </telerik:RadTextBox> 
 

I'd like to remove the MaxLength="50" properties or that we don't need to explicitly define it.

Thanks!


1 Answer, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 09 Jan 2009, 04:20 PM
Hi Alexandre,

Unfortunately I do not think that setting the MaxLength for one of our RadInput controls automatically when binding it to a source column with a specified length is possible. You will need to specify the length either declaratively or programmatically in code.

If you find a way to do that for standard MS TextBox control, I suppose it will be applicable for each of our RadInputs as well.

By the way, I found this resource which elaborates how this can be done in Silverlight.

Kind regards,
Sebastian
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Input
Asked by
Alexandre Lepage
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Share this question
or