|
-
May 8th, 2003, 12:32 PM
#1
Thread Starter
Member
Editing display data in databound listbox ... - RESOLVED
Hello,
I have a databound list box that I created in design time. The info it displays uses HTML codes for apostrophies etc. I simply want to do a replace on the data - replace ' with single quotes - only on whats displayed - not the actual data.
Any ideas on how I can accomplish this??
Thanks,
Rich
Last edited by Richdef; May 8th, 2003 at 03:23 PM.
Rich J Defilippo
-
May 8th, 2003, 01:59 PM
#2
Lively Member
You mean like this?
Code:
Dim ds2 As SqlDataReader
ds2 = dsLogin2.ExecuteReader()
Dim ddlist as new DropDownList
Dim le As New ListItem
Do While ds.read()
With le
.Text = replace(ds("xfield").tostring(),"searchFor","replacewith")
.value=ds("xfield").tostring()
End With
ddlist.Items.Add(le)
loop
ds2.Close()
myConnection2.Close()
"Find all you need in your mind if you take the time" -DT
-
May 8th, 2003, 02:47 PM
#3
Thread Starter
Member
I'm trying to translate your VB code to C#.
I thought I would try to do this is C# arrrghhh - should have stayed with VB!!
Any idea how this would work in C#??
-
May 8th, 2003, 03:22 PM
#4
Thread Starter
Member
C# -- Replace text in Databound list box created in design time - RESOLVED
This worked!!:
Code:
foreach (ListItem Le in lstbxAvailProds.Items)
Le.Text = Le.Text.Replace("'","'");
-Rich
-
May 8th, 2003, 03:23 PM
#5
Thread Starter
Member
Thanks CinOs3,
Your suggestion put me on the right track!!
-Rich
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|