ASP.NET: adding extra row to gridview

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
odubhgaillAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DhaestCommented:
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
odubhgaillAuthor Commented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
DhaestCommented:
Please close this question...
See:
I answered my own question, what do I do?
http://www.experts-exchange.com/help.jsp#hi333
0
Vee_ModCommented:
Closed, 500 points refunded.
Vee_Mod
Community Support Moderator
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.