Intersoft WebGrid Documentation
OnInitializeRow Method
See Also  Example Send Feedback
ISNet.WebUI.WebGrid Namespace > WebGrid Class : OnInitializeRow Method






row
Reference to the WebGridRow that being initialized.
Invoked when a WebGridRow needs to initialize during data binding.

Syntax

Visual Basic (Declaration) 
Public Overridable Function OnInitializeRow( _
   ByVal row As WebGridRow _
) As Boolean
Visual Basic (Usage)Copy Code
Dim instance As WebGrid
Dim row As WebGridRow
Dim value As Boolean
 
value = instance.OnInitializeRow(row)
C# 
public virtual bool OnInitializeRow( 
   WebGridRow row
)
Delphi 
public function OnInitializeRow( 
    row: WebGridRow
): Boolean; virtual; 
JScript 
public function OnInitializeRow( 
   row : WebGridRow
) : boolean;
Managed Extensions for C++ 
public: virtual bool OnInitializeRow( 
   WebGridRow* row
) 
C++/CLI 
public:
virtual bool OnInitializeRow( 
   WebGridRow^ row
) 

Parameters

row
Reference to the WebGridRow that being initialized.

Return Value

Returns ReturnValue. Event will be cancelled when ReturnValue is False.

Example

 

The example below shows how to initialize cell's Text.
C#Copy Code
private void WebGrid1_InitRow(object sender, ISNet.WebUI.WebGrid.RowEventArgs e) 
{
  if (e.Row.Table.DataMember == "OrderDetails")  
    { 
        if (e.Row.Type == RowType.Record)  
        { 
            WebGridCellCollection cells = e.Row.Cells; 
            DataRowView dr = (DataRowView) e.Row.DataRow; 
            cells.GetNamedItem("FullName").Text = dr["FirstName"].ToString() + ' ' + dr["LastName"].ToString(); 
        } 
    } 
}

Remarks

You can use this event to format cell's text, perform calculation or manipulate WebGridCell properties.

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.