Results 1 to 4 of 4

Thread: [RESOLVED] [2005] FormView Control Format

  1. #1

    Thread Starter
    Frenzied Member circuits2's Avatar
    Join Date
    Sep 2006
    Location
    Kansas City, MO
    Posts
    1,027

    Resolved [RESOLVED] [2005] FormView Control Format

    I have a FormView with several DataBound labels. I need to change the ForeColor of one of the labels depending on it's value but can't seem to find a way of accessing it's properties since it is in a template. In tried using FindControl but didn't have any luck. Can someone suggest an alternate way of doing this? I have enough flexibility that I don't have to use a FormView if there is another way of binding the label (I am using an ObjectDataSource).

    Thanks!!
    Show the love! Click (rate this post) under my name if I was helpful.

    My CodeBank Submissions: How to create a User Control | Move a form between Multiple Monitors (Screens) | Remove the MDI Client Border | Using Report Viewer with Visual Studio 2012 Express

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [2005] FormView Control Format

    You'd do this in the FormView's DataBound event. You can do a findcontrol in there, get your control, set its properties.

  3. #3

    Thread Starter
    Frenzied Member circuits2's Avatar
    Join Date
    Sep 2006
    Location
    Kansas City, MO
    Posts
    1,027

    Re: [2005] FormView Control Format

    I tried using FindControl before in a hasty attempt and didn't have any luck. However, now that you suggested using it, I tried again and realized I forgot to put the Id of the control in quotes. Thanks mendhak!
    Show the love! Click (rate this post) under my name if I was helpful.

    My CodeBank Submissions: How to create a User Control | Move a form between Multiple Monitors (Screens) | Remove the MDI Client Border | Using Report Viewer with Visual Studio 2012 Express

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [2005] FormView Control Format

    No prob, add resolved if that answered your question, ask again if it didn't.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width