Intersoft WebGrid Documentation
WebGridCell Class
Members  Example  See Also  Send Feedback
ISNet.WebUI.WebGrid Namespace : WebGridCell Class






Represents an individual cell that belongs to WebGridTable objects.

Object Model

WebGridCell Class

Syntax

Visual Basic (Declaration) 
<DescriptionAttribute()>
<SerializableAttribute()>
Public Class WebGridCell 
   Inherits ISNet.WebUI.NamedObjectBase
   Implements ISNet.ICopyable, ISNet.IResetable, ISNet.Serialization.BinarySerialization.IBinarySerialize, ISNet.WebUI.INamedObject 
Visual Basic (Usage)Copy Code
Dim instance As WebGridCell
C# 
[DescriptionAttribute()]
[SerializableAttribute()]
public class WebGridCell : ISNet.WebUI.NamedObjectBase, ISNet.ICopyable, ISNet.IResetable, ISNet.Serialization.BinarySerialization.IBinarySerialize, ISNet.WebUI.INamedObject  
Delphi 
public class WebGridCell = class(ISNet.WebUI.NamedObjectBase, ISNet.ICopyable, ISNet.IResetable, ISNet.Serialization.BinarySerialization.IBinarySerialize, ISNet.WebUI.INamedObject)
JScript 
DescriptionAttribute()
SerializableAttribute()
public class WebGridCell extends ISNet.WebUI.NamedObjectBase implements ISNet.ICopyable, ISNet.IResetable, ISNet.Serialization.BinarySerialization.IBinarySerialize, ISNet.WebUI.INamedObject 
Managed Extensions for C++ 
[DescriptionAttribute()]
[SerializableAttribute()]
public __gc class WebGridCell : public ISNet.WebUI.NamedObjectBase, ISNet.ICopyable, ISNet.IResetable, ISNet.Serialization.BinarySerialization.IBinarySerialize, ISNet.WebUI.INamedObject  
C++/CLI 
[DescriptionAttribute()]
[SerializableAttribute()]
public ref class WebGridCell : public ISNet.WebUI.NamedObjectBase, ISNet.ICopyable, ISNet.IResetable, ISNet.Serialization.BinarySerialization.IBinarySerialize, ISNet.WebUI.INamedObject  

Example

 

The following example shows you how to programmatically create cell in an unbound mode WebGrid.
C#Copy Code
private void WebGrid1_InitializeLayout(object sender, ISNet.WebUI.WebGrid.LayoutEventArgs e)
{
    //Create the column
    WebGridColumn wcol = new WebGridColumn("ItemName","ItemName");
    wcol.Bound = false;
    WebGrid1.RootTable.Columns.Add(wcol);

    WebGridColumn wcol1 = new WebGridColumn("Discount","Discount");
    wcol1.Bound = false;
    WebGrid1.RootTable.Columns.Add(wcol1);

    WebGridColumn wcol2 = new WebGridColumn("Price","Price");
    wcol2.Bound = false;
    WebGrid1.RootTable.Columns.Add(wcol2);
   
   
    //Fill the data to table (1st row)
    WebGridRow wrow = new WebGridRow();
    WebGridCell wcell = new WebGridCell();
    wcell.Text="Item1";
    wrow.Cells.Add(wcell);
   
    WebGridCell wcell1 = new WebGridCell();
    wcell1.Text="0";
    wrow.Cells.Add(wcell1);

    WebGridCell wcell2 = new WebGridCell();
    wcell2.Text="100";
    wrow.Cells.Add(wcell2);
    WebGrid1.RootTable.Rows.Add(wrow);

    //Fill the data to table (2nd row)
    WebGridRow wrow1 = new WebGridRow();
    WebGridCell wcell3 = new WebGridCell();
    wcell3.Text="Item2";
    wrow1.Cells.Add(wcell3);
   
    WebGridCell wcell4 = new WebGridCell();
    wcell4.Text="5";
    wrow1.Cells.Add(wcell4);

    WebGridCell wcell5 = new WebGridCell();
    wcell5.Text="200";
    wrow1.Cells.Add(wcell5);
    WebGrid1.RootTable.Rows.Add(wrow1); 
}

Remarks

WebGridCell contains numerous properties that allow you to obtain the text and value of a cell in a WebGridTable. Additionally, you can determine the style and behavior of the cell by configuring its properties. As always, you can configure the properties using WebGrid.NET Designer or you can configure them programmatically.

Some of the properties in WebGridCell that are used oftenly are Text, ValueStyle, and CustomObjectAttributes

You can use the Text property in order to specify the text displayed and value in cell while the Value property can be used to get the value of a cell. You can also use the Style property to apply your preferred style. Moreover, you can use CustomObjectAttributes to add attribute to an object in a cell therefore you can call/apply the property from the client side.

WebridCell allows you to control how the contents of the cell are displayed. The alignment of the fonts in the cell are specified by setting the HorizontalAlign and VerticalAlign properties in RowLayout

You can also configure the behavior and style of cell when it is clicked or focused. Simply set the CellClickAction whether the cell or row will be chosen after you have clicked on the cell. Furthermore, you can determine the border color, border style, border width when the cell is being focused. 

Inheritance Hierarchy

System.Object
   ISNet.WebUI.WebUIBaseClass
      ISNet.WebUI.NamedObjectBase
         ISNet.WebUI.WebGrid.WebGridCell

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

©2012 Intersoft Solutions Corp. All Rights Reserved.