It's been a while and I'm facing a tough challenge. I need to change the image source of an ASPxButton from the code behind, but it seems like the height, width, and border style are getting lost in the process (resulting in an image with its own size and a thick black border).
<dx:GridViewDataTextColumn FieldName="SyncStatus" VisibleIndex="0" Caption=" " Width="22px">
<DataItemTemplate>
<dx:ASPxButton runat="server" Image-Url="~/Images/Wizard/Wand24x24.png" Height="20px" Width="20px"
Border-BorderStyle="None" id="btnWiz" OnInit="btnWiz_Init"></dx:ASPxButton>
</DataItemTemplate>
</dx:GridViewDataTextColumn>
Protected Sub btnWiz_Init(sender As Object, e As EventArgs)
Dim btnWiz As ASPxButton = TryCast(sender, ASPxButton)
Dim container As GridViewDataItemTemplateContainer = TryCast(btnWiz.NamingContainer, GridViewDataItemTemplateContainer)
btnWiz.ImageUrl = "~/Images/NewNote.png"
btnWiz.Border.BorderStyle = BorderStyle.None
btnWiz.Border.BorderWidth = Unit.Pixel(0)
btnWiz.Height = Unit.Pixel(20)
btnWiz.Width = Unit.Pixel(20)
End Sub
I attempted a solution by adding the following:
.dxbButton
{
border-style: none;
height: 20px;
width: 20px;
}
However, upon inspecting the element, it appears that this solution is being ignored. Any advice would be greatly appreciated. Thank you in advance.