Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > NEED HELP please! retrieving checked items to a textbox

Reply
Thread Tools

NEED HELP please! retrieving checked items to a textbox

 
 
TN Bella
Guest
Posts: n/a
 
      06-22-2004
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

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CheckBox Checked=false when checked in DataList yurps ASP .Net 1 02-29-2008 01:08 PM
Is there any way to append some items to List box, without retrieving all items through AJAX? Anjan Bhowmik ASP .Net 1 02-14-2008 09:02 PM
Retrieving Asp.treeview checked checkbox information jeeji ASP .Net Web Controls 2 06-16-2006 08:52 AM
help pls. textbox required only when checkbox is checked (help with validation) Emiliano ASP .Net Web Controls 2 10-16-2003 09:09 PM
Retrieving checked RadioButton controls which were added to a Table control Anthony Williams ASP .Net Web Controls 10 09-16-2003 09:43 AM



Advertisments