HighTechTalks DotNet Forums  

NEED HELP please! retrieving checked items to a textbox

ASP.net Data Grid Control microsoft.public.dotnet.framework.aspnet.datagridcontrol


Discuss NEED HELP please! retrieving checked items to a textbox in the ASP.net Data Grid Control forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
TN Bella
 
Posts: n/a

Default NEED HELP please! retrieving checked items to a textbox - 06-22-2004 , 10:29 AM






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.

<aspatagrid 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>
</aspatagrid>


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!

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.