This documentation is archived and is not being maintained.

DataGridItem Constructor

Initializes a new instance of the DataGridItem class.

[Visual Basic]
Public Sub New( _
   ByVal itemIndex As Integer, _
   ByVal dataSetIndex As Integer, _
   ByVal itemType As ListItemType _
)
[C#]
public DataGridItem(
   int itemIndex,
 int dataSetIndex,
 ListItemType itemType
);
[C++]
public: DataGridItem(
   int itemIndex,
 int dataSetIndex,
 ListItemType itemType
);
[JScript]
public function DataGridItem(
   itemIndex : int,
 dataSetIndex : int,
 itemType : ListItemType
);

Parameters

itemIndex
The index of the item in the DataGrid control from the Items collection.
dataSetIndex
The index number of the item, from the bound data source, that appears in the DataGrid control.
itemType
One of the ListItemType values.

Remarks

Use this constructor to create and initialize a new instance of the DataGridItem class.

Example

[Visual Basic, C#, C++] The following example demonstrates how to create and initialize a new instance of the DataGridItem class.

[Visual Basic] 
Sub Page_Load(sender As Object, e As EventArgs)
    Dim index As Integer = 0
    Dim setindex As Integer = 1
    Dim myItem As New DataGridItem(index, setindex, ListItemType.Item)
End Sub 'Page_Load

[C#] 
void Page_Load(Object sender, EventArgs e) 
{
   int index = 0;
   int setindex = 1;
   DataGridItem myItem = new DataGridItem(index, setindex, ListItemType.Item);
}

[C++] 
void Page_Load(Object* /*sender*/, EventArgs* /*e*/) 
{
   int index = 0;
   int setindex = 1;
   DataGridItem* myItem = new DataGridItem(index, setindex, ListItemType::Item);
}

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

DataGridItem Class | DataGridItem Members | System.Web.UI.WebControls Namespace | DataGrid | ListItemType

Show: