lyntron4545
asked on
change GridView buttonfield styles
Hello-
I have a ASP 2.0 gridview that can have either a template button or a regular select button to make a selection. The problem that I have is my entire site is set under a particular style and I've changed all the other default asp buttons to match. It is annoying to me to see the default windows buttons when the rest of the site has a nice sleek look. Using an image button is not an option. If there are any ideas out there I would greatly appreciate it.
Thanks-
LT
I have a ASP 2.0 gridview that can have either a template button or a regular select button to make a selection. The problem that I have is my entire site is set under a particular style and I've changed all the other default asp buttons to match. It is annoying to me to see the default windows buttons when the rest of the site has a nice sleek look. Using an image button is not an option. If there are any ideas out there I would greatly appreciate it.
Thanks-
LT
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
srivatsavaye-
I've tried the code you gave me and I've inserted the code that I had a question on. The only problem that I have is the page still renders with the default button but once I roll over them they change to the corrrect style. What is happening????
Here is my code.
Protected Sub dgvPartPrice_PreRender(ByV al sender As Object, ByVal e As System.EventArgs) Handles dgvPartPrice.PreRender
Dim i As Integer
For i = 0 To dgvPartPrice.Rows.Count - 1
Dim btnPrice As Button = CType(dgvPartPrice.Rows(i) .Cells(1). Controls.I tem(0), Button)
'- Gradient background on the button -'
btnPrice.Style.Add("filter :", "progid:DXImageTransform.M icrosoft.G radient(gr adientType =0,startCo lorStr=#D0 D0D0,endCo lorStr=#ff ffff) progid:DXImageTransform.Mi crosoft.dr opshadow(O ffX=2, OffY=2, Color='gray', Positive='true')")
'- Rollover affects -'
btnPrice.Attributes.Add("O nMouseOver ", "this.style.cursor='hand'; this.style .border='I nset';styl e.borderWi dth='2'")
btnPrice.Attributes.Add("O nMouseOut" , "this.style.cursor='defaul t';this.st yle.border ='Solid'; style.borderWidth='1'")
Next
End Sub
I've tried the code you gave me and I've inserted the code that I had a question on. The only problem that I have is the page still renders with the default button but once I roll over them they change to the corrrect style. What is happening????
Here is my code.
Protected Sub dgvPartPrice_PreRender(ByV
Dim i As Integer
For i = 0 To dgvPartPrice.Rows.Count - 1
Dim btnPrice As Button = CType(dgvPartPrice.Rows(i)
'- Gradient background on the button -'
btnPrice.Style.Add("filter
'- Rollover affects -'
btnPrice.Attributes.Add("O
btnPrice.Attributes.Add("O
Next
End Sub
ASKER
Thanks for the quick response. If I wanted to add the following to my code where would I do that at?
btnPrice.style="filter:pro
progid:DXImageTransform.Mi
btnPrice.Attributes.Add("O
btnPrice.Attributes.Add("O
Thanks again-
LT