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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:29:43+00:00 2026-05-31T14:29:43+00:00

I have an ASP.NET GridView which is populated from a SQL Server database. This

  • 0

I have an ASP.NET GridView which is populated from a SQL Server database. This is working fine. My code behind is using C#.

One of the columns in the GridView contains a JQuery Progress bar and another contains a number of responses. Please see the image below:

enter image description here

How can I go about getting each value for the response count column and show this value in each rows corresponding JQuery Progress bar?

My JQuery progress bar is currently static and it generated like so:

<asp:DataList runat="server" id="listResponses" DataKeyField="QuestionID" OnItemDataBound="listResponses_ItemDataBound" Width="100%">
    <ItemTemplate>
        <div class="question_header">
            <p><strong><asp:Label ID="lblOrder" runat="server" Text='<%# Container.ItemIndex  + 1 %>'></asp:Label>. <%# DataBinder.Eval(Container.DataItem, "QuestionText") %></strong></p>
        </div> <!-- end question_header -->
        <asp:GridView runat="server" ID="gridResponses" DataKeyNames="AnswerID" AutoGenerateColumns="False" CssClass="responses" AlternatingRowStyle-BackColor="#f3f4f8">
            <Columns>
                <asp:BoundField DataField="AnswerTitle" ItemStyle-Width="250px"></asp:BoundField>
                <asp:TemplateField>
                    <ItemTemplate>
                        <div class="pbcontainer">
                            <div class="progressbar"></div>
                        </div>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="Responses" HeaderText="Response Count" HeaderStyle-Width="100px" />
            </Columns>
        </asp:GridView>   
    </ItemTemplate> 
</asp:DataList>

Using the following script provided on the JQuery UI website:

 $(function () {

        // Progressbar
        $(".progressbar").progressbar({
            value: 40
        });
        //hover states on the static widgets
        $('#dialog_link, ul#icons li').hover(
            function () { $(this).addClass('ui-state-hover'); },
            function () { $(this).removeClass('ui-state-hover'); }
        );

   });

I am not sure where to being here so any help would be appreciated.

  • 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-31T14:29:45+00:00Added an answer on May 31, 2026 at 2:29 pm

    In your div that holds the progress bar, add a hidden field like so:

    <div class="pbcontainer">
        <!-- This is the new line in markup. Replace NumOfResponses with your value field -->
        <asp:HiddenField ID="hiddenValue" runat="server" Value='<%# Eval("NumOfResponses") %>' />
    
        <div class="progressbar"></div>
    </div
    

    Now each div that contains a progress bar also contains a hidden field with the value you need to update the progress bar with.

    In jQuery you can set all progress bars inside the data list equal to their respective values. Example:

    EDIT: (the following jQuery code was modified)

    $('.pbcontainer').each(function() {
        // We assume that there is only 1 hidden field under 'pbcontainer'
        var valueFromHiddenField = $('input[type=hidden]', this).val();
    
        $('.progressbar', this).progressbar({ value: parseInt(valueFromHiddenField) });
    });
    

    ALL these were just from the top of my head without any real code verification..
    But this will be the IDEA:

    1. Get the value from ASP.NET into a hidden field near the progress bars in each row
    2. Update each progress bar in jQuery with the value in HTML hidden field.

    Hope this helps

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

Sidebar

Related Questions

I have an ASP.NET GridView which has columns that look like this: | Foo
I Have a and ASP.NET GridView which is set so <asp:GridView ID=GridView1 runat=server AutoGenerateColumns=False
I have an ASP.NET gridview component which is being filled up with data from
I have an extended GridView class, GridViewEx, which inherits from the basic ASP.NET gridview.
I have a ASP.Net Web Application which connects to a SQL Server. The web.config
I have an ASP.NET(2.0 using C#) web app, in which I have a gridview.
So I have an ASP.NET page with two controls: a GridView which displays rows
I have this exception i have a asp.net gridview with select edit and delete
I have an ASP.NET application inside which i have a GridView.I have Skin file
I am using C#,ASP.NET I have a Gridview for which I have provided Sorting,

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.