GridTableItemStyle class

Inherited from System.Web.UI.WebControls.TableItemStyle. Encapsulates the styles of a WebCell.

public class GridTableItemStyle : TableItemStyle


Name Description
GridTableItemStyle() Default constructor.


Name Description
BackImageAttributes { get; set; } Background image attributes.
BackImageUrl { get; set; } Background image url.
BottomBorderStyle { get; set; } Specifies the style of the cell’s bottom border.
Custom { get; set; } Gets or sets the custom format, null or empty string means no custom format.
IndentLevel { get; set; } Gets or sets indent level.
IsLocked { get; set; } Gets or sets a value indicating whether a cell can be modified or not when its worksheet is protected. When its worksheet is protected and IsLocked is true, the cell can not be edit. When its worksheet is protected and IsLocked is false, the cell can be edit.
LeftBorderStyle { get; set; } Specifies the style of the cell’s left border.
NumberType { get; set; } Gets or sets the display format of numbers and dates.
RightBorderStyle { get; set; } Specifies the style of the cell’s right border.
RotationAngle { get; set; } Gets or sets Rotation attribute.
TopBorderStyle { get; set; } Specifies the style of the cell’s top border.


Name Description
override AddAttributesToRender(HtmlTextWriter, WebControl) Internal use only. Implementation method Do not call this method directly.
override CopyFrom(Style) Copies from another style object.
override GetHashCode() Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
override MergeWith(Style) Merges with another style object.


using System.Web.UI.WebControls;
WebWorksheets sheets = GridWeb1.WebWorksheets;
WebWorksheet sheet = sheets[sheets.Add("demo1")];

WebCell cell = sheet.Cells[0,0];
cell.StringValue = "Demo Text";

Aspose.Cells.GridWeb.TableItemStyle style = cell.GetStyle();
style.Font.Size = new FontUnit("72pt");
style.Wrap = false;

style.BackColor = Color.Gray;
style.BorderStyle = BorderStyle.Solid;
style.BorderWidth = new Unit(1, UnitType.Pixel);
style.BorderColor = Color.Silver;

style.RightBorderStyle.BorderColor = Color.Black;
style.RightBorderStyle.BorderStyle = BorderStyle.Solid;
style.RightBorderStyle.BorderWidth = new Unit(1, UnitType.Pixel);
style.BottomBorderStyle.BorderColor = Color.Black;
style.BottomBorderStyle.BorderStyle = BorderStyle.Solid;
style.BottomBorderStyle.BorderWidth = new Unit(1, UnitType.Pixel);

[Visual Basic]
Imports System.Web.UI.WebControls
Dim sheets As WebWorksheets =  GridWeb1.WebWorksheets
Dim sheet As WebWorksheet =  sheets(sheets.Add(__0__))

Dim cell As WebCell =  sheet.Cells(0,0)
cell.StringValue = "Demo Text"

Dim style As Aspose.Cells.GridWeb.TableItemStyle = cell.GetStyle()
style.Font.Size = New FontUnit("72pt")
style.Wrap = False

style.BackColor = Color.Gray
style.BorderStyle = BorderStyle.Solid
style.BorderWidth = New Unit(1, UnitType.Pixel)
style.BorderColor = Color.Silver

style.RightBorderStyle.BorderColor = Color.Black
style.RightBorderStyle.BorderStyle = BorderStyle.Solid
style.RightBorderStyle.BorderWidth = New Unit(1, UnitType.Pixel)
style.BottomBorderStyle.BorderColor = Color.Black
style.BottomBorderStyle.BorderStyle = BorderStyle.Solid
style.BottomBorderStyle.BorderWidth = New Unit(1, UnitType.Pixel)

See Also