Forum Moderators: open

Message Too Old, No Replies

Need help with changing over to .net

         

TheSeoGuy

5:50 pm on Apr 5, 2007 (gmt 0)

10+ Year Member



We currently have an application written in asp that allows a person to add news stories to their web site. The application admin screen lists all the news stories stored in the database. Depending on certain criteria, the news stories will display differently in the list.

For exmaple:
If the news story is in "rough draft" mode it displays in gray text.
If the news story is live on the web site, it displays in blue text with a globe icon.
If the news story is live on the web site & live in a feed, it displays in blue text with a globe icon and a news icon.

Also, each news story has a color change when the mouse is moved over it. The list "container" itself should be able to receive a height setting and then scroll if necessary.

I realize this is just one aspect of the application, but how can I go about duplicating this usibility and functionality in asp.net 2.0? Could I use the gridView? Would I need to extend the gridView? Should I create a custom Control?

Your thoughts and opinions would be greatly appreciated.

[edited by: jatar_k at 10:00 pm (utc) on April 5, 2007]
[edit reason] no urls thanks [/edit]

Ocean10000

8:13 pm on Apr 5, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



My own experiences with creating simple customized Lists, I normally just create a new specialized control for that list. This is normally because it takes me less time to do it this way, without resorting to hacks to work around quirks of the existing grid controls.

I am not saying its impossible to do what you want with the base grid control, just might have to put more work into it to make it do what you want. I usually rather put more work into area's that need it, then simple display lists.

TheNige

10:54 pm on Apr 5, 2007 (gmt 0)

10+ Year Member



I think this would be easy to do in the gridview. You would probably just need to override the "OnDataBind" event of the grid, which would allow you to easily set CSS styles for the row based on the status of the article.

You could also use template columns and set the CSS styles using public functions where you would pass in the data for that column to determine.

From your example, you are simply trying to change how the items look based on some of the data in the row.

Ossifer

10:20 am on Apr 8, 2007 (gmt 0)

10+ Year Member



I'd bind the datasource to the gridview, and then use a RowDataBound event to change the data appearance.

You could then apply a CssClass property on the row that is selected during the raising of this event.