473,378 Members | 1,037 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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 1275
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...

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.