Back to Devexpress

ASPxGridViewTableRowEventArgs Class

aspnet-devexpress-dot-web-ec0c5361.md

latest2.6 KB
Original Source

ASPxGridViewTableRowEventArgs Class

Provides data for the ASPxGridView.HtmlRowCreated and ASPxGridView.HtmlRowPrepared events.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public class ASPxGridViewTableRowEventArgs :
    ASPxGridViewItemEventArgs
vb
Public Class ASPxGridViewTableRowEventArgs
    Inherits ASPxGridViewItemEventArgs

ASPxGridViewTableRowEventArgs is the data class for the following events:

Example

In this example the ASPxGridView.HtmlRowPrepared event is handled to highlight the departments whose budget is less than $100,000.

The image below shows the result:

csharp
protected void ASPxGridView1_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) {
    if (e.RowType != GridViewRowType.Data) return;
    int budget = Convert.ToInt32(e.GetValue("Budget"));
    if (budget < 100000)
        e.Row.ForeColor = System.Drawing.Color.Red;
}
vb
Protected Sub ASPxGridView1_HtmlRowPrepared(ByVal sender As Object,_
    ByVal e As DevExpress.Web.ASPxGridViewTableRowEventArgs)_
    Handles grid.HtmlRowPrepared
    If e.RowType = GridViewRowType.Data Then
        Dim budget As Integer = Convert.ToInt32(e.GetValue("Budget"))
        If budget < 100000 Then
            e.Row.ForeColor = System.Drawing.Color.Red
        End If
    End If
End Sub

Inheritance

Object EventArgs ASPxGridItemEventArgs ASPxGridViewItemEventArgs ASPxGridViewTableRowEventArgs

See Also

ASPxGridViewTableRowEventArgs Members

Grid View

DevExpress.Web Namespace