ASPxRatingControl.ItemWidth Property
Gets or sets an item’s width.
Namespace: DevExpress.Web
Assembly:
DevExpress.Web.v20.2.dll
NuGet Package:
DevExpress.Web
Declaration
[DefaultValue(19)]
public int ItemWidth { get; set; }
<DefaultValue(19)>
Public Property ItemWidth As Integer
Property Value
Type |
Default |
Description |
Int32 |
19 |
An integer value representing the item’s width in pixels.
|
The ItemWidth property, together with the ASPxRatingControl.ItemHeight property, are useful to specify the item‘s size, for customizing the items images via the ASPxRatingControl.ImageMapUrl property.
For more information, see the Customizing Item’s Images topic.
Example
This sample illustrates how to customize the ASPxRatingControl‘s items images.
For this purpose, use the control’s ASPxRatingControl.ImageMapUrl, ASPxRatingControl.ItemWidth
and ASPxRatingControl.ItemHeight properties, that specify a custom image, and its size.
View Example
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e){
}
}
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="DevExpress.Web.v9.2, Version=9.2.0.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
Namespace="DevExpress.Web.ASPxRatingControl" TagPrefix="dxrc" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<dxrc:ASPxRatingControl ID="Rating" runat="server"
ImageMapUrl="~/rating.png" ItemHeight="24" ItemWidth="24" Value="3.75"
FillPrecision="Exact" />
</div>
</form>
</body>
</html>
Imports Microsoft.VisualBasic
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Partial Public Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
End Sub
End Class
<%@ Page Language="vb" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<%@ Register Assembly="DevExpress.Web.v9.2, Version=9.2.1.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
Namespace="DevExpress.Web.ASPxRatingControl" TagPrefix="dxrc" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<dxrc:ASPxRatingControl ID="Rating" runat="server"
ImageMapUrl="~/rating.png" ItemHeight="24" ItemWidth="24" Value="3.75"
FillPrecision="Exact" />
</div>
</form>
</body>
</html>
See Also