473,472 Members | 2,257 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Datagrid and events to perform essential task

I have an the below datagrid which displays as follows: -

ADDRESS
Databound SELECT
Databound SELECT
Databound SELECT

I need to to some sort of event which takes the value from the databound
cell and displays it in a asp table when the select(linkbutton) is clicked.
Id also like to add the value in the databound cell into an array. Could
someone please help me do this, I would be really really grateful. The html
code for the datagrid is displayed below and I also included the code for the
asp:table below. I want the value to be displayed in the

Datagrid html code:

<asp:datagrid id="dgResults" runat="server" Width="487px"
AutoGenerateColumns="False" OnItemCommand="dgResults_ItemCommand">
<HeaderStyle Height="20px" Font-Bold="False" BackColor="#666699"
ForeColor="#ffffff"></HeaderStyle><Columns>
<asp:BoundColumn DataField="Preview" HeaderText="Address"
HeaderStyle-Font-Bold="True">
<ItemStyle Font-Size="10pt" Height="11px" ForeColor="#666699"
CssClass="A"></ItemStyle>
</asp:BoundColumn>
<asp:ButtonColumn ButtonType="LinkButton" ItemStyle-Font-Bold="True"
Text="Select" CommandName="Select">
<ItemStyle Font-Size="10pt" Height="11px" ForeColor="#666699"
CssClass="A"></ItemStyle>
</asp:ButtonColumn>
<asp:BoundColumn DataField="tag" HeaderText="Tag" Visible="False">
<ItemStyle Font-Size="10pt" Height="11px" ForeColor="#666699"
CssClass="A"></ItemStyle>
</asp:BoundColumn>
</Columns>
</asp:datagrid>

ASP table code: I want the values of the databound cells to appear in the
labels.

<asp:table id="tblSearchAddresses" Runat="server" Width="100%">
<asp:TableRow>
<asp:TableCell>
<asp:Label ID="lblAddress1" Runat="server"></asp:Label>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell>
<asp:Label ID="lblAddress2" Runat="server"></asp:Label>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell>
<asp:Label ID="lblAddress3" Runat="server"></asp:Label>
</asp:TableCell>
</asp:TableRow>
</asp:table>
Jul 21 '05 #1
1 1281
Stephen,

You want to look at the "DataGrid_Command" event and the "Items" collection
of the datagrid. Goto www.datagridgirl.com for good examples of what you can
do with the datagrid.

Another good example:
http://www.ragingsmurf.com/code.aspx?key=KI54D3MG8Y

"Stephen" wrote:
I have an the below datagrid which displays as follows: -

ADDRESS
Databound SELECT
Databound SELECT
Databound SELECT

I need to to some sort of event which takes the value from the databound
cell and displays it in a asp table when the select(linkbutton) is clicked.
Id also like to add the value in the databound cell into an array. Could
someone please help me do this, I would be really really grateful. The html
code for the datagrid is displayed below and I also included the code for the
asp:table below. I want the value to be displayed in the

Datagrid html code:

<asp:datagrid id="dgResults" runat="server" Width="487px"
AutoGenerateColumns="False" OnItemCommand="dgResults_ItemCommand">
<HeaderStyle Height="20px" Font-Bold="False" BackColor="#666699"
ForeColor="#ffffff"></HeaderStyle><Columns>
<asp:BoundColumn DataField="Preview" HeaderText="Address"
HeaderStyle-Font-Bold="True">
<ItemStyle Font-Size="10pt" Height="11px" ForeColor="#666699"
CssClass="A"></ItemStyle>
</asp:BoundColumn>
<asp:ButtonColumn ButtonType="LinkButton" ItemStyle-Font-Bold="True"
Text="Select" CommandName="Select">
<ItemStyle Font-Size="10pt" Height="11px" ForeColor="#666699"
CssClass="A"></ItemStyle>
</asp:ButtonColumn>
<asp:BoundColumn DataField="tag" HeaderText="Tag" Visible="False">
<ItemStyle Font-Size="10pt" Height="11px" ForeColor="#666699"
CssClass="A"></ItemStyle>
</asp:BoundColumn>
</Columns>
</asp:datagrid>

ASP table code: I want the values of the databound cells to appear in the
labels.

<asp:table id="tblSearchAddresses" Runat="server" Width="100%">
<asp:TableRow>
<asp:TableCell>
<asp:Label ID="lblAddress1" Runat="server"></asp:Label>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell>
<asp:Label ID="lblAddress2" Runat="server"></asp:Label>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell>
<asp:Label ID="lblAddress3" Runat="server"></asp:Label>
</asp:TableCell>
</asp:TableRow>
</asp:table>

Jul 21 '05 #2

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

Similar topics

2
by: Douglas Buchanan | last post by:
Some say there is no new row event for the VB.Net DataGrid. Hard to believe! Is that really true? I want to create a GUID in a hidden ID column when the user begins to enter data into a new row....
4
by: LP | last post by:
Hello! I am still transitioning from VB.NET to C#. I undertand the basic concepts of Delegates, more so of Events and somewhat understand AsyncCallback methods. But I need some clarification on...
5
by: John Richardson | last post by:
I've been bothered for some time about my DataGrid not populating my rows very quickly. I have about 10K rows loading into the grid. I create a datatable dt with 2 columns, an ID and a display. ...
2
by: Mark | last post by:
I have a repetitive task where I need to edit a table in SQL Server through a web page. Nothing fancy, just populate a datagrid and use the commands Insert/Update/Delete/Cancel. Is there a...
1
by: Stephen | last post by:
I have an the below datagrid which displays as follows: - ADDRESS Databound SELECT Databound SELECT Databound SELECT I need to to some sort of event...
9
by: BK | last post by:
In VB.Net (1.1 framework), I have a datagrid that displays records from a SQL table. Only some of the columns are editable. When the user changes data in 2 and only 2 of the columns, I want to...
10
by: amiga500 | last post by:
Hello, I have one basic simple question. When I have multiple records in the datagrid as follows: Code Product 1 Product 2 Product 3 11111 A B C...
2
by: =?Utf-8?B?QW5kcmV3IFN0b2tlcw==?= | last post by:
Hi I have a usercontrol which contains ajax toolkit controls which I am using in a SharePoint siite. When the user clicks one of the buttons on the page it fires a series of events server side...
2
by: =?Utf-8?B?QW5kcmV3IFN0b2tlcw==?= | last post by:
Hi I have a usercontrol which contains ajax toolkit controls which I am using in a SharePoint siite. When the user clicks one of the buttons on the page it fires a series of events server side...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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
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
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
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 ...
0
muto222
php
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.