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

RadTextBox empty string databind

3 Answers 68 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jorge
Top achievements
Rank 1
Jorge asked on 28 May 2010, 06:37 PM
I need a RadTextBox to bind an empty to dbnull (or null).
Is there any property available?

Thanks!

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 28 May 2010, 07:22 PM
Hello Jorge,

Please examine the following link:
Using RadInput Controls Inside Data-Bound Controls

Regards,
Daniel
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Jorge
Top achievements
Rank 1
answered on 29 May 2010, 04:13 PM
I guess me message wasn't clear enough:

if myRadTextBox contains no text ("") then save to database (bind) as DBNULL, instead of "".
0
Daniel
Telerik team
answered on 03 Jun 2010, 04:01 PM
Hello Jorge,

To avoid this behavior, you should set ConvertEmptyStringToNull to false.

<telerik:GridTemplateColumn DataField="Description" HeaderText="Description" SortExpression="Description"
    ConvertEmptyStringToNull="false" UniqueName="Description">
    <ItemTemplate>
        <asp:Label ID="Label1" runat="server" Text='<%# Eval("Description") %>' />
    </ItemTemplate>
    <EditItemTemplate>
        <telerik:RadTextBox ID="RadTextBox1" runat="server" Text='<%# Bind("Description") %>' />
    </EditItemTemplate>
</telerik:GridTemplateColumn>

Regards,
Daniel
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
General Discussions
Asked by
Jorge
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Jorge
Top achievements
Rank 1
Share this question
or