Link to home
Start Free TrialLog in
Avatar of lanter007
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
Avatar of Obadiah Christopher
Obadiah Christopher
Flag of India image

How are you creating the links with?
Avatar of lanter007
lanter007

ASKER

   Protected Sub grvGesellschaften_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs)

        If e.Row.RowType = DataControlRowType.DataRow Then


            Dim lnkGesellschaft As HyperLink = e.Row.FindControl("lnkGesellschaft")
            lnkGesellschaft.NavigateUrl = "default.aspx?id=" & e.Row.Cells(0).Text.ToString "
.......
.......
e.Row.Cells(0).Visible = False


End Sub
ASKER CERTIFIED SOLUTION
Avatar of Obadiah Christopher
Obadiah Christopher
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I solved it with your second suggestion.
Thank you!!