NEED HELP please! retrieving checked items to a textbox

T

TN Bella

My datgrid displays the data when the checkbox is checked to a
label...can someone help me make it display to textboxes instead?
Textboxes are: txtSupName, txtSupCD, and txtSupsfx.

<asp:Datagrid id="MyDataGrid" runat="server"
GridLines="Both" cellpadding="3" cellspacing="0"
Headerstyle-BackColor="#ff6633" Headerstyle-Font-Name="Verdana"
Headerstyle-Font-Size="8" AlternatingItemStyle-BackColor="#ff6633"
BackColor="#CCCCCC" Font-Name="Verdana" Font-Size="8"
BorderColor="#000000" AutogenerateColumns="False">
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<asp:checkbox id="mycheckbox"
runat="server"></asp:checkbox>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Supplier Name">
<ItemTemplate>
<asp:Label id="lblName" runat="server"
text='<%# DataBinder.Eval(Container.DataItem, "splr_name") %>' />
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Supplier Code">
<ItemTemplate>
<asp:Label id="lblCode" runat="server"
text='<%# DataBinder.Eval(Container.DataItem, "supplier_cd") %>' />
</ItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn Datafield="splr_sfx"
HeaderText="Pay Point"></asp:BoundColumn>
<asp:BoundColumn Datafield="splr_addr"
HeaderText="Address"></asp:BoundColumn>
<asp:BoundColumn Datafield="splr_city"
HeaderText="City"></asp:BoundColumn>
<asp:BoundColumn Datafield="splr_state"
HeaderText="State"></asp:BoundColumn>
</Columns>
</asp:Datagrid>


Sub GetItems(Source as Object, E as EventArgs)
pnl1.visible="false"
pnl2.visible="false"
pnl3.visible="true"
pnl4.visible="false"

Dim GridItem As DataGridItem
Dim chkbox as System.Web.UI.WebControls.checkbox
Dim SName, SCode, Spay as String
For Each GridItem in MyDataGrid.Items
chkbox = GridItem.FindControl("Mycheckbox")
If chkbox.Checked Then
sName=CType(GridItem.FindControl("lblName"),
Label).Text & " " & _
CType(GridItem.FindControl("lblCode"),
Label).Text
sPay=GridItem.Cells(3).Text
sPay += sName & sCode & ", "
End If
Next
sPay=sPay.Substring(0,sPay.length-2)
label1.text="<b>You Chose :</b> <br>" & sPay
End Sub



*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 

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

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top