//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//------------------------------------------------------------------------------
namespace System.Web.UI.WebControls {
using System;
using System.ComponentModel;
///
/// Represents an individual row in the .
///
public class GridViewRow : TableRow, IDataItemContainer {
private int _rowIndex;
private int _dataItemIndex;
private DataControlRowType _rowType;
private DataControlRowState _rowState;
private object _dataItem;
///
/// Initializes a new instance of the class.
///
public GridViewRow(int rowIndex, int dataItemIndex, DataControlRowType rowType, DataControlRowState rowState) {
this._rowIndex = rowIndex;
this._dataItemIndex = dataItemIndex;
this._rowType = rowType;
this._rowState = rowState;
}
///
/// Represents an item in the .
///
public virtual object DataItem {
get {
return _dataItem;
}
set {
_dataItem = value;
}
}
///
/// Indicates the data set index number. This property is read-only.
///
public virtual int DataItemIndex {
get {
return _dataItemIndex;
}
}
///
/// Indicates the index of the row in the . This property is
/// read-only.
///
public virtual int RowIndex {
get {
return _rowIndex;
}
}
///
/// Indicates the type of the row in the .
///
public virtual DataControlRowState RowState {
get {
return _rowState;
}
set {
_rowState = value;
}
}
///
/// Indicates the type of the row in the .
///
public virtual DataControlRowType RowType {
get {
return _rowType;
}
set {
_rowType = value;
}
}
///
///
///
protected override bool OnBubbleEvent(object source, EventArgs e) {
if (e is CommandEventArgs) {
GridViewCommandEventArgs args = new GridViewCommandEventArgs(this, source, (CommandEventArgs)e);
RaiseBubbleEvent(this, args);
return true;
}
return false;
}
///
///
///
object IDataItemContainer.DataItem {
get {
return DataItem;
}
}
int IDataItemContainer.DataItemIndex {
get {
return DataItemIndex;
}
}
int IDataItemContainer.DisplayIndex {
get {
return RowIndex;
}
}
}
}