Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > gridview headers

Reply
Thread Tools

gridview headers

 
 
ShiroiRyuu
Guest
Posts: n/a
 
      12-01-2006
tenho um dataset que tem um numero de colunas variavel que
apresentado num grid view e eu queria podsr agrupar alguns headers
desse gridview quando as colunas possuirem o mesmo nome. por exemplo

assim:


empresa | teste | teste | campo | alfa | alfa
---------------------------------------------------------------------------*-------



nome | 134 | 214 | 342 | 245 | 456
nome | 100 | 344 | 453 | 312 | 78


e eu quero que fique assim:


empresa | teste | beta | alfa
---------------------------------------------------------------------------*-------



nome | 134 | 214 | 342 | 245 | 456
nome | 100 | 344 | 453 | 312 | 78


alguem sabe como fazer isso?


obrigado!

 
Reply With Quote
 
 
 
 
Fred Exley
Guest
Posts: n/a
 
      12-01-2006

"ShiroiRyuu" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
tenho um dataset que tem um numero de colunas variavel que
apresentado num grid view e eu queria podsr agrupar alguns headers
desse gridview quando as colunas possuirem o mesmo nome. por exemplo

assim:


empresa | teste | teste | campo | alfa | alfa
---------------------------------------------------------------------------*-------



nome | 134 | 214 | 342 | 245 | 456
nome | 100 | 344 | 453 | 312 | 78


e eu quero que fique assim:


empresa | teste | beta | alfa
---------------------------------------------------------------------------*-------



nome | 134 | 214 | 342 | 245 | 456
nome | 100 | 344 | 453 | 312 | 78


alguem sabe como fazer isso?


obrigado!



This might help a little. It dynamically builds the header text of a
gridview based on drop down list values:
(you can run it at: http://monte.jodoshared.com/FindAnItem.aspx (the
'Compare' page does this dynamic header manipulation))


protected void GridViewCompareSet_Sorting(object sender,
GridViewSortEventArgs e)

{




DataTable m_DataTable = (DataTable)Session["dtFinal"];

if (m_DataTable != null)

{

int m_PageIndex = GridViewCompareSet.PageIndex;

string m_SortDirection = GetSortDirection();

DataView m_DataView = new DataView(m_DataTable);

m_DataView.Sort = e.SortExpression + " " + m_SortDirection;

GridViewCompareSet.DataSource = m_DataView;

GridViewCompareSet.DataBind();

GridViewCompareSet.HeaderRow.Cells[1].Text =
DropDownList1.SelectedItem.ToString();

GridViewCompareSet.HeaderRow.Cells[2].Text =
DropDownList2.SelectedItem.ToString();

GridViewCompareSet.HeaderRow.Cells[0].Width = 100;

GridViewCompareSet.HeaderRow.Cells[1].Width = 90;

GridViewCompareSet.HeaderRow.Cells[2].Width = 90;


GridViewCompareSet.PageIndex = m_PageIndex;

}

}




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with wsgiref.headers.Headers Phil Python 4 01-17-2010 04:47 PM
Server cannot clear headers after HTTP headers have been sent Ian ASP .Net Security 2 03-20-2007 09:00 AM
GridView Hierarchical View - Gridview in Gridview =?Utf-8?B?bWdvbnphbGVzMw==?= ASP .Net 1 05-09-2006 06:48 PM
Showing the column headers of a GridView when there is no data Hans Merkl ASP .Net 4 11-15-2005 02:51 AM
Reading 'received' headers: Email Headers Parsing dont bother Python 0 03-03-2004 08:18 PM



Advertisments