TOUGH GRIDVIEW PROGRAMMING: Different controls in EditTemplate col

  • Thread starter Savvoulidis Iordanis
  • Start date
S

Savvoulidis Iordanis

How can I display a different control for my [value_column (varchar)] in my
table, inside an ItemTemplate or EditTemplate, depending on the value of
another column, the [type_column (varchar)], which has values like 'STRING',
'INTEGER', 'BOOLEAN', 'DECIMAL', 'DATETIME', 'MONEY', 'SQL_LIST_VALUES'?

That is, if the [type_column] in a specific gridview row, has a value of
'BOOLEAN', then I want my [value_column] to display a checkbox in
ItemTemplate or EditTemplate and not a textbox. Also, when the [type_column]
is 'INTEGER', I want my [values_column] to display a textbox that accepts
only integer numbers. If the type column is MONEY, I want the ItemTemplate to
display a label formated with the currency symbol. If the [type_column] is
'SQL_LIST_VALUES', the [value_column] should display a dropdownlist in
editmode, filled by a SQL statement stored in a 3rd column [sql_column]. And
so on.

To sum up, when the user sees the gridview in read mode or edit mode, he/she
should see different controls in each row of a specific column and not just
labels or textboxes, which is the default.

TIA
Iordanis
 

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,754
Messages
2,569,527
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top