.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

Merging gridview header after binding in winforms

Posted By:      Posted Date: September 23, 2010    Points: 0   Category :WPF


Note : I am talking about Winform grid only

I want to bind a grid, structure should look like below after binding with the datatable,


    26_sept            l         27_sept          l            28_sept       l           29_sept

col1 col2 col3 col4 l   col1 col2 col3 col4  l   col1 col2 col3 col4 l  col1 col2 col3 col4

                           l                               l                              l


Here, I have datatable dt 16 columns as below but no parent header

col1 col2 col3 col4 l   col1 col2 col3 col4  l   col1 col2 col3 col4 l  col1 col2

View Complete Post

More Related Resource Links

Binding the multiple drop down boxes in GridView using JQuery in ASP.NET

Here is the code for binding the multiple drop down boxes in GridView using JQuery in ASP.NET

Create ToolTip for GridView Header

The following allows you to add a tooltip to the header links of your GridView, a feature that is lacking.

How to Fixed GridViews Header and Footer when scrolling in asp.net?

This article is to show you how to Fix GridView''s Header and Footer in a simple code with CSS and JavaScript

Binding GridView with SqlDataSource at runtime?


Hi, I want to create a generic page which contains a gridview and sqldatasource. I want to put these two controls on .aspx (C#) page but bind them at runtime. It should have selectcommand, updatecommand, deletecommand and insertcommand. Stored procedures are created for that. Help is needed to make it. Please post some link or code. Regards, ap.

Custom Grid View Header - Grid view Row Created event vs Gridview row databound events ?


Hi Gurus ,

It happened to add an extra Gridveiw Header in row_databound event , It did worked fine on !Postback but disappered on Page.Postback . Quick google search guided me to move the event to Row_Created event and every thing is okay .

Can any expert post some pointers , differnces between grid row_created vs row_databount with some sample table data created dynamically  behaviour of both the events in !Postback and page.Postback .

Thanks a tonne in Advance and  any inputs will be valued and appreciated .

Need some help BINDING to Gridview


Here is how I set this up....Still not working.

  •     Dim cs As ConnectionStringSettings   
  •     cs = ConfigurationManager.ConnectionStrings("ConnectionStringVendors")   
  •     Dim connString As String = cs.ConnectionString   
  •     Dim dbConnection As New SqlConnection(connString)   
  •     Dim query As String  
  •     Dim query1 As String  
  •     query = "SELECT keyID, projectNum, projectDescripti
  • Binding xml data (which is return from Url) to gridview


    I have used Yahoo BOSS API for internal search. This API return string and i want to bind it with gridview. How can i achieve this following is the code

    string AppId = "sRP_q9bV34HI_zNyuahPFBGnf1SHyBaIKCtvEjB89EuiNJI6fcfSwAFbwAFSsCV_";
    //string Query = "site:way2k.com engineering colleges in pune";
    string Query = "colleges in pune"; int NumResults = 10;
         int NumResults = 10;
    System.Net.WebClient webClient = new System.Net.WebClient(); request = string.Format( "http://boss.yahooapis.com/ysearch/web/v1/{1}?appid={0}&format=xml&results={2}", AppId, Query, NumResults); byte[] response = webClient.DownloadData(request); string responseXML = System.Text.UTF8Encoding.UTF8.GetString(response); return responseXML;

    this code returns result in xml format, how can i bind this XML to gridview so that it looks like search result

    how to Gridview Header should be Stable in asp.net?

    HI all, i have gridview with 100 columns,if scorll down records should be comes down but Header of Gridview should be Static, how can i do that.Please help me.Best Regards,Thiru

    binding innerhtml data to gridview

    I have innerhtml data in database(which contains both text and picture) fro example it will look like this <P>&nbsp;which one is afgnfgdggm</P><P>gfglkfgfgriwtiouweoituwetjhewoituewointwektiujwent</P><P><IMG src="http://localhost:3032/IHSOnline/editorimages/UserImages/7b709.jpg" width=150>&nbsp;</P> I have to bind this data to gridview.These are the steps i tried.......I took this data to a string using Server.HtmlDecode .(this step i have done in an imagegrab.aspx page using id of image,to retrieve and bind data dynamically to griview). in gridview i made a templatefield and code is like this <asp:TemplateField HeaderText="Question"> <ItemTemplate> <%# FormatURL(DataBinder.Eval(Container.DataItem, "question_id")) %> </ItemTemplate> </asp:TemplateField> where server side function public string FormatURL(object strArgument) { return ("imagegrab.aspx?id=" + strArgument); } I tried to call imagegrab.aspx.But it is not working.Can anyone describe me how to call and pass this id to imagegrab.aspx....... and also how to bind this data to gridview

    binding datetimecontrol,dropdown,textbox inside gridview and update each gridviewrow

    i have a web part with datetimecontrol(sharepoint) inside a  gridview. when the page loads this this gridview will be loaded with dtc control and the selecteddate would be one of the columns in the splist.also gridview contaisn dropdowns, textboxes, when an update button cliked inside grid, i need to save the info in the splist.  currently i am not getting the value  bound with dtc control. i am getting blank date inside dtc. though in the  rowdatabound event i amcapturing the values due to some reason i am not able to view the value in the DTCcontrol. can anybody give me help me how to achieve this? any  help links/ sample code.. appreciate the help                         

    Binding Web Service Result in asp:gridview and enable sorting(paiging)

    Hello everyoneI have web service and gridviewI'm binding it without problemcode: protected void Page_Load(object sender, EventArgs e) { GetCallsService wservice = new GetCallsService(); List<Call> list = wservice.getCalls(2); GridView1.DataSource = list; //GridView1.AllowSorting = true; GridView1.DataBind(); } But I want to enable sorting and(or) paging.   GridView1.AllowSorting = true; this doen't solves problem.everything worls fine if I'm usign sqlDatasource but when datasource is web service it doesn't wokdoes enyone know solution?

    Footer and Header in Empty GridView

    How to make GridView to show Header and Footer when it hasn't got any rows?

    Problem Binding DropdownList in a gridView to a datasource

    I have a Dropdownlist in an itemTemplate in a gridview. My gridView binds to dataTable1 (from which the selected value for dropdown comes from) and dropDown binds to dataTable2 (i need to get DataValueField and DataTextField from here).<asp:TemplateField HeaderText="Category"> <ItemTemplate> <asp:DropDownList ID="Cat" runat="server" SelectedValue='<%#Bind("CATEGORY") %>' > </asp:DropDownList> </ItemTemplate> <FooterStyle BorderStyle="None" /> <HeaderStyle BorderStyle="None" /> <ItemStyle BorderStyle="None" /> </asp:TemplateField>How do I do that? thanks in advance!

    Dynamically Binding Header of Repeater Control

    Hi , I am stuck up into following Issue while binding Repeater control dynamically from database I have repeater control which I want to populate from database.. asp:Repeater id="Repeater1" runat="server">   <HeaderTemplate>      <table border="1">         <tr bgcolor="#ffcc99">            <th><asp:label id="Lname" runat ="server" text = "???"  ></asp:label></th> <th><asp:label id="Fname" runat ="server" text = "???"  ></asp:label></th>         </tr>   </HeaderTemplate>   <ItemTemplate>      <tr bgcolor="#ffcccc">        <td><%# DataBinder.Eval(Container.DataItem, "Col1") %></td>        <td><%# DataBinder.Eval(Container.DataItem, "Col2") %></td>      </tr>   </ItemTemplate>   <FooterTemplate>   </table>   </FooterTemplate></asp:Repeater&g

    GridView column/row data binding problem

    Hi All, I have a table with the following structure: Attribute------------- AttributeIdWeekNoDayNoAttribute1Attribute2Attribute3Attribute4Attribute5 ........ likewise. I want to display these data in a gridview in the following manner                                  Sunday    Monday Tuesday ............ (till Saturday) - should be gridview columns, I can retrieve this using dayno Attribute 1 Attribute 2 Attribute 3 Attribute 4 .......... like wise attributes should be taken in to rows.Is this possible in a gridview, if so how can I do that?

    Binding Gridview using MDX query

    Hi, I tried to show results in a gridview using MDX query. In addition, I created a dropdownlist. I was hoping that the content of the gridview would change when I choose different conditions  from the dropdownlist. However, there was an error: "The result set returned by the server is not a rowset."  I did much research on the problem, but I still don't understand. The following is my code: public partial class Default3 : System.Web.UI.Page { StringBuilder sb = new StringBuilder(); protected void Page_Load(object sender, EventArgs e) { string conString = "Datasource=localhost;Initial Catalog=PIsystem"; AdomdConnection con = new AdomdConnection(); con.ConnectionString = conString; con.Open(); AdomdCommand cmd = con.CreateCommand(); cmd.CommandText = sb.ToString(); DataTable dt = new DataTable(); dt.Load(cmd.ExecuteReader()); GridView1.DataSource = dt; GridView1.DataBind(); con.Close(); } protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { if (DropDownList1.SelectedIndex > -1) { if (DropDownList1.Items[1].Selected) { sb.Append("SELECT {[Measures].[NBP]} ON COLUMNS, {[Time].[Month]} ON ROWS"); sb.Append("FROM [PISystem]"); sb.Append("WHERE ([Employ].[Region

    getting the AutoComplete inside a gridView Header?

     Hi all Could anyone please point me in the right direction to getting the following 'autoComplete Extender' into the Header of the gridView below please  <asp:GridView ID="gvAllData" runat="server" AutoGenerateColumns="False" DataKeyNames="IDNo" DataSourceID="dsAllData" allowPaging="True" allowSorting="True" GridLines="None" CellPadding="4" ForeColor="#333333"> <Columns> <asp:TemplateField> <ItemTemplate> <asp:TextBox runat="server" ID="myTextBox" Width="100" autocomplete="off" /> <cc1:AutoCompleteExtender runat="server" ID="autoComplete1" TargetControlID="myTextBox" ServicePath="AutoComplete.asmx" ServiceMethod="GetCompletionList" MinimumPrefixLength="2"
    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