The correct item in a dropdown-list should be selected automatically, is this not the case? Or are you asking how one populates a dropdown list with items from another database table?
I simply want to have status as a drop downlist ( because it's only 3 so i didt createa table in database these are the items 1- open 2- closed 3 - in progress) in edit mode.
how Can I have a drop downlist in edit mode with these items? and if there is any value in database it should pick it up.
for example I have a record that the status column has the value of "closed". so in edit mode I would like to have a drop down list with 3 elements and and the closed value should be selected.
and another question, here is the scenario: I have id of a row as a label in edit mode and becuase it's auto increment column so we cant update it.
but I really would like to show the id but in update mode I dont want to update it and I am getting the followin error!!!
Regarding the first question (have status as a drop downlist ). I managed to do this by adding a datatype that renders the DropDown list control (let's say it's called ProjectCategories) and given it the prevalues I wanted as values in the DB and then setting the type of the field as the new datatype.
Glad you guys figured this out and it's an elegant solution, I think.
Ali, about your other question - it's possible to mark a field as readonly by setting the attribute readonly="true" on the field. For some reason I missed this in the documentation on codeplex, but I'll update it as soon as possible. Anyway, hope this solves the issue.
Btw. sorry about the late reply! I've been very busy since getting back from vacation.
what is the easiest way of populating a drop downlist with the same value as db?
Hi Sune,
hope you are well. just a quick quesiton.
what is the easiest way of populating a drop down list with the same value as database?
Cheers
Ali
Hi Ali,
Sorry, not quite sure what you mean by this :)
The correct item in a dropdown-list should be selected automatically, is this not the case? Or are you asking how one populates a dropdown list with items from another database table?
Best regards
Sune
Hi Sune,
Thanks for quick reply.
I simply want to have status as a drop downlist ( because it's only 3 so i didt createa table in database these are the items 1- open 2- closed 3 - in progress) in edit mode.
how Can I have a drop downlist in edit mode with these items? and if there is any value in database it should pick it up.
for example I have a record that the status column has the value of "closed". so in edit mode I would like to have a drop down list with 3 elements and and the closed value should be selected.
and another question, here is the scenario: I have id of a row as a label in edit mode and becuase it's auto increment column so we cant update it.
but I really would like to show the id but in update mode I dont want to update it and I am getting the followin error!!!
Unable to save:
Cannot update identity column 'TicketId'.
Any idea on this?
Thanks in advance
Ali
Hi Sune,
Any luck on this?
Cheer
Ali
Hi Ali,
Very quick message. I'm on vacation at the moment and will be back on the 16th, where I'll get back to you :)
- Sune
Hi Sune,
Thanks for letting me know.
Cheer
Ali
Hi Ali,
Regarding the first question (have status as a drop downlist ). I managed to do this by adding a datatype that renders the DropDown list control (let's say it's called ProjectCategories) and given it the prevalues I wanted as values in the DB and then setting the type of the field as the new datatype.
Let me know if it works for you.
Good luck,
Mirela.
Hi Mirela,
That's a brilliant idea. simple and easy and I am sure that's going to work.
Thanks a lot for your great solution.
Cheers
Ali
Glad you guys figured this out and it's an elegant solution, I think.
Ali, about your other question - it's possible to mark a field as readonly by setting the attribute readonly="true" on the field. For some reason I missed this in the documentation on codeplex, but I'll update it as soon as possible. Anyway, hope this solves the issue.
Btw. sorry about the late reply! I've been very busy since getting back from vacation.
Sune,
Hope you had a great vacation. thanks for your reply. I will have a look when I get chance and will let you know the result.
You are legend.
Cheers
Ali
is working on a reply...