Click here to Skip to main content
12,895,064 members (61,948 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# ASP.NET
hello friends,

can anybody help me with this issue.

I have two dropdownlist inside gridview with value yes and no. database contains all the fields i have to fetch and fill it in gridview. for the dropdowns the database contains 0 and 1. I have to make the dropdowns yes if value is 1 and no value is 0 for all the rows fetched from the database. can anybody provide me any idea regarding it.

thanking you.
Posted 7-Oct-12 6:28am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Rate this: bad
Please Sign up or sign in to vote.

Solution 3


Implement GridView_RowDataBound event and into this check the value of dropdown. And after that change the item accordingly.

Other option is to user CASE clause in your query and get the exact data from database as you want to display.

Modify queyr as below

DropDownColumnName = CASE tablecoulmname
WHEN tablecoulmname = 1 THEN "Yes" 
WHEN tablecoulmname = 0 THEN "No"
ELSE defaultvalue as per your requirement

Hope this will help you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170424.1 | Last Updated 8 Oct 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100