GridView Seond Header Problem

Posted by EyeCoder under ASP.NET on 5/9/2010 | Views : 2800 | Status : [Member] | Replies : 1
Dear All,

Finally i was able to add a second header at run time on my gridview using OnRowCreated event....
using this article "http://www.dotnetfunda.com/codes/code280-creating-multiple-header-rows-in-gridview.aspx "

if (e.Row.RowType == DataControlRowType.Header)
{

//adding the row
Addsecondheader();

}

but the problem is that i can't add the header on the second header Row ( after the main header)

e second link was really usefull, but the problem is i can't add the second header at row[1] only at row[0] like this statement, if I replaced 0 with 1 the out of index exception will be fired

Addsecondheader()
{
GridViewRow row = new GridViewRow(0, -1, DataControlRowType.Header, DataControlRowState.Normal);
}

if i replaced 1 with 0 in the code above an out of index exception is created.

is there any work around i can add the header on the second header row at postion[1] ? ;




Responses

Posted by: lakhansin-22735 on: 7/13/2013 [Member] Starter | Points: 25

Up
0
Down
Hi,

Can you please provide us a sample code? It will be more easier to understand actual run time errors.

Thanks,

Lakhan Singh
Tech Lead
BeyondKey System Pvt. Ltd.
Indore, M.P.
India

EyeCoder, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response