Add row and merge cells on footer

I need to add rows and merge cells on datagrid footer. Is there a way to do it preferenceably dinamically?

What I did:

DataSet ds =

new DataSet();


DataRow newRow = ds.Tables[0].NewRow();


But it is inserting not on footer, but below it. Thanks a lot

Best regards,

Ivan Andrade
7/20/2006 10:30:02 PM 72751 articles. 3 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 26

I found out how! thanks


void Datagridcfa_ItemCreated(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)


ListItemType lit = e.Item.ItemType;

if (ListItemType.Header == lit)


e.Item.SetRenderMethodDelegate (

new RenderMethod(NewRenderMethod));



private void NewRenderMethod(HtmlTextWriter writer,Control ctl)


writer.Write("<tr><td colspan=\"7\" align=\"center\">PREMIO NOVO ACUMULADO " + DateTime.Now.Year +


writer.Write("<td rowspan=\"2\" align=\"center\">PRODUTOS</td>\n");

writer.Write("<td colspan=\"2\" align=\"center\">COTACOES</td>\n");

writer.Write("<td colspan=\"4\" align=\"center\">PREMIO NOVO</td>\n");




for(int i=0; i<= ctl.Controls.Count-2; i++)





Best regards,

Ivan Andrade
7/21/2006 5:13:09 PM

Similar Artilces:

How to add first cell as emty cell to row in table server control
Hi all ,   i have diveded Table row into 28 cells Programmatically  . 0 to 28  but i have to made first cell as emty cell and from second cell i want to start assiging values i mean from 0 to 28   Here my question is how i made first cell as emty cell and from secnod one i assign the value 0 to 28? give me hint please.   Best Regards Rameezwaheed life is name of learning!Mark as an answer if it helps if you would like to make this an empty cell then set the value equal to &nbsp;  Try This<table><tr><td>&nbsp;</td><td...

How to add a footer row to a table after deleting all footer rows
I'm sure this is a very easy thing to do, but I can't figure out how to do it. I have a table, and I deleted all the footer rows.  Now I would like to add one footer row.  How do I do that? If I right-click on the detail row and select Insert Row Below, it is, of course, another detail row. I'm stumped -- thanks for any help you can give!Cynthia Do you have groups in your table?  You should be able to right click on any table row and toggle the corresponding menu item to show the table header, details or footer.  It is in the right click menu includ...

Add new controls to a gridview row; when editing that row using the edit row feature in the gridview control.
Hi all  I have a questions that looks hard / complex to me, and i know you can help me in this. Q {  I have row in a Gridview and i have an edit option to it. I press the edit button, to edit the values in that row and update data all the way back to the database. Now when i press the edit button, i want a drop down list to be displayed that contain values for a particular field in my grid view. (for now only plain text boxes appear.) } I hope you understand my question, all i need to do is replace the text box controls with a dropdown list when i am editing a row in ...

Dyanmically add control to gridview row cell
I have the below code to add a 'dropdown' control to a cell of the row. Can someone throw some light on what is wrong as the control does not created in the cell?   Dim choicedropdown As DropDownList choicedropdown = New DropDownList() GridViewITDevDelayQuestions.Rows(1).Cells(0).Controls.Add(choicedropdown) Thanks The best place to create dynamic controls is in the page_init .This is the earliest part in your page-life cycle and dynamic controls should be created here.   In this particular example, code to add control to a cell in the gridview control cannot be add...

Merging DataTables with multiple columns
I have 2 datatablesTable 0:Col Time    Col A    Col BTable 1:Col Time    Col C    Col DDesired Merged Table Result (final Table 0):Cole Time  Col A  Col B  Col C  Col D(with all same Time rows in the same row)   Via merge, I would like a merged table where all rows from either table with the same time (my PK column) all appear on the same row.  The table structure does get output correctly, but those rows with identical times from Table 1 (and 2, 3, etc.)  appear as an additional row...

Add New Row To DataGrid Using the Footer With a DropDownList Control
I am trying to discover the best method for adding a new row of data to a datagrid. My datagrid is bound to an SQL Server table. I was reading the article "Adding a New Record to the Datagrid", by John Sanborn ( wherein he suggests a method of using the datagrid's footer for adding new records. The concept works if each column of data is to be keyed in by the user, but I have a requirement to provide a drop-down list of valid values for a specific column. I've been tinkering with using a drop-down list in the footer of the grid, but I am unable get it to displ...

Merging duplicated row's cells in DataGrid Control
Hi folks, I need your help in finding a way to merging duplicated row's cells. For instance, if I have the following DataGrid: (You can see here that the Mission Name is repeating over and over…)Mission Name        Activity Name************             *************Hunting Animals    FishingHunting Animals    Trapping tigersHunting Animals    Catching birds     And I would like to display the Mission Name only once because it&...

Add .Net Control to Web Custom Control
 I want to add .NET Control (like: TextBox, Button...) to Web Custom Control.How i can do it? Alphavn That's called a composite control -- "Mark As Answer" if my reply helped you -- Hello Guys What gunteman said, that is one approach and in most cases the right one.But its also possible to add child controls to a Control thats inherit from WebControl itself. Be sure to implement INamingContainer to that inherited Control too, thats the important point of that approach.--Microsoft MVP - Visual Developer ASP / ASP.NET-

How To: Reference controls in footer row from an item row
I'm familiar with using the e.Item.FindControl command when manipulating controls from an item row or footer row when you are actually in (editing) that row. I'm also familiar with determining what "Type" of row I'm in. What I'm having troubles with is referencing a control in the footer row of a datagrid while I'm actually in (editing) an item row. Can this be done? Thanks Mike...

merge cells in gridview on row databound or rowcreated event add empty columns to the end of gridview
i want to merge certain gridview row based on value of field say levelid  at first when page load and data is bind to grid it merge the cells but when i click a button outside the gridview and do postback it add 3 empty columns to the end of the grid , please help in which event do i have to write.Protected Sub UxGvdata_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles UxGvdata.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then               ...

this.Controls.Add does not add control to child collection (this.Controls.Count == 0)
Ok, as silly as it may sound, I have a situation where I am creating a CompositeControl in ASP.NET 2.0, C#. I have the following code in the CreateChildControls() method that build the control's child control collection: 1    for (int i = 0; i < _menus.Count; i++)2    this.Controls.Add(_menus[i]);3    4    foreach (FloatingMenu menu in _menus)5    {6    Label lbl = new Label();7    lbl.ID = string.Concat("GroupQ", menu.ID);8    lbl.CssClass = "menuIt...

Add User Control to table cell in another User Control dynamically
Hi.. Right now im using one user control in an aspx page as.. <%@ Register TagPrefix="cc1" Namespace="cssc.Web.Controls" Assembly="Clock" %> <div id="lCurrTime_container" style="BORDER-RIGHT: black 1px solid; BORDER-TOP: gray 1px; DISPLAY: block; FONT-WEIGHT: bold; FONT-SIZE: 7pt; Z-INDEX: 102; LEFT: 0px; BORDER-LEFT: gray 1px; WIDTH: 120px; COLOR: black; BORDER-BOTTOM: black 1px solid; POSITION: absolute; TOP: 0px; HEIGHT: 16px; BACKGROUND-COLOR: white; TEXT-ALIGN: center"> Current time:  <cc1:clock id="Clock2" runat="server" UseExternalJS="true" DateTimeFormat=...

How to add the data present in the controls to a table control without any database involvement.
Hi All,i am four controls where i will write the text and once i click the add button those should get added to the table .i want 6 columns fixed in the table and rows as many as required.i tried doing that taking a table server control and able to load the table.but the problem is whenver i am adding a new row the old one is gfetting overwritten by this and at the end i am getting only one row.  System.Web.UI.WebControls.Table t1 = new System.Web.UI.WebControls.Table();  i have declared the below one global TableRow tr; TableCell tc1; TableCell tc2; TableCell tc...

Add row to table with table.row.add()
Everytime I click on a button I want to add a tableRow to a table like this:        TextBox TB = new TextBox();                TableCell Cell = new TableCell();        Cell.Controls.Add(TB);        TableRow Row = new TableRow();        Row.Cells.Add(Cell);        table.Rows.Add(Row);It works the first time, but when I click the button again the last r...

Web resources about - Add row and merge cells on footer -

Wikipedia:Manual of Style/Layout - Wikipedia, the free encyclopedia
This is a guide to laying out a typical basic article. Complicated articles may be best modeled on the layout of an existing article of appropriate ...

Alyson Footer (@alysonfooter) on Twitter
Sign in Sign up To bring you Twitter, we and our partners use cookies on our and other websites. Cookies help personalize Twitter content, tailor ...

Lead-footers hit the highway in NT
Police hit out at drivers who exceeded 200km/h during first hours of an open speed limits trial.

New Footer in Mobile Google Search
Google's mobile search results pages have a new footer. Pagination elements are now centered and there's a Google logo at the bottom of the page. ...

Michael Jordan nails 50-footer at golf tournament
Watch: Sports legend Michael Jordan proved he can still hit the big shot

Texas Italian-American Sports Foundation to honor Alyson Footer
Texas Italian-American Sports Foundation to honor Alyson Footer

Alyson Footer leaves Astros for
Alyson Footer leaves Astros for mlb.

Is Tyson Chandler the NBA's Best Dressed Seven-Footer?
... of the New Yorks Knicks, but off the court, he likes to style on people. GQ has gone so far to say that Chandler is "the slickest seven-footer" ...

Astros Boxes Podcast: Alyson Footer, Social Media and Lance Berkman
Special Guests Alyson Footer and Terri Schlather discuss social media, Jerome Williams signing and Lance Berkman

Vince Carter Throws Down Throwback Jam Over Seven-Footer Rudy Gobert
Vince Carter Throws Down Throwback Jam Over Seven-Footer Rudy Gobert

Resources last updated: 12/25/2015 12:45:50 PM