Intersoft WebGrid Documentation
InitializeRow Event
See Also  Example Send Feedback
ISNet.WebUI.WebGrid Namespace > WebGrid Class : InitializeRow Event






Occurs when a WebGridRow is being initialized and about to be rendered.

Syntax

Visual Basic (Declaration) 
<CategoryAttribute("Behavior")>
<DescriptionAttribute()>
Public Event InitializeRow As RowEventHandler
Visual Basic (Usage)Copy Code
Dim instance As WebGrid
Dim handler As RowEventHandler
 
AddHandler instance.InitializeRow, handler
C# 
[CategoryAttribute("Behavior")]
[DescriptionAttribute()]
public event RowEventHandler InitializeRow
Delphi 
public event InitializeRow: RowEventHandler; 
JScript 
In JScript, you can handle the events defined by another class, but you cannot define your own.
Managed Extensions for C++ 
[CategoryAttribute("Behavior")]
[DescriptionAttribute()]
public: __event RowEventHandler* InitializeRow
C++/CLI 
[CategoryAttribute("Behavior")]
[DescriptionAttribute()]
public:
event RowEventHandler^ InitializeRow

Event Data

The event handler receives an argument of type RowEventArgs containing data related to this event. The following RowEventArgs properties provide information specific to this event.

PropertyDescription
ReturnValue (Inherited from ISNet.WebUI.WebGrid.BaseEventArgs) 
Row Gets the WebGridRow object used by the event.

Example

 

This example below shows you 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

This event can be used to format cell's text, perform calculation or manipulate WebGridCell properties.

if you want to expand child rows in WebGrid using InitializeRow event, you can follow the steps on Walkthrough: Using ExpandChildRow to expand child tables.

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.