FlexGrid for WinForms
SetData(Int32,Int32,Object,Boolean) Method



Row index.
Column index.
Value to assign to the cell.
Whether the value should be converted to the column's data type.
Assigns a value to a grid cell.
Syntax
'Declaration
 
Public Overloads Overridable Function SetData( _
   ByVal row As Integer, _
   ByVal col As Integer, _
   ByVal value As Object, _
   ByVal coerce As Boolean _
) As Boolean
'Usage
 
Dim instance As C1FlexGridBase
Dim row As Integer
Dim col As Integer
Dim value As Object
Dim coerce As Boolean
Dim value As Boolean
 
value = instance.SetData(row, col, value, coerce)
public virtual bool SetData( 
   int row,
   int col,
   object value,
   bool coerce
)
public:
virtual bool SetData( 
   int row,
   int col,
   Object^ value,
   bool coerce
) 

Parameters

row
Row index.
col
Column index.
value
Value to assign to the cell.
coerce
Whether the value should be converted to the column's data type.

Return Value

True if the value was assigned to the cell.
Remarks

If coerce is set to true and the value can't be converted into the proper data type, the grid will fire the GridError event and the cell will retain its original value.

Using SetData(Int32,Int32,Object,Boolean) with coerce set to true is equivalent to setting the grid's indexer. For example, the following lines of code are equivalent:

flex.SetData(1, 1, "Hello", true); flex[1, 1] = "Hello"; // same thing
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

C1FlexGridBase Class
C1FlexGridBase Members
Overload List

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Send Feedback