Always show textbox border

11 posts, 0 answers
  1. Tim
    Tim avatar
    39 posts
    Member since:
    Oct 2010

    Posted 22 Feb 2011 Link to this post

    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.
  2. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 23 Feb 2011 Link to this post

    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!
  3. DevCraft banner
  4. alin
    alin avatar
    6 posts
    Member since:
    Jul 2011

    Posted 10 Aug 2011 Link to this post

    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.
  5. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 10 Aug 2011 Link to this post

    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 >>

  6. alin
    alin avatar
    6 posts
    Member since:
    Jul 2011

    Posted 10 Aug 2011 Link to this post

    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?
  7. alin
    alin avatar
    6 posts
    Member since:
    Jul 2011

    Posted 10 Aug 2011 Link to this post

    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?
  8. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 10 Aug 2011 Link to this post

    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 >>

  9. alin
    alin avatar
    6 posts
    Member since:
    Jul 2011

    Posted 10 Aug 2011 Link to this post

    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
  10. alin
    alin avatar
    6 posts
    Member since:
    Jul 2011

    Posted 10 Aug 2011 Link to this post

     

    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

  11. Joel
    Joel avatar
    166 posts
    Member since:
    Oct 2006

    Posted 27 Mar 2012 Link to this post

    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)?
  12. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 27 Mar 2012 Link to this post

    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.
Back to Top
DevCraft banner