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






Occurs when users change the selected row in WebGrid.

Syntax

Visual Basic (Declaration) 
<CategoryAttribute("Behavior")>
<DescriptionAttribute()>
Public Event RowChanged As EventHandler(Of RowChangedEventArgs)
Visual Basic (Usage)Copy Code
Dim instance As WebGrid
Dim handler As EventHandler(Of RowChangedEventArgs)
 
AddHandler instance.RowChanged, handler
C# 
[CategoryAttribute("Behavior")]
[DescriptionAttribute()]
public event EventHandler<RowChangedEventArgs> RowChanged
Delphi 
public event RowChanged: EventHandler; 
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 EventHandler<RowChangedEventArgs*>* RowChanged
C++/CLI 
[CategoryAttribute("Behavior")]
[DescriptionAttribute()]
public:
event EventHandler<RowChangedEventArgs^>^ RowChanged

Event Data

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

PropertyDescription
KeyValue Gets the key value of row changed event.
ReturnValue (Inherited from ISNet.WebUI.WebGrid.BaseEventArgs) 
Row (Inherited from ISNet.WebUI.WebGrid.RowEventArgs) 
Table  

Example

 

The following sample codes show you how to change the selected row on WebGrid using RowChanged event. As demonstrated in this sample, the CustomerID and CompanyName textboxes will be refreshed using FlyPostBack (Built-in AJAX) technique when you click on a row.
C#Copy Code
protected void WebGrid1_RowChanged(object sender, ISNet.WebUI.WebGrid.RowChangedEventArgs e)
{
        txtCustomerID.Text = e.Row.Cells.GetNamedItem("CustomerID").Text;
        txtCompanyName.Text = e.Row.Cells.GetNamedItem("CompanyName").Text;

        WebGrid1.ClientAction.RefreshModifiedControls();
}

Remarks

New in WebGrid.NET 5.0 Enterprise this new event can help you to achieve more complex scenarios with less codes, such as performing partial rendering to refresh specific controls using AJAX technique.

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.