NEED HELP please! retrieving checked items to a textbox

Discussion in 'ASP .Net Datagrid Control' started by TN Bella, Jun 22, 2004.

  1. TN Bella

    TN Bella Guest

    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!
    TN Bella, Jun 22, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. yurps
    Replies:
    1
    Views:
    6,887
    rajeshthangarasu1983
    Feb 29, 2008
  2. Anjan Bhowmik
    Replies:
    1
    Views:
    473
    Misbah Arefin
    Feb 14, 2008
  3. Anthony Williams
    Replies:
    10
    Views:
    585
    Anthony Williams
    Sep 16, 2003
  4. Emiliano
    Replies:
    2
    Views:
    322
    Rajesh.V
    Oct 16, 2003
  5. jeeji

    Retrieving Asp.treeview checked checkbox information

    jeeji, Jun 15, 2006, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    437
    jeeji
    Jun 16, 2006
Loading...

Share This Page