Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8939217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:46:49+00:00 2026-06-15T10:46:49+00:00

My table having a field fld_status . It hold the values 0 and 1.

  • 0

My table having a field fld_status. It hold the values 0 and 1. 0 means active ,1 means inactive. But i want to show the meaning full name like active for 0 in the Gridview. Is there is any way to change this value 0 and 1 meaningful name in Gridview other than query?

 <asp:TemplateField ItemStyle-Width="40px" HeaderText="STATUS">
                                    <ItemTemplate>
                                        <asp:Label ID="lbl_status" runat="server" Text='<%# Eval("Fld_status")%>'></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle Width="40px"></ItemStyle>
                                </asp:TemplateField>

In gridview STATUS column show 0 and 1. I want to show only active and inactive based on o and 1.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T10:46:49+00:00Added an answer on June 15, 2026 at 10:46 am

    If you use a TemplateField:

    <asp:TemplateField ItemStyle-Width="40px" HeaderText="STATUS">
        <ItemTemplate>
            <asp:Label ID="lbl_status" runat="server" 
                Text='<%# (Eval("Fld_status")==1) ? "active" : "inactive" %>'>
            </asp:Label>
        </ItemTemplate>
        <ItemStyle Width="40px"></ItemStyle>
    </asp:TemplateField>
    

    or from the GridView’s RowDataBound:

    protected void gridview1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            DataRow row = ((DataRowView)e.Row.DataItem).Row;
            bool isActive = row.Field<int>("Fld_status") == 1;
            Label lbl_status = (Label) e.Row.FindControl("lbl_status");
            lbl_status.Text = isActive ? "active" : "inactive"; 
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having a table called Tl which consists of fields ID,Name and Course.
I am having a common field in ten tables with different field name. example:
I'm having some trouble comparing values found in VARCHAR fields. I have a table
I have a table called posts having an INT field posted and a table
I have an order table in MySQL database, having a field/column which stores the
Hai I am having the table USERS with the fields like USERACCNO FIELD-1 FIELD-2
I have a table with several fields and one field having 3 Comma Separated
I want to get the week off from a table. The table having a
I am having mysql table with one id field as auto-increment . When I
I have a SQL 2008 database with a table having a field 'Category' of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.