Hi John,
For the character formatting, are you using the default "BoundField"? If
so, gridview's boundfield will perform html encoding on boundfield
content(when set via databinding) so as to avoid some potential malicious
injected script code:
#BoundField.HtmlEncode Property
http://msdn2.microsoft.com/en-us/lib...rols.boundfiel
d.htmlencode.aspx
You can try turn it off if you're sure the characters in the content is
safe and non characters in it will bread page's html source(e.g it doesn't
contain chars like '<', '>'....).
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: "john" <>
>References: <u#>
<. com>
>Subject: Re: Griview cells Text Special Characters
>Date: Sat, 13 Oct 2007 18:27:01 -0400
>
>Actually I am pulling the cell contents into a formview from the already
>selected record, but I think considering the few special Characters I
would
>to just do replace on the cell data than have to pull from the datasource
>all over again.
>
>I was hoping there was a simple way to convert or cast it from its
constant.
>
>Thanks for your reply.
>
>"Phil H" <> wrote in message
>news: oups.com...
>> John
>>
>> I take it that the code is in response to the "selected-index_changed"
>> event (Y/N?)
>>
>> If so then you need to retrieve the data from the original data source
>> rather than the content of grid cells. The easiest way is to obtain
>> the record's primary key value and query the source programatically.
>>
>> On 12 Oct, 10:38, "john" <n...@none.com> wrote:
>>> When I get a Gridview Cell contents that has a Special Character in its
>>> data
>>> such as an & or " it returns it constant & or " instead of the
>>> actual Character.
>>>
>>> Any way to modify this code to get the actual Character as it is
>>> displayed
>>> in the cell?
>>>
>>> Sample cell actual text: A & C Hauling
>>>
>>> dim ven as String
>>>
>>> ven = me.Gridview1.SelectedRow.Cells(2).Text
>>>
>>> Result to ven variable is A & Hauling
>>>
>>> Thanks
>>>
>>> John
>>
>>
>
>
>