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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

populate a gridview in an accordion

Posted By:      Posted Date: October 27, 2010    Points: 0   Category :ASP.Net

Hey Guys

I am trying to fill a gridview inside a repeater and I am getting an error. Firstly, here is my code for the page...

   <asp:Accordion OnItemDataBound="Accordion1_ItemDataBound"  ID="Accordion2" runat="server" CssClass="accordion" HeaderCssClass="accordionHeader" HeaderSelectedCssClass="accordionHeaderSelected" ContentCssClass="accordionContent"  >
            <asp:Label ID="Label12" runat="server" Text='<%# Bind("Name") %>'><%#DataBinder.Eval(Container.DataItem, "Name" )%></asp:Label>  
             <asp:HiddenField ID="HiddenCompID" runat="server"  Value='<%#DataBinder.Eval(Container.DataItem, "CatID" )%>' />
            <asp:Label ID="Label12" runat="server" Text='<%# Bind("text") %>'></asp:Label>  
            <asp:GridView ID="grdMatches" AutoGenerateColumns="false" runat="server" EnableModelValidation="true">
                        <asp:TemplateField HeaderText="Game Name">

View Complete Post

More Related Resource Links

problem...i want a list item to populate all data in gridview!!!


i have a dropdownbox and a gridview

what I want is to have a list item which populates all data in a gridview.

I have tried using list item selected value=0 but to no avail.

what is the easiest way to achieve this?

search multiple words into textbox and populate all records in gridview related those keywords


I have a textbox and a gridview which is bound to a table

what I want to achieve is a solution where lets say there are two records - e.g. "1. Book and 2. Red", i want a user to type in those words and the gridview shows the results as followed;

1. Book

2. Red

I have set up the sql data source and everything and my like operator is this...

LIKE '%' + @record + '%'

how can I solve this problem?

populate fromview from gridview

