Solved

need onrowdatabound/ondatabound string parsing

Posted on 2007-03-27
3
540 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

807 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