Sign in to follow this  
Instigator

[web] Using the Repeater Control, ASP.Net

Recommended Posts

I'm trying to create a rather professional look on my Repeater control and I'm having a hard time with that. My design looks terrible.. most importantly, I'm trying to underline the text and make it so that the highlighting of the entry is done only on the word itself and not the entire line. Moreover, "underlining the word is also important. At the moment I'm using the command below to highlight the entries (WHICH LOOKS TERRIBLE) .. this method below is called each time a line in the repeater is rendered onto the screen.
protected void membersDataItems_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {     
     Panel panel = (Panel)e.Item.FindControl("pnlRow");   
 //Removed the code here to check if current line needs to be highlighted  
 panel.BackColor = System.Drawing.Color.Yellow; // this is the code to highlight current line.. BUT HIGHLIGHTS ENTIRE LINE :( (EVEN BLANK SPACE)


EDIT::: I was thinking... Is there a way to access the text inside the panel? This line "Panel panel = (Panel)e.Item.FindControl("pnlRow"); " .. returns the panel.. so maybe there's a way to return the text associated with the panel?? This would allow me to make it a lot nicer and probably allow me to highlight -> "ONLY THE TEXT" and not the entire line. full code Any help on what I should change to make this a little nicer would be great! - Eric [Edited by - Instigator on July 27, 2008 7:10:47 PM]

Share this post


Link to post
Share on other sites
best way is to create your own control, that way you can modify whatever you like. I hate using the controls (other than the validation controls) in Visual Studio - hate not being able to change every detail.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this