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 3439134
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:16:19+00:00 2026-05-18T08:16:19+00:00

I have the following gridview: <asp:GridView ID=gdvReport runat=server AutoGenerateColumns=False DataSourceID=sdseport> <Columns> <asp:BoundField DataField=Phone HeaderText=Phone

  • 0

I have the following gridview:

        <asp:GridView ID="gdvReport" runat="server" AutoGenerateColumns="False" DataSourceID="sdseport">
        <Columns>
            <asp:BoundField DataField="Phone" HeaderText="Phone" SortExpression="Phone">
                <ControlStyle Width="250px" />
            </asp:BoundField>
            <asp:BoundField DataField="ToCall" HeaderText="Foramt" SortExpression="ToCall" />
        </Columns>
    </asp:GridView>

The second row is a bool in the database, but I do not want to show a checkbox or true\false to the users.

How do I display something like this instead?
0 = Don’t Call
1 = Call Us

  • 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-05-18T08:16:20+00:00Added an answer on May 18, 2026 at 8:16 am

    I ended up just using OnRowDataBound for this.

    <asp:GridView ID="gdvReport" runat="server" AutoGenerateColumns="False" DataSourceID="sdseport" OnRowDataBound="OnRowDataBound">
        <Columns>
            <asp:BoundField DataField="Phone" HeaderText="Phone" SortExpression="Phone">
                <ControlStyle Width="250px" />
            </asp:BoundField>
            <asp:BoundField DataField="ToCall" HeaderText="Foramt" SortExpression="ToCall" />
        </Columns>
    </asp:GridView>
    
    
    protected void OnRowDataBound(object sender, EventArgs e)
    {  
        GridViewRowEventArgs ea = e as GridViewRowEventArgs;
        if (ea.Row.RowType == DataControlRowType.DataRow)
        {
            DataRowView drv = ea.Row.DataItem as DataRowView;
            Object ob = drv["Phone"];
            if (!Convert.IsDBNull(ob))
            {
                bool iParsedValue = false;
                if (bool.TryParse(ob.ToString(), out iParsedValue))
                {
                    TableCell cell = ea.Row.Cells[1];
                    if (iParsedValue == false)
                    {
    
                        cell.Text = "Don't Call";
                    }
                    else
                    {
                        cell.Text = "Call Us";
                    }
    
                }
            }
        }
    }
    

    And it is working great now.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following GridView <asp:GridView ID=grdImoveis runat=server DataSourceID=dsGrid> <Columns> <asp:BoundField HeaderText=Nome DataField=NomeCompleto />
I have the following gridview <asp:GridView DataSourceID=odsRooms DataKeyNames=id,objectid ID=gvRooms PageSize=10 runat=server AutoGenerateColumns=False > <Columns>
i have the following gridview <asp:GridView ID=GridView3 runat=server AllowPaging=True AllowSorting=True AutoGenerateColumns=False DataKeyNames=ID DataSourceID=CommentsDataSource> <Columns>
I have the following aspx: <asp:GridView ID=GridView1 runat=server AutoGenerateColumns=False BorderStyle=None Font-Names=Verdana Font-Size=12px OnSelectedIndexChanged=GridView1_SelectedIndexChanged ShowHeader=False
I have the following aspx code; <asp:GridView ID=GridView1 runat=server AllowPaging=True AllowSorting=True AutoGenerateColumns=False DataKeyNames=ProductId DataSourceID=edsinventory
I have the following GridView in ASP.NET 3.5: <asp:GridView ID=gvTable runat=server AllowSorting=true ShowHeader=true> <Columns>
I have a GridView defined as follows: <asp:GridView ID=myGridView AutoGenerateColumns=false runat=server OnLoad=myGridView_Load OnRowCommand=myGridView_Command OnRowEditing=myGridView_RowEditing
I have the following GridView and ObjectDataSource: <asp:GridView ID=grdTrades runat=server DataSourceID=srcTrades DataKeyNames=tradeId EnablePersistedSelection=true SelectedRowStyle-BackColor=Yellow
ok the following is the code for the gridview: <asp:GridView ID=GridView1 runat=server AutoGenerateColumns=False BorderColor=#3399FF
I have defined the following in my gridview markup (simplified): <asp:GridView ID=grvReport runat=server DataSourceID=odsReport

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.