Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Gridview interaction with Detailsview

Reply
Thread Tools

Gridview interaction with Detailsview

 
 
nolan@easy.com
Guest
Posts: n/a
 
      08-07-2006
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

 
Reply With Quote
 
 
 
 
=?Utf-8?B?TXVoYW1tYWQgTW9zYQ==?=
Guest
Posts: n/a
 
      08-07-2006
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
>
>

 
Reply With Quote
 
 
 
 
nolan@easy.com
Guest
Posts: n/a
 
      08-07-2006
Thansk for the reply. Your suggestion got me on the right track. I
also had to databind my DetailsView after settings the SelectedIndex in
the DataBound Event of the GridView to get this to work. I appreciate
the help!


Muhammad Mosa wrote:
> 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
> >
> >


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Master - Detail with asp:GridView with no client interaction davidd ASP .Net 0 09-05-2006 03:10 PM
GridView Hierarchical View - Gridview in Gridview =?Utf-8?B?bWdvbnphbGVzMw==?= ASP .Net 1 05-09-2006 06:48 PM
Gridview inside Detailsview? ottawa111 ASP .Net 0 01-20-2006 07:56 PM
DetailsView - Changing to Insert Mode (Not By Using the Insert Button In the DetailsView Control) Feege ASP .Net Web Controls 0 12-20-2005 12:28 AM
Has anyone got ellipses working in a gridview or detailsview? RCS ASP .Net 3 12-02-2005 06:49 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57