datalist - create diff. controls in same column

  • Thread starter Thread starter Mortar
  • Start date Start date
M

Mortar

Hi,

I have a datalist which has a column with data from a database. I
would like the column to either show a textbox with the value of the
data field, or a button. The contol created would depend on the value
of the data field.

i.e. if data value < 10 then create textbox with value of data
else
create a button.

i can create the textbox easy enough within the ItemTemplate, but
creating either the textbox Or a button is where I need help

anyone?
 
Hi

The easiest and best way it to create an dynamic template and add textbox or button dymanically by setting the condition.

Below articles shows how to add dynamic template
http://www.dotnetjunkies.com/Tutorial/47792CB0-0990-4BD8-BF84-B6063C4C9BBC.dci
http://www.asptoday.com/Content.aspx?id=113

Regards

Vinodh Kuma
Microsoft MVP|Author|Arc
www.dotnetforce.co
Force Behind .NE
----- Mortar wrote: ----

Hi

I have a datalist which has a column with data from a database.
would like the column to either show a textbox with the value of th
data field, or a button. The contol created would depend on the valu
of the data field.

i.e. if data value < 10 then create textbox with value of dat
els
create a button

i can create the textbox easy enough within the ItemTemplate, bu
creating either the textbox Or a button is where I need hel

anyone
 
Back
Top