Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
325
Button Appearance
posted

I am wanting to change my WinGrid cell button appearance depending on a value I have flagged (a boolean flag coming from the stored procedure).

 I have been successful in changing the appearance, a little, at least enough to know that it can be changed some.  I just want to make the button appearance change more drastic.

 In the Win Grid Initialize Row procedure I have the following code... 

If e.Row.Cells("Notes_Flag").Value = True Then

e.Row.Cells("Notes").ButtonAppearance.ForeColor = Color.Black

e.Row.Cells("Notes").ButtonAppearance.ThemedElementAlpha = Alpha.Transparent

e.Row.Cells("Notes").ButtonAppearance.Image = "~/Images/Notes.jpg"

Else

e.Row.Cells("Notes").ButtonAppearance.ForeColor = Color.Beige

End If

 

So now my button will change to the display text of black, and the button looks like a plain jane Windows button, if the flag = True.  If the flag = False, the button will change the text to the color of Beige (not visible) and the button looks like a XP button.  So I can tell quickly which records has the Notes_Flag checked and which ones do not.

Now I am wanting to spruce this up. 

 I would like to do the following...

The button's value is based on an ID, and this ID is needed to be passed to a stored procedure.  But I would like to either change the text of the button to read "Notes" (instead of displaying the ID value) OR insert an image (which ever is easier).  My code above to insert the image is ignored and I am not certain why.

Is this possible, or must the Button display the value of the cell it is connected to (unbound column)?

 Thank you,

T.J.

Parents Reply Children