473,748 Members | 6,037 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

UpdatePanel and Gridview / DetailsView

I have a page with a LoginView which contains a Gridview and a
DetailsView, each in its own UpdatePanel

The problem that I am experiencing is that when I select a record in
the Gridview (using a SelectButton), the selected record is shown in
the DetailsView, which is correct - however, when I choose "Update" on
the DetailsView I am presented with the EditItemTemplat e which
contains the first record in the DetailsDataSour ce.

The code that changes the selected record in the DetailsView is in the
GridView1.Selec tedIndexChanged event as:

protected void GridView1_Selec tedIndexChanged (object sender, EventArgs
e)
{
GridView gv1 =
(GridView)Login View1.FindContr ol("GridView1") ;
DetailDataSourc e.FilterExpress ion = "ID='" +
gv1.SelectedVal ue.ToString()+" '";
}

Clicking the "Select" button on the GridView while the DetailsView is
in either "ReadOnly" or "Edit" modes loads the DetailsView with the
correct record - but switching views causes the record to go back to
the default (1st) record.

I am wondering if the update panels may be causing the problem -
should everything be in a single update panel?
It's my first time playing with the control so I'm not sure about all
of the intricacies with it yet.
Any help would be greatly appreciated.

Mike

Feb 16 '07 #1
2 11634
Hi,

quickly thinking it indeed sounds as if they should be in a single
updatepanel when change in other flows immediately to the another control
(otherwise you'd need to trigger updates for the panels). This is just
guessing, but try putting them into single UpdatePanel first.
--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net

<mi**@5starserv .comwrote in message
news:11******** **************@ t69g2000cwt.goo glegroups.com.. .
>I have a page with a LoginView which contains a Gridview and a
DetailsView, each in its own UpdatePanel

The problem that I am experiencing is that when I select a record in
the Gridview (using a SelectButton), the selected record is shown in
the DetailsView, which is correct - however, when I choose "Update" on
the DetailsView I am presented with the EditItemTemplat e which
contains the first record in the DetailsDataSour ce.

The code that changes the selected record in the DetailsView is in the
GridView1.Selec tedIndexChanged event as:

protected void GridView1_Selec tedIndexChanged (object sender, EventArgs
e)
{
GridView gv1 =
(GridView)Login View1.FindContr ol("GridView1") ;
DetailDataSourc e.FilterExpress ion = "ID='" +
gv1.SelectedVal ue.ToString()+" '";
}

Clicking the "Select" button on the GridView while the DetailsView is
in either "ReadOnly" or "Edit" modes loads the DetailsView with the
correct record - but switching views causes the record to go back to
the default (1st) record.

I am wondering if the update panels may be causing the problem -
should everything be in a single update panel?
It's my first time playing with the control so I'm not sure about all
of the intricacies with it yet.
Any help would be greatly appreciated.

Mike
Feb 16 '07 #2
Teemu,

Thanks for your help! I placed the controls inside a single
UpdatePanel and changed a couple of setting in the DataSources and I
have it working nicely. Thanks again!

Mike

On Feb 16, 2:09 pm, "Teemu Keiski" <jot...@aspalli ance.comwrote:
Hi,

quickly thinking it indeed sounds as if they should be in a single
updatepanel when change in other flows immediately to the another control
(otherwise you'd need to trigger updates for the panels). This is just
guessing, but try putting them into single UpdatePanel first.

--
Teemu Keiski
AspInsider, ASP.NET MVPhttp://blogs.aspadvice .com/jotekehttp://teemukeiski.net

<m...@5starserv .comwrote in message

news:11******** **************@ t69g2000cwt.goo glegroups.com.. .
I have a page with a LoginView which contains a Gridview and a
DetailsView, each in its own UpdatePanel
The problem that I am experiencing is that when I select a record in
the Gridview (using a SelectButton), the selected record is shown in
the DetailsView, which is correct - however, when I choose "Update" on
the DetailsView I am presented with the EditItemTemplat e which
contains the first record in the DetailsDataSour ce.
The code that changes the selected record in the DetailsView is in the
GridView1.Selec tedIndexChanged event as:
protected void GridView1_Selec tedIndexChanged (object sender, EventArgs
e)
{
GridView gv1 =
(GridView)Login View1.FindContr ol("GridView1") ;
DetailDataSourc e.FilterExpress ion = "ID='" +
gv1.SelectedVal ue.ToString()+" '";
}
Clicking the "Select" button on the GridView while the DetailsView is
in either "ReadOnly" or "Edit" modes loads the DetailsView with the
correct record - but switching views causes the record to go back to
the default (1st) record.
I am wondering if the update panels may be causing the problem -
should everything be in a single update panel?
It's my first time playing with the control so I'm not sure about all
of the intricacies with it yet.
Any help would be greatly appreciated.
Mike- Hide quoted text -

- Show quoted text -

Feb 17 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1874
by: jeffmagill | last post by:
Hi Everybody, I'm really hoping that someone can help me out because I have spent too much time on this project already! Basically, I have a DetailsView that handles all the Edits for a GridView - each row has an edit button and clicking on this should trigger that record to be loaded into the DetailsView for editing. The problem is that the record never gets loaded into the DetailsView. Instead, the DetailsView always and only...
2
6249
by: nolan | last post by:
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...
0
2127
by: luvdairish | last post by:
Controls (in order on page) 1.)GridView - each row is a work order w/ a link for details in the last column 2.)DetailsView - when user clicks on link from above GridView, the details are shown 3.)GridView - nested in the footer of the above DetailsView. each row is a person assigned to that work order 4.)DetailsView - only visible when the user clicks "add tech" in the DetailsView from #2 (above). allows technician to be added to work...
0
1595
by: luvdairish | last post by:
Controls (in order on page) 1.)GridView - each row is a work order w/ a link for details in the last column 2.)DetailsView - when user clicks on link from above GridView, the details are shown 3.)GridView - nested in the footer of the above DetailsView. each row is a person assigned to that work order 4.)DetailsView - only visible when the user clicks "add tech" in the DetailsView from #2 (above). allows technician to be added to work...
1
5025
by: needhelp1 | last post by:
I have gridview with a detailsview below. When I click on 'New' in brings up the DetailsView for inserting. When I click on 'Edit' in does not brink up the DetailsView. What am I doing wrong? I totally at a loss, please help. I don't know if I need to something to grdUserProfile_RowEditing. Thank you! This is some of my code behind: protected void grdUserProfile_RowEditing(object sender, GridViewEditEventArgs e) { } protected void...
1
3073
by: SachinSachin | last post by:
Hi All, I am implementing a custom gridview control, that emits some javascript to blink a row whenever a new row is added in gridview. The gridview is inside the <asp:updatepanel> for parital page rendering. The problem is when I put the gridview inside the updatepanel, I don't see the HTML table that is created as a result from rendering the gridviewcontrol and thus when new row is added, it does not blink, however when i just put the...
0
2960
by: Jeff | last post by:
hey asp.net 3.5 I have 2 UpdatePanels in my webpage. This webpage has a GridView, which one of its column is a templatefield which again contain a UpdatePanel and a button... The other UpdatePanel is located outside the GridView....
2
2514
by: bogdan | last post by:
Hi, Can a single GridView be 'connected' to DetailsView that renders itself differently based on the currently selected row? I have a GridView with rows that could be displayed in the same way in the view (like a report) but when a user wants to edit/insert items I'd like to show a different layout and different controls based on the selected item type. For example, for some items I'd like to provide text boxes and for others I'd like...
13
3511
by: SAL | last post by:
Hello, I'm trying to include a popup in the ItemTemplate of a gridview row. The ItemTemplate for the field contains a textbox and when the user clicks in the textbox I want a popup panel to show allowing the user to make a selection from the popup window. I have enabled AJAX extensions and have a working sample outside of a gridview. However, when I click in the textbox of a gridview row, all I see is a really small square instead of the...
0
8830
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9247
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8243
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6796
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6074
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4606
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4874
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2783
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.