kahvedzic
asked on
Focus on selected GridVIew row asp.net
Hi,
Have a GridView in asp panel and without scrolling I can see 11 rows, but when I scroll and select some other row on postback I have to scroll again. How can I leave focus on selected row?vb is code-behind.
Thanks.
Have a GridView in asp panel and without scrolling I can see 11 rows, but when I scroll and select some other row on postback I have to scroll again. How can I leave focus on selected row?vb is code-behind.
Thanks.
u can save selected row index and after postback scroll back to this row index using FirstDisplayedScrollingRow Index property
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
add
gridview1.SelectedRow.Focu s()
to page load and still have to scroll.
gridview1.SelectedRow.Focu
to page load and still have to scroll.
put it on your gridview ,rowCommand event
ASKER
now that is what I want. Thanks
Protected Sub GridView1_SelectedIndexCha nged(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.SelectedIndexCha nged
GridView1.SelectedRow.Focu s()
End Sub
Protected Sub GridView1_SelectedIndexCha
GridView1.SelectedRow.Focu
End Sub
so, if your event was selectedindexchanged then you must put it in this event.
Glad to help,
Regards,
Glad to help,
Regards,