GridViewDataHyperLinkColumn PropertiesHyperLinkEdit.ImageHeight doesn't work as well as ImageWidth.
Here is my code:
private void GenerateColumns(ASPxGridView gridView)
{
var dt = gridView.DataSource as DataTable;
if (dt == null)
return;
foreach (DataColumn c in dt.Columns)
{
GridViewColumn col;
if(c.ColumnName == "Img")
{
col = new GridViewDataHyperLinkColumn
{
Name = c.ColumnName,
FieldName = c.ColumnName,
Visible = true
};
var cc = (GridViewDataHyperLinkColumn)col;
cc.PropertiesHyperLinkEdit.ImageUrlField = c.ColumnName;
cc.PropertiesHyperLinkEdit.ImageHeight = Unit.Pixel(50);
cc.PropertiesHyperLinkEdit.ImageWidth = Unit.Pixel(50);
}
else
{
col = new GridViewDataColumn
{
Name = c.ColumnName,
FieldName = c.ColumnName,
Visible = true
};
}
gridView.Columns.Add(col);
}
}
and aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="testPage2.aspx.cs" Inherits="Enterprise.testPage2" MasterPageFile="~/Default.Master" %>
<%@ MasterType TypeName="Enterprise.DefaultMaster" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v9.3, Version=9.3.2.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dxwgv" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v9.3, Version=9.3.2.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<%@ Register Assembly="DevExpress.Web.v9.3, Version=9.3.2.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxClasses" tagprefix="dxw" %>
<%@ Register Assembly="DevExpress.Web.v9.3, Version=9.3.2.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPopupControl" tagprefix="dxpc" %>
<asp:Content ID="Content" ContentPlaceHolderID="ContentPane" runat="server">
<dxwgv:ASPxGridView ID="_gridView" runat="server">
</dxwgv:ASPxGridView>
</asp:Content>
Steps to Reproduce:
Just try to create an image in a grid with GridViewDataHyperLinkColumn and put an image there; then try to change its size by setting those Width and Height properties.
Actual Results:
Image in a hyperlink doesn't change its size, moreover, if you check the page with Firebug, f.e., you will see that <img> tag doesn't have width and height style properties
Expected Results:
http://www.devexpress.com/Help/?document=ASPxEditors/DevExpressWebASPxEditorsImageEditPropertiesBase_ImageWidthtopic.htm&levelup=true
If the image's height and width are not specified, the image is displayed in its original size. Use the ImageWidth property to override the initial width of the displayed image. If the image's width is specified, the displayed image is stretched or shrunk as appropriate to match the specified width.