DataColumn.Expression

  • Thread starter Thread starter shark
  • Start date Start date
S

shark

Hi

Is it any way to use current column value in Expression for this column.
Let say we want to have:
DataColumn2.Expression = IIF(DataColumn1 <0, DataColumn1, DataColumn2)

Its'n valid but how to handle it?

Thanks

Shark
 
shark,

The Expression property is a string, so you want to add quotes to the
"IIF" part. Of course, DataColumn1 and DataColumn2 in the string should be
the names of the columns, not the references to the columns.
 
yes, but you can't use the same column name in expression for this column
and it's my problem


Nicholas Paldino said:
shark,

The Expression property is a string, so you want to add quotes to the
"IIF" part. Of course, DataColumn1 and DataColumn2 in the string should
be the names of the columns, not the references to the columns.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

shark said:
Hi

Is it any way to use current column value in Expression for this column.
Let say we want to have:
DataColumn2.Expression = IIF(DataColumn1 <0, DataColumn1, DataColumn2)

Its'n valid but how to handle it?

Thanks

Shark
 
* shark wrote, On 17-5-2007 15:54:
yes, but you can't use the same column name in expression for this
column and it's my problem


Nicholas Paldino said:
shark,

The Expression property is a string, so you want to add quotes to
the "IIF" part. Of course, DataColumn1 and DataColumn2 in the string
should be the names of the columns, not the references to the columns.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

shark said:
Hi

Is it any way to use current column value in Expression for this column.
Let say we want to have:
DataColumn2.Expression = IIF(DataColumn1 <0, DataColumn1, DataColumn2)

Its'n valid but how to handle it?

Thanks

Shark

Just add a new column to the dataset and bind to that instead.

Jesse
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top