dynamically work with datagrids

E

et

How can I dynamically get the type of control in a datagrid. I have several
columns that when editing a row, one column may be a dropdownlist, the next
column may be a text box, the next column may be a label, or something else,
depending on what the datagrid is for and whether the user has access to
that column. So when retrieving the values of the datagrid row in order to
update the database, I need to be able to retrieve the type of control that
is in each column.

Question 2: How do I set the type of control dynamically in the first
place. In some circumstances, I want to be able to allow the user edit of
the row, but as above depending on their rights, one column may be a drop
down or it may be a text box or it may be an uneditable label.

TIA
 
E

Elmer Carías

About Question 2,
to do that you need use the Edit Item Template to put the objects that you
want use in Edit Mode and all visible=false, and in the EditItemCommand you
take the decision the object to make visible DropDown, TextBox or Label
depending of rigths to do.

I hope that helps you,

Elmer Carías
El Salvador, CA
(e-mail address removed)
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top