Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Merge Datagrid Headings

Status
Not open for further replies.

kvang

Programmer
Oct 7, 2005
129
US
I have two columns in a datagrid next to each other that I want to merge the headings only (much like what you would do in excels). How would I do this in my VB.NET code?
 
use a ControlAdapter to alter the output of the gridview.
or
on the GridViewDataBound event parse the Header
Code:
if (MyGridView.HeaderRow != null)
{
   MyGridView.HeaderRow.Cells[x].ColumnSpan = 2;
   MyGridView.HeaderRow.Cells.RemoveAt(x + 1);
}
I'm not sure if this would work or not, but it's worth a shot.


Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top