What's the purpose of datavaluefield and datatextfield
-
I have observed that for dropdown, we have to use either DataValueField or DataTextField or both. Without these, values are not visible in dropdown. Still confusing wWhat's the purpose of DataValueField and DataTextField? Why to use and which to use when? As per my undertstanding: DataValueField: for Backend DataTextField: for front end But in general scenarios, whatever we display in dropdown using DataTextField, we will update/delete etc the same at backend using smae colum in DataValueField. SO any good example to show their diff as well as utility?
-
I have observed that for dropdown, we have to use either DataValueField or DataTextField or both. Without these, values are not visible in dropdown. Still confusing wWhat's the purpose of DataValueField and DataTextField? Why to use and which to use when? As per my undertstanding: DataValueField: for Backend DataTextField: for front end But in general scenarios, whatever we display in dropdown using DataTextField, we will update/delete etc the same at backend using smae colum in DataValueField. SO any good example to show their diff as well as utility?
amittinku wrote:
DataValueField: for Backend DataTextField: for front end
Correct.
amittinku wrote:
But in general scenarios, whatever we display in dropdown using DataTextField, we will update/delete etc the same at backend using smae colum in DataValueField.
Sometimes. It's often possible that you would, for example, show a list of employee names. Odds are, you'd prefer to look them up in the database using an employee id. That's what the value field is for.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.