Solved

Converting data grid template control to DataBoundLiteralControl

Posted on 2006-11-30
2
313 Views
Last Modified: 2012-05-05
I'm trying to access the text in a data grid template control which I'm able to do however the results that are returned have 25 characters around it.  The characters are not spaces as the trim function does not remove them.  My code is:
Public Sub dgProgramManager_Edit(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dgProgramManager.EditCommand
        Dim temp As String = CType(e.Item.Cells(3).Controls(0), DataBoundLiteralControl).Text
        Dim temp2 As String = Len(temp)
        dgProgramManager.EditItemIndex = e.Item.ItemIndex
End Sub

When I debug it the temp variable has the following content:
"             name           "
and the length is 29

The result should be just "name".

Any suggestions would be greatly appreciate.

Les
0
Comment
Question by:leskelly
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 9

Accepted Solution

by:
kraffay earned 250 total points
ID: 18049050
I think they are encoded spaces that .NET puts in the literal in order to center it.  Try to determine the ASCII code of characters with ASC function, and see if you can strip that out.
0
 

Author Comment

by:leskelly
ID: 18094422
For anyone else who enconunter this the ASCII codes are 13, 10 and 9.
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question