473,505 Members | 13,823 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is it possible to update a detailsview with a gridview in Atlas?

Hi, I have a gridview and a detailsview. Is it possible to select a
row in the gridview, not have a postback, and instead have a
detailsview populate based upon the gridview - in Atlas, no postbacks?

Thanks.

Apr 24 '06 #1
1 1403
You could add an UpdatePanel, put the DetailsView in its
ContentTemplate, add an event trigger for the gridview control on
SelectedIndexChanged, and rebind the DetailsView serverside.

Something like:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
AutoGenerateSelectButton="True"
DataKeyNames="ProductID" DataSourceID="SqlDataSource1"
OnSelectedIndexChanged="GridView1_SelectedIndexCha nged">
<Columns>
<asp:BoundField DataField="ProductID"
HeaderText="ProductID" InsertVisible="False"
ReadOnly="True" SortExpression="ProductID" />

</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="SELECT [ProductID] FROM [Alphabetical list
of products]">
</asp:SqlDataSource>
<br />
<br />

<atlas:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
<asp:Label ID="Label3" runat="server"
Text="Label"></asp:Label>
</ContentTemplate>
<Triggers>
<atlas:ControlEventTrigger ControlID="GridView1"
EventName="SelectedIndexChanged" />
</Triggers>
</atlas:UpdatePanel>
---
protected void GridView1_SelectedIndexChanged(object sender, EventArgs
e)
{
Label3.Text =
GridView1.SelectedDataKey.Values["ProductID"].ToString();
}

Apr 26 '06 #2

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

Similar topics

0
1872
by: rob merritt | last post by:
Hi I am trying to update via an datagrid only nothing seems to happen how would I diplay what the update query looks like msgbox reponse.write? where do I put em? <%@ Page Language="C#" %> ...
1
402
by: Jim McGivney | last post by:
In VS-05 on an aspx page I have a GridView with a select item column. When the select button is pressed a DetailsView control opens with the selected record displayed. The user can now edit the...
7
4526
by: AG | last post by:
Hi, ASP.NET 2.0 web app I have a GridView utilizing template columns and bound to an objectdatasource. In the edit template of one column there is a dropdownlist bound to another...
0
1411
by: Oystein | last post by:
Hi! I've got a aspx page with a textbox, a detailsview and a gridview. In the textbox i enter a jobnumber. If the jobnumber exists in the table, the detailsview shows the columns in the table in...
4
2289
by: ccshine | last post by:
I have several textboxes, a gridview and an image in a panel that need to be updated based upon info entered into a textbox. Everything works like a champ when I don't use the Atlas UpdatePanel,...
4
12537
by: Tomasz | last post by:
Hello Developers, Here is interesting problem I just came across: how do I wire a GridView control programmatically? Here is my sample code using Object Data Source: protected void...
3
2054
by: dhaneshrs | last post by:
I have a gridview i managed to update using the edit option in the smartmenu. The problem comes when i delete a value or make a value read only. Say i have a table Employee with the following...
1
4990
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...
2
2494
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...
0
7213
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7098
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...
0
7298
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7366
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...
0
7471
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...
0
5610
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,...
0
4698
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...
0
3187
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...
0
1526
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.