I have a list of jobs in a gridview with a select button which when clicked calls a selectedIndexChanged method which I want to populate a formview I have the following code but its selecting the first row in the gridview not the selected row  and errors with  Null Reference Exception Object reference not set to an instance of an object  how to I get it to display the selected row  protected void gvJobPosting_SelectedIndexChanged(Object sender, EventArgs e)        {            TList <JustClick.BLL.JobPosting> JobID;            JobID = (TList<JustClick.BLL.JobPosting>)Session["JobPosting"];                        int PostID = JobID[0].JobPostingID;            ((TextBox) fvJobPosting.FindControl("dataJobTitle")).Text = JobID[0].JobTitle;            ((TextBox)fvJobPosting.FindControl("dataReferenceCode")).Text = JobID[0].ReferenceCode;            ((TextBox)fvJobPosting.FindControl(&

On GridView Click, populate other controls with column values


Hello team,

I have 5 controls on the page - textbox, radiobutton, listbox, checkbox, and any other one more. And i have a grid. The grid has 5 corresponding columns. I have to make the grid row clickable, and on the click, i have to populate my 5 controls with each of the corresponding grid column values.

Please let me know how can i make it. I know that i can make the grid clickable, by setting the e.row.attribute.add("OnClick", "javascript:return passValues();");. In this case, all the value passing will happen in javaScript. Is this the correct way? I have yet to try implementing this, not sure if there will be any issues.

Before that wanted to know if there is any other approach to achieve this. Please help!

ajax accordion with gridview doesn't display data


hi guys,

im trying to display some data using a gridview inside ajax accordion. i have called the method accordion1_itemBound at the accordion properties but it still doesnt show me any data at the gridview... i check all my query string and everything seems find. would really appreciate if someone could check my code and teach me how to solve it.

below are my codes at the source page

    <form id="form1" runat="server">
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ProrsumDBConnectionString %>" 
            SelectCommand="SELECT [reviewID], [comments], [reviewDate] FROM [Review]">
        <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
        <asp:DataList ID="dlProdCatalog" runat="server">
                <asp:Image ID="Image2" runat="server" ImageUrl='<%# Eval("pictureURL") %>' />
                <br />
                Tour Title:
                <asp:Label ID="tourTitle

Gridview Control Select Should Populate Second Gridview Control


Hi guys.

I am new to this forum as well as Visual Studio and asp.

I am connecting to an access db using Visual Studio Express 2010.

I have a dropdownlistbox that pulls names from a database.  When I select a name Gridview1 gets populated.  Now I want to populate Gridview2 with more data when I click 'Select' link in Gridview1 but it's not working.

I am passing name (string) and number (number) fields to the gridview2 based on the gridview1.selectedvalue property and am seeing:

Input string was not in a correct format.

Please any assistance would be greatly appreciated.

This is a very simple web app I am trying to design and my experience with Visual Studio and asp is limited.


code SQL to populate gridview with multiple random list box selections, How to


I could use some help in coding a query.

I have a list box that allows for multiple selections (holding down the control key) the selection quantity is basically unlimited, but realistically should never be more than 50 to 100 items from the listing of about 3000 items.

I need to collect the list of selected items from the drop down list and retrieve each of their full records from the item master and populate a gridview.

Any help would be greatly appreciated.


Thanks again,



Gridview populate from stored procedure


I'm pretty new at web programming but a lot of years as a client-server dev.

I'm populating a gridview from a stored procedure, but I don't want to actually execute the populate till I have all the values filled in the page. (some are static textboxes, a calendar (date) value and some drop-downs that are populated earlier)

I see there's nothing like gridview1.show() like there is in c# windows form programming. I tried

protected void Button1_Click(object sender, EventArgs e)
            GridView1.Enabled = true;
But I'm not sure that's correct. Any hints?



Accordion inside Gridview, fetch gridview data when expanding accordion


using asp.net/vb.net 2005

I want to create an accordion inside a gridview with the following functionality:

The user will only see one field of the gridview initially, the ProductCategoryID.  When the page loads it will only query the ProductCategoryID and this will be the only field displayed.

Next when the user clicks on the accordion to expand it inside the gridview I would like to query the database to get all Products that are part of the ProductCategory.  I will query using the ProductCategoryID that is being displayed.

I need to do this for performance issues.  The main thing I am looking for is how to query the database once the user expands a given ProductCategoryID.

but now I think of it one thing I need to know:  when you bind an accordion to a dataset will it create one pane for each record returned?  It might be better to put the gridview inside the accordion.  I'm willing to do either, as long as it works



SQL code to populate gridview with multiple random list box selections


I could use some help in coding a query.

I have a list box that allows for multiple selections (holding down the control key) the selection quantity is basically unlimited, but realistically should never be more than 50 to 100 items from the listing of about 3000 items.

I could really use some help building the SQL statement to select the choosen record data. I think I have the selection list worked out by populating an array but I am not clear on how to build the SQL query.

Any help would be greatly appreciated.


Thanks again

On row selected in gridview populate Listview.


Hi I have a problem with populating a ListView...

When the row is selected in the gridview control I want to bind data to listview.. When Im using a SQL datasource in Listview then

its working fine .. For example :

 <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:UserProfilesConnectionString %>"
                SelectCommand="SELECT .... FROM.... WHERE ([ArticleID] = @ArticleID)"
                    <asp:ControlParameter ControlID="GridView1" Name="ArticleID"
                        PropertyName="SelectedValue" Type="Int32" />

Inplace Edit in GridView

In this article I am presenting a different way to look at EditItemTemplate, using which user navigation for editing is reduced and . it looks very different (see screeen shots) then regular implementation of GridView.

GridView Confirmation Box Using JQuery BlockUI in asp.net

JQuery is the most popular JavaScript library. One of the main reasons for its fame is the plugin architecture. Anyone can create a separate library that leverage the JQuery library. In this article we are going to look at the BlockUI library which is used to block the user screen while performing a task.

Textbox Editable GridView in ASP.NET

This article describes how I made a fully editable gridview in C# using ASP.NET 2. The idea is that the GridView looks and works like an Excel spreadsheet. You see all the cells in the table, and you can edit any of the cells you like, and they are automatically updated (i.e. saved to the database). This is very often how people expect data tables to work in web pages, and I've often seen people clicking in vain on un-editable gridview cells, somehow expecting to edit them, and not understanding that they need to click an Edit button at the end of the row.

Adding Dynamic Rows in ASP.NET GridView Control with TextBoxes and with Delete functionality

In my previous examples, I have demonstrated on how to add dynamic rows in GridView control with TextBoxes and how to save the values into the database. Now, seems that most of the developers are asking if how to add a delete functionality with it. So in this example, I'm going to show on how to delete a certain row in the dynamic GridView with TextBoxes.

AJAX GridView Checkbox Select All in ASP.Net

In the previous article GridView Select Multiple Rows you learnt the multiple row selection in GridView control. Here you will get the C# code sample to select all the gridview rows using single checkbox server control. You can highlight the selected rows with different color and Font state Bold. If you want to use the selection values on different ASP.Net

AJAX GridView Paging and Sorting using C# in ASP.Net

To enable the GridView Paging and Sorting to update the GridView Data without refreshing the ASP.Net web page AJAX Extension controls are used. UpdatePanel is used to hold the GridView control that triggers the events for the controls placed inside it. By Default UpdatePanel triggers the asynchronous postbacks for its child controls.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

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