.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> VB.Net >> Post New QuestionBookmark and Share Subscribe to Forum

DataGridView Issue

Posted By: srini     Posted Date: February 17, 2011    Points:2   Category :VB.Net
Hi,

In GridView, i want to display Male and female for appropriate users instead of showing checkbox with enabled/disabled in Usr_Gender column,because in database,i have used bit datatype for User_Gender.

Its showing,

Male-Enabled
Female-Disabled

Without changing the datatype in DB, I wanted to display Male/Female in the dataGridview cells.

Help me out!!!!!!!!!!






Responses
Author: Blessy Baby             
Posted Date: February 17, 2011     Points: 5   

Hi

Please try this

<asp:TemplateField HeaderText="Gender" >
<ItemTemplate>
<asp:Label ID="lblStatus" runat="server" Text='<%# (DataBinder.Eval(Container.DataItem, "User_Gender").ToString()=="True"?"Male":"Female") %>' ></asp:Label>
</ItemTemplate>
</asp:TemplateField>

Blessy Baby
Project Lead
Digitalmesh Softech India (p) Limited
Cochin,Kerala


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend