set the SelectedIndex of your GridView in the DataBound Event of your GridView
It shoud work
Regards,
--
Muhammad Mosa
Software Engineer & Solution Developer
MCT/MCSD.NET
MCTS: .Net 2.0 Web Applications
MCTS: .Net 2.0 Windows Applications
"" wrote:
> I have an asp.net 2.0 page with a gridview and detailsview on the same
> page set up in a master-details scenario. The gridview and detailsview
> have separate SQL data sources. The user enters search criteria in a
> text box and clicks a find button to initially populate the gridview
> with items of interest. I have added a select button to my gridview
> and when the user clicks the button the detailsview is populated
> perfectly. However, I also want the detailsview to be automatically
> populated with the first item in the gridview after the user clicks the
> find button. I have programatically set the SelectedIndex for the
> gridview to zero in the Selected event for the SQL datasource that
> drives my gridview, but this doesn't update the detailsview until I
> execute another postback. How can I make this work?
>
> Thanks!
>
> Jeff
>
>
|