datagrid-expressions

R

reiks

My select query is a s follows
select qty from sales;

My datagrid as two template columns with textboxex in
Item
template.I want to use second template column as a
compute column in my datagrid which
depends on column 'qty' values of my select statement

compute column's value should be as follows
if( qty > 10) qty+10 else
qty-10

How can give my 'DataBinder.eval(containder.dataitem))'
expression to my textbox in html?

How can I acheive this?I dont want to use a compute column
in my select statement?

How complex evaluation expressions can be given for
datagrid columns either at design time or programatically?

plzzz help me out

thanks in advance,
reiks
 
J

Jos

reiks said:
My select query is a s follows
select qty from sales;

My datagrid as two template columns with textboxex in
Item
template.I want to use second template column as a
compute column in my datagrid which
depends on column 'qty' values of my select statement

compute column's value should be as follows
if( qty > 10) qty+10 else
qty-10

How can give my 'DataBinder.eval(containder.dataitem))'
expression to my textbox in html?

How can I acheive this?I dont want to use a compute column
in my select statement?

How complex evaluation expressions can be given for
datagrid columns either at design time or programatically?

plzzz help me out

thanks in advance,
reiks

Just write a function for your expression and add it to the
databinding syntax:
Function myExpr(oQty As Object) As String
Dim qty As Integer=Convert.toInt32(oQty)
if(qty>10) Then
qty+=10
else
qty-=10
End If
End Function

This goes in your template:
Text='<%# myExpr(DataBinder.Eval(Container.DataItem,"myField")) %>'
 

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

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top