[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

ASP.NET: adding extra row to gridview

Posted on 2008-01-29
5
Medium Priority
?
1,134 Views
Last Modified: 2008-02-04
Hi,

I have a gridview displaying product and price info. I want to display two header rows at the top of the gridview which will display category info etc. I need these header rows to be part of the gridview to maintain a consistent disaplay.

How can I add these 2 header rows and be able to set their text dynamically?

Robert
0
Comment
Question by:odubhgaill
  • 2
4 Comments
 
LVL 53

Expert Comment

by:Dhaest
ID: 20766965
These articles can help you on your way

How To Customize Header Of ASP.Net DataGrid
http://www.netomatix.com/DGHeader.aspx

How to Change DataGrid Header Text?
http://www.c-sharpcorner.com/UploadFile/sd_patel/DataGridHeaderText11232005050843AM/DataGridHeaderText.aspx
0
 

Accepted Solution

by:
odubhgaill earned 0 total points
ID: 20767946
thanks for the input.

I found the solution elsewhere.

For reference - to add extra rows to the header of a gridview -

Protected Sub grdSelect_RowCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles grdSelect.RowCreated

If e.Row.RowType = DataControlRowType.Header Then

            Dim row As GridViewRow
            Dim tableCell As TableCell


            row = New GridViewRow(-1, -1, DataControlRowType.Header, DataControlRowState.Insert)

            tableCell = New TableCell()
            tableCell.Text = "enter text here"
            tableCell.ColumnSpan = 3
            row.Cells.Add(tableCell)

            grdSelect.Controls(0).Controls.AddAt(0, row)

etc....
0
 
LVL 53

Expert Comment

by:Dhaest
ID: 20775343
Please close this question...
See:
I answered my own question, what do I do?
http://www.experts-exchange.com/help.jsp#hi333
0
 
LVL 1

Expert Comment

by:Vee_Mod
ID: 20813597
Closed, 500 points refunded.
Vee_Mod
Community Support Moderator
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Free Data Recovery software is an advanced solution from Kernel Tools to recover data and files such as documents, emails, database, media and pictures, etc. It supports recovery from physical & logical drive after a hard disk crash, accidental/inte…
Suggested Courses
Course of the Month11 days, 9 hours left to enroll

640 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question