ComponentOne True DBGrid for .NET (2.0) Search HelpCentral 

C1DataColumn.CellValue Method

Gets the cell value for a given row.

[Visual Basic]

Public Function CellValue( _

ByVal row As Integer _

) As Object

[C#]

public object CellValue(

int row

);

[Delphi]

public function CellValue(

row: Int32

): Object;

Parameters

row

The row to fetch.

Return Value

The underlying data from the data source.

Remarks

Using the CellValue method is similar to accessing the ValueItem.Value property, except that a specific row can be selected from which to retrieve the value.

Using the CellValue method to extract information from a cell does not affect the current selection.

Use the CellText method to access the formatted data value for the specified row.

Example

The following code uses the CellValue method to get data from the Company column:

·      Visual Basic

       Dim custname As String = Me.C1TrueDBGrid1(row, "FirstName").ToString()

       ' Use the CellValue method to get some data.

       custname += " " + Me.C1TrueDBGrid1.Columns("Company").CellValue(row).ToString()

·      C#

       string  custname = this.C1TrueDBGrid1[row, "FirstName"].ToString();

       // Use the CellValue method to get some data.

       custname += " " + this.c1TrueDBGrid1.Columns["Company"].CellValue(row).ToString();

·      Delphi

       var

         CustName: String;

       begin

         CustName := Self.C1TrueDBGrid(Row, "First Name").ToString;

         // Use the CellValue method to get some data.

         CustName := CustName + ' ' + Self.C1TrueDBGrid1.Columns['LastName'].CellValue(Row).ToString;

       end;

See Also

C1DataColumn Class | C1DataColumn Members | C1.Win.C1TrueDBGrid Namespace


Send comments about this topic to ComponentOne.
Copyright © ComponentOne LLC. All rights reserved.