ASP.NET 2.0 Gridview select row in code problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jph
    New Member
    • Mar 2007
    • 12

    #1

    ASP.NET 2.0 Gridview select row in code problem

    Hello, anyone have found out how to select row in gridview in code?

    My problem is that on select command i populate another gridview based on first gridviews datakeyname's value and i highlight the selected row. Ok, no problems there, but when i change page and come back i need to highlight it again.

    I have tried on RowDataBound - event to catch the row im searching but problem is that i cant compare values because seems that e.Row.Cells(x). Text - command doesnt give results if cell is readonly/not visible. So question is: is there any ways on Row dataBound to get hidden fields values or any ideas how to go around the problem?
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by jph
    Hello, anyone have found out how to select row in gridview in code?

    My problem is that on select command i populate another gridview based on first gridviews datakeyname's value and i highlight the selected row. Ok, no problems there, but when i change page and come back i need to highlight it again.

    I have tried on RowDataBound - event to catch the row im searching but problem is that i cant compare values because seems that e.Row.Cells(x). Text - command doesnt give results if cell is readonly/not visible. So question is: is there any ways on Row dataBound to get hidden fields values or any ideas how to go around the problem?
    Please do not post questions in the articles section.
    Moved to the forum.

    Comment

    Working...