P
pickedaname
Hi,
I have a SQL bound gridview with select button and paging enabled.
In the gridviews prerender event, I am inserting another header in row 0.
Dim table As Table = DirectCast(GridView1.Controls(0), Table)
Dim hrow As GridViewRow = New GridViewRow(0, -1, DataControlRowType.Header,
DataControlRowState.Normal)
Dim th As TableCell = New TableHeaderCell()
th.HorizontalAlign = HorizontalAlign.Center
th.ColumnSpan = 2
th.BackColor = System.Drawing.Color.FromArgb(214, 211, 206)
th.ForeColor = Drawing.Color.Black
th.BorderColor = Drawing.Color.Black
th.BorderWidth = 1
th.Font.Bold = True
th.Text = "Employee"
th.ID = "hdrEmp"
hrow.Cells.Add(th)
table.Rows.AddAt(0, hrow)
There are other columns added to hrow.Cells above before I add hrow to
table.rows using the same exact coding (different names and colspans) trying
to save space here.
The problem I am having is whenever i click the select button control on any
record,
I lose my pager row and I get an empty row inserted below the header rows.
So if I click another select button, I get yet another blank row inserted
below the headers. I can keep this up until all rows in the grid are blank.
If I load the page and click the pager control to go to page 2 or 3, I don't
get the blank row and I don't lose my pager row, it only happens when select
is clicked. I have nothing going on (yet) when a record is selected, it is
simply selected so there is no other code on the page to respond to
rowselected.
Am I messing up the indexing?
Please Help
I have a SQL bound gridview with select button and paging enabled.
In the gridviews prerender event, I am inserting another header in row 0.
Dim table As Table = DirectCast(GridView1.Controls(0), Table)
Dim hrow As GridViewRow = New GridViewRow(0, -1, DataControlRowType.Header,
DataControlRowState.Normal)
Dim th As TableCell = New TableHeaderCell()
th.HorizontalAlign = HorizontalAlign.Center
th.ColumnSpan = 2
th.BackColor = System.Drawing.Color.FromArgb(214, 211, 206)
th.ForeColor = Drawing.Color.Black
th.BorderColor = Drawing.Color.Black
th.BorderWidth = 1
th.Font.Bold = True
th.Text = "Employee"
th.ID = "hdrEmp"
hrow.Cells.Add(th)
table.Rows.AddAt(0, hrow)
There are other columns added to hrow.Cells above before I add hrow to
table.rows using the same exact coding (different names and colspans) trying
to save space here.
The problem I am having is whenever i click the select button control on any
record,
I lose my pager row and I get an empty row inserted below the header rows.
So if I click another select button, I get yet another blank row inserted
below the headers. I can keep this up until all rows in the grid are blank.
If I load the page and click the pager control to go to page 2 or 3, I don't
get the blank row and I don't lose my pager row, it only happens when select
is clicked. I have nothing going on (yet) when a record is selected, it is
simply selected so there is no other code on the page to respond to
rowselected.
Am I messing up the indexing?
Please Help