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

Always show textbox border

10 Answers 344 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 22 Feb 2011, 10:03 PM
I can't seem to find an answer to this. I have a "Notes" field in a textbox. I want to always show the border around the textbox even if the field is null or empty string. How do I do this? Right now if the there is data in the field the border is displayed. If null or empty, no border.

Thanks.

10 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 23 Feb 2011, 10:34 AM
Hi Tim,

We have not been able to reproduce this on our end and I have attached a sample report that uses the AdventureWorks database. On the left side there is an empty textbox with applied solid border, on the right side there is a textbox bound to the Color field from the Production.Product table which allows nulls. As you can see, the border is respected in both cases.

Greetings,
Steve
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
alin
Top achievements
Rank 1
answered on 10 Aug 2011, 08:19 AM
Hi,
I have the same problems with null values in preview. When print or export in pdf the border is visible. I attached the screenshot.
0
Steve
Telerik team
answered on 10 Aug 2011, 09:30 AM
Hi Alin,

This is a known problem that slipped with the latest changes we made to the HTML rendering. For the time being you can workaround this by creating an user function to add   character whenever a textbox does not have a value e.g. value.Replace(" ", "\u00A0").

Kind regards,
Steve
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
alin
Top achievements
Rank 1
answered on 10 Aug 2011, 10:51 AM
Public Shared Function isnull(ByVal fld As String)
       Dim s As String = ""
       If fld Is Nothing Or fld = "" Then
           s = " "
       Else
           If fld.Trim = "" Then
                   s = " " 

 

 

           Else

             s = fld
           End If
       End If
       Return s
   End Function

Now is good in preview but not in PDF export and printing, it's printing nbsp; Have any other solution?
0
alin
Top achievements
Rank 1
answered on 10 Aug 2011, 12:10 PM
Public Shared Function isnull(ByVal fld As String)
       Dim s As String = ""
       If fld Is Nothing Or fld = "" Then
           s = " "
       Else
           If fld.Trim = "" Then
                   s = " " 

            Else

             s = fld
           End If
       End If
       Return s
   End Function

Now is good in preview but not in PDF export and printing, it's printing nbsp;
Have any other solution?
0
Steve
Telerik team
answered on 10 Aug 2011, 12:14 PM
Hello Alin,

You can use System.Web.HttpContext.Current.Request.QueryString("ExportFormat") and apply the suggested change only when ExportFormat is HTML.

Kind regards,
Steve
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
alin
Top achievements
Rank 1
answered on 10 Aug 2011, 12:24 PM
Hello Steve,

I have changed the function:
         Dim s As String = ""
       If fld Is Nothing Or fld = "" Then
           s = " "
       Else
           If fld.Trim = "" Then
               s = " "
           Else
               s = fld
           End If
       End If
       If System.Web.HttpContext.Current.Request.QueryString("ExportFormat") Is Nothing Then
          ' preview
           Return s
       Else
           Return fld
       End If

In preview and in PDF file is ok, but when printing (from Telerik Report Print button)
the   is printed
0
alin
Top achievements
Rank 1
answered on 10 Aug 2011, 12:54 PM

 

I solved the problem, here is the code I used:

Public Shared Function isnull(ByVal fld As String)
       Dim s As String = ""
       If fld Is Nothing Or fld = "" Then
           s = " "
       Else
           If fld.Trim = "" Then
               s = " "
           Else
               s = fld
           End If
       End If
       If System.Web.HttpContext.Current.Request.QueryString("Refresh") Is Nothing Then
           Return fld
       Else
           Return s
       End If
   End Function

0
Joel
Top achievements
Rank 2
answered on 27 Mar 2012, 03:14 PM
This seems to continue to slip through in releases as I just tried to go to Q1 2012.  Has there been another alternative developed to go back to prior functionality other than adding a function call to every box on a page (which is sometimes several hundred text boxes)?
0
Steve
Telerik team
answered on 27 Mar 2012, 03:40 PM
Hi Joel,

Borders are correctly shown in the latest release even when the value is null and you can verify that by reviewing our CrossTab demo report which has quite a few empty/null cells.

Greetings,
Steve
the Telerik team
NEW in Q1'12: Telerik Report Designer (Beta) for ad-hoc report creation. Download as part of Telerik Reporting Q1 2012. For questions and feedback, use the new Telerik Report Designer Forum.
Tags
General Discussions
Asked by
Tim
Top achievements
Rank 1
Answers by
Steve
Telerik team
alin
Top achievements
Rank 1
Joel
Top achievements
Rank 2
Share this question
or