Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post May 16, 2012 12:49 PM by sunilgurjar
0 Points
6 Posts
May 16, 2012 09:04 AM|LINK
hi,
how merging of two cells acheived in gridview.
With thanks,
Krithi
Member
115 Points
64 Posts
May 16, 2012 09:11 AM|LINK
Hi Krithi,
Please check this link. This will solve ur purpose
http://www.codeproject.com/Articles/36536/Cell-Merging-In-GridView
Contributor
4868 Points
851 Posts
May 16, 2012 09:22 AM|LINK
hi
Instead of gridview you can try ListView where you can define the layout template of the control. What is the format that you are trying to acheive. Do share the screen shot if possible.
thanks,
All-Star
128444 Points
18141 Posts
MVP
May 16, 2012 12:02 PM|LINK
Take a look at this: http://www.codeproject.com/Articles/34337/How-to-merge-cells-with-equal-values-in-a-GridView
2094 Points
539 Posts
May 16, 2012 12:06 PM|LINK
Hi,
Trt this
In Design : OnRowCreated="grd_RowCreated"
In code behind :
protected void grd_RowCreated(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.Header) { GridView oGridView = (GridView)sender; GridViewRow oGridViewRow = new GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Insert); TableCell oTableCell = new TableCell(); oTableCell.Text = "Heading for two columns"; oTableCell.HorizontalAlign = HorizontalAlign.Center; oTableCell.ColumnSpan = 2; oGridViewRow.Cells.Add(oTableCell); oGridView.Controls[0].Controls.AddAt(0, oGridViewRow); } }
Reply me for any issues....
97839 Points
14494 Posts
May 16, 2012 12:29 PM|LINK
Grouping in Gridview would be more appropriate - http://www.agrinei.com/gridviewhelper/gridviewhelper_en.htm
Thanks,
2252 Points
478 Posts
May 16, 2012 12:49 PM|LINK
try this
Krithika Sel...
0 Points
6 Posts
MERGING TWO CELLS IN GRIDVIEW
May 16, 2012 09:04 AM|LINK
hi,
how merging of two cells acheived in gridview.
With thanks,
Krithi
ManojNR
Member
115 Points
64 Posts
Re: MERGING TWO CELLS IN GRIDVIEW
May 16, 2012 09:11 AM|LINK
Hi Krithi,
Please check this link. This will solve ur purpose
http://www.codeproject.com/Articles/36536/Cell-Merging-In-GridView
cninjas
Contributor
4868 Points
851 Posts
Re: MERGING TWO CELLS IN GRIDVIEW
May 16, 2012 09:22 AM|LINK
hi
Instead of gridview you can try ListView where you can define the layout template of the control. What is the format that you are trying to acheive. Do share the screen shot if possible.
thanks,
Niranjan
vinz
All-Star
128444 Points
18141 Posts
MVP
Re: MERGING TWO CELLS IN GRIDVIEW
May 16, 2012 12:02 PM|LINK
Take a look at this: http://www.codeproject.com/Articles/34337/How-to-merge-cells-with-equal-values-in-a-GridView
MessageBox Controls for WebForms | Blog | Twitter | Linkedin
kirupa.v
Contributor
2094 Points
539 Posts
Re: MERGING TWO CELLS IN GRIDVIEW
May 16, 2012 12:06 PM|LINK
Hi,
Trt this
In Design : OnRowCreated="grd_RowCreated"
In code behind :
protected void grd_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Header)
{
GridView oGridView = (GridView)sender;
GridViewRow oGridViewRow = new GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Insert);
TableCell oTableCell = new TableCell();
oTableCell.Text = "Heading for two columns";
oTableCell.HorizontalAlign = HorizontalAlign.Center;
oTableCell.ColumnSpan = 2;
oGridViewRow.Cells.Add(oTableCell);
oGridView.Controls[0].Controls.AddAt(0, oGridViewRow);
}
}
Reply me for any issues....
ramiramilu
All-Star
97839 Points
14494 Posts
Re: MERGING TWO CELLS IN GRIDVIEW
May 16, 2012 12:29 PM|LINK
Grouping in Gridview would be more appropriate - http://www.agrinei.com/gridviewhelper/gridviewhelper_en.htm
Thanks,
JumpStart
sunilgurjar
Contributor
2252 Points
478 Posts
Re: MERGING TWO CELLS IN GRIDVIEW
May 16, 2012 12:49 PM|LINK
try this
http://www.codeproject.com/Articles/36536/Cell-Merging-In-GridView
read my blog
http://sunilgurjar.blogspot.com/