[]
Assigns a value to a grid cell.
public virtual bool SetData(int row, int col, object value, bool coerce)
Type | Name | Description |
---|---|---|
int | row | Row index. |
int | col | Column index. |
object | value | Value to assign to the cell. |
bool | coerce | Whether the value should be converted to the column's data type. |
Type | Description |
---|---|
bool | True if the value was assigned to the cell. |
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(int, int, object, bool) 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
Assigns a value to a range of cells.
public virtual bool SetData(CellRange rg, object value, bool coerce)
Type | Name | Description |
---|---|---|
CellRange | rg | CellRange that specifies the cells that will be assigned a new value. |
object | value | Value that will be assigned to all cells in the range. |
bool | coerce | Whether the value should be converted to the column's data type. |
Type | Description |
---|---|
bool | True if the value was assigned to all cells in the destination range. |
Assigns a value to a grid cell, coercing the value into the cell's specified DataType.
public virtual bool SetData(int row, int col, object value)
Type | Name | Description |
---|---|---|
int | row | Row index. |
int | col | Column index. |
object | value | Value to assign to the cell. |
Type | Description |
---|---|
bool | True if the value was assigned to the cell, false if the value could not be assigned (usually because it could not be converted to the appropriate type). |
Assigns a value to a range of cells, coercing the value into each cell's specified DataType.
public virtual bool SetData(CellRange rg, object value)
Type | Name | Description |
---|---|---|
CellRange | rg | CellRange that specifies the cells that will be assigned a new value. |
object | value | Value that will be assigned to all cells in the range. |
Type | Description |
---|---|
bool | True if the value was assigned to all cells in the destination range, false if the value could not be assigned to all cells in the range (usually because it could not be converted to the appropriate type). |
Assigns a value to a grid cell.
public virtual bool SetData(int row, string colName, object value, bool coerce)
Type | Name | Description |
---|---|---|
int | row | Row index. |
string | colName | Column name. |
object | value | Value to assign to the cell. |
bool | coerce | Whether the value should be converted to the column's data type. |
Type | Description |
---|---|
bool | True if the value was assigned to the cell, False otherwise. |
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(int, int, object, bool) 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, "ColName", "Hello", true);
flex[1, "ColName"] = "Hello"; // same thing
Assigns a value to a grid cell, coercing the value into the cell's specified data type.
public virtual bool SetData(int row, string colName, object value)
Type | Name | Description |
---|---|---|
int | row | Row index. |
string | colName | Column name. |
object | value | Value to assign to the cell. |
Type | Description |
---|---|
bool | True if the value was assigned to the cell, False otherwise. |