Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Nov 02, 2012 10:16 AM by molly_c
Oct 28, 2012 06:20 AM|LINK
I have a drop down list inside a gridview and i am filling values dynamically and how can i get the ID of the first item in the DDL without selecting??
Oct 28, 2012 06:27 AM|LINK
Oct 28, 2012 06:30 AM|LINK
Based on the id i have to fetch the value from the table.
Oct 28, 2012 06:39 AM|LINK
Oct 28, 2012 09:27 AM|LINK
while binding itself, you can bind ID values to DataValueField of DDL and then you can retrieve it by using FindControl and find the DDL first, then you can get the first item or item of your interest by DDL.ITems.FindByValue() or FindByText()....
Oct 28, 2012 05:12 PM|LINK
Ya i am binding the ID to the DataValuefield of the DDL but how can get the ID of first item?? how can can you provide some code??
DDL.ITems.FindByValue("what should i write here")??
Oct 29, 2012 03:33 AM|LINK
selectedvalue='<%# Bind ("yourgvfieldname") %>'
Oct 29, 2012 04:38 AM|LINK
Where i have to bind this??
Oct 29, 2012 04:53 AM|LINK
Oct 29, 2012 04:57 AM|LINK
you can use DataValueField property of DDL.