Datagrid and events to perform essential task

G

Guest

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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top