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

  • Home
  • SEARCH
  • 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 380617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:00:23+00:00 2026-05-12T15:00:23+00:00

so I have a GridView like this: <asp:GridView ID=gv runat=server AutoGenerateColumns=False GridLines=None OnRowCommand=gv_RowCommand OnRowDeleting=gv_RowDeleting

  • 0

so I have a GridView like this:

<asp:GridView ID="gv" runat="server" AutoGenerateColumns="False" GridLines="None"
    OnRowCommand="gv_RowCommand" OnRowDeleting="gv_RowDeleting" Width="100%" 
    OnPreRender="gv_PreRender">
    <Columns>
...
    <asp:TemplateField HeaderText="Temperatura">
        <ItemTemplate>
            <asp:TextBox MaxLength="10" ID="gvtxtTemp" runat="server" Text='<%# Eval("Registro3", "{0} °F")%>' />
        </ItemTemplate>
        <ControlStyle Width="100%" BackColor="Transparent" BorderStyle="None" />
    </asp:TemplateField>
...
    </Columns>
</asp:GridView>

So let’s say that the value to bind is the number “10”, so I would expect the output to be something like “10 °F” but instead I’m getting “10 °F °F”. Why? am I doing something wrong?

I also tried doing it in the codebehind but the result was the same.

Update: Now I changed the format string to “a {0} °F” and I’m getting “a a 10 ° °F”, now what’s that suppose to mean?

  • 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-12T15:00:24+00:00Added an answer on May 12, 2026 at 3:00 pm

    Ok, so I finally got what I wanted, the format I used was:

    <asp:TextBox MaxLength="10" ID="gvtxtTemp" runat="server" Text='<%# Eval("Registro3", "{0:#.# °F}")%>' />
    

    and now I’m getting the desired output “10 °F”, even thought the data is not a number (It’s a varchar(10) field). Why did this work beat’s me, but It worked, maybe some of you could tell me the reason. Anyhow thanks all for all your help!

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

Sidebar

Related Questions

I have a gridview like this. <asp:GridView ID=grdMerchant runat=server GridLines=None HeaderStyle-Font-Bold=True AutoGenerateColumns=False AllowSorting=True ShowHeader=false
I have a GridView just like this: <asp:GridView ID=gvwStudents runat=server AutoGenerateColumns=False DataKeyNames=ID ShowHeader=False onrowdeleting=gvwStudents_RowDeleting>
I have a GridView like this <asp:GridView ID=gv_FilesList runat=server AutoGenerateColumns=false onrowcommand=gv_FilesList_RowCommand> <Columns> <asp:BoundField DataField=f_Id
I have a simple grid view like this : <asp:GridView ID=gv_userActivities runat=server AutoGenerateColumns=False> <Columns>
hi I have this gridview like this. <asp:DropDownList ID=triggerDropDown runat=server AutoPostBack=true onselectedindexchanged=triggerDropDown_SelectedIndexChanged> <asp:GridView ID=myGridView
I have my <asp:GridView ID=gridView runat=server> I bind it like this : myConnection.Open(); SqlCommand
I have the following gridview: <asp:GridView ID=gdvReport runat=server AutoGenerateColumns=False DataSourceID=sdseport> <Columns> <asp:BoundField DataField=Phone HeaderText=Phone
I have a HyperLinkField defined as follows: <asp:GridView ID=gvNotifications runat=Server AutoGenerateColumns=false EnableViewState=true CssClass=tableWhole AlternatingRowStyle-CssClass=tableAlt>
I'm trying to nest two Grid_Views like ... <asp:GridView ID=gv runat=server CellPadding=0 ForeColor=#333333 GridLines=None
Here's what I have (working) : <asp:GridView ID=GridView1 runat=server AutoGenerateColumns=false> <Columns> <asp:BoundField HeaderText=Id DataField=Id

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.