Solved

need onrowdatabound/ondatabound string parsing

Posted on 2007-03-27
3
536 Views
Last Modified: 2012-05-05
i have a detailsview where I need a row modified ondatabound or on rowdatabound to remove the redundant names:

this is what it appears like on the screen:
employee names:    bob_smith
                                bob_smith
                                karen_jones

the employee_names field from the database comes in as a string with <br> tags in it:

bob_smith<br>bob_smith<br>karen_jones


I want to only have one instance of bob_smith. The data is quite complex so I'd rather attempt this on the detailsview inbound rather than play with the sql...
0
Comment
Question by:acdagirl
3 Comments
 
LVL 28

Expert Comment

by:mmarinov
ID: 18799260
Hello acdagirl,

Can't you use OnItemCreated event ?

Regards,
mmarinov
0
 

Author Comment

by:acdagirl
ID: 18799631
sure, I guess so... how though? I'm more familiar with the rowdatabound... (p.s. I'm using .net 2.0)
0
 
LVL 1

Accepted Solution

by:
fakir420 earned 500 total points
ID: 18800479
Add property

OnItemDataBound="ItemBound"

then is codebehind create the handler

protected void ItemBound(object sender, DataGridItemEventArgs e)
{
//code
}

This is for a datagrid, but I imagine a DetailsView is much the same.  Just use 'DetailsViewEventArgs' instead of 'DataGridEventArgs' for the type.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
This video discusses moving either the default database or any database to a new volume.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

743 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now