lanter007
asked on
Paging lost after e.Row.Cells(0).Visible = False in RowDataBound Event
In the GridView I want to hide the id column (whitch i also make links) after Binding. But if i hide it, i lose the paging. Any ideas
e.Row.Cells(0).Visible = False
e.Row.Cells(0).Visible = False
How are you creating the links with?
ASKER
Protected Sub grvGesellschaften_RowDataB ound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls. GridViewRo wEventArgs )
If e.Row.RowType = DataControlRowType.DataRow Then
Dim lnkGesellschaft As HyperLink = e.Row.FindControl("lnkGese llschaft")
lnkGesellschaft.NavigateUr l = "default.aspx?id=" & e.Row.Cells(0).Text.ToStri ng "
.......
.......
e.Row.Cells(0).Visible = False
End Sub
If e.Row.RowType = DataControlRowType.DataRow
Dim lnkGesellschaft As HyperLink = e.Row.FindControl("lnkGese
lnkGesellschaft.NavigateUr
.......
.......
e.Row.Cells(0).Visible = False
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I solved it with your second suggestion.
Thank you!!
Thank you!!