Gridview and select

Discussion in 'ASP .Net Web Controls' started by cs_in_va, Jan 22, 2008.

  1. cs_in_va

    cs_in_va Guest

    I have an application that has 3 tables, vendors, supplies and
    vendor_supplies (this table identified what supplies the vendors
    supply)

    I trying to build a form with the gridview and a detail view, that
    works fine when I select "select" on the gridview the information is
    passed to the details view. I also have a checkboxlist that displays
    all the supplies from the supplies table. Now I need to somehow link
    these, so when I edit the vendor I can select the items they supply.

    I'm lost on where to go from here. Should I scrap the detailview and
    do with individual text boxes with a single update button to control
    both the updating of the vendor data and the updating of the
    vendor_supplies?

    How do I bind the text boxes to the table adapter I created for the
    detailview?
     
    cs_in_va, Jan 22, 2008
    #1
    1. Advertising

  2. cs_in_va

    Angel Guest

    I am not clear one hundred percent on what you're attempting.

    To bind a detailsview control to a table adapter or datatable do the following

    detailsview1.datasource = dt
    detailsview1.databind

    You can define fields for the detailsview programmatically

    dim bf as new BoundField
    bf.DataField = "ProductName"
    bf.HeaderText = "Product "
    DetailsView1.Fields.add(bf)

    You can also create templates field programmatically

    Dim t as new TemplateField
    t.HeaderText = "Supplier"
    t.ItemTemplate = New DetailsviewTDDSupps(ListItemType.Item)
    t.EditItemTemplate = New DetailsViewTDDSupps(ListItemType.EditItem)
    DetailsView1.Fields.Add(t)

    This gets really hairy because the reference to that weird name object is a
    Template class that you must implement in order to define placement of
    controls on the detailsview programmatically. There is references to the on
    the MSDN library but unfortunately not easy to find and when you do I think
    it refers to a formview control example but the principle is the same. I
    wrote an article for my user group entitled “Why is everything so darned
    declarative†in which I gripe to no end about this.

    If you’re under the gun or unsure about generating all this code then you
    might be better off making your own user control and be done with it. But,
    if for some reason, you want to pursue this path let me know I will make my
    ranting on the subject available to you.

    Perhaps I did not answer your question. If that’s the case I urge you to be
    more specific and provide a code sample.

    Regards
    --
    aaa


    "cs_in_va" wrote:

    > I have an application that has 3 tables, vendors, supplies and
    > vendor_supplies (this table identified what supplies the vendors
    > supply)
    >
    > I trying to build a form with the gridview and a detail view, that
    > works fine when I select "select" on the gridview the information is
    > passed to the details view. I also have a checkboxlist that displays
    > all the supplies from the supplies table. Now I need to somehow link
    > these, so when I edit the vendor I can select the items they supply.
    >
    > I'm lost on where to go from here. Should I scrap the detailview and
    > do with individual text boxes with a single update button to control
    > both the updating of the vendor data and the updating of the
    > vendor_supplies?
    >
    > How do I bind the text boxes to the table adapter I created for the
    > detailview?
    >
    >
    >
     
    Angel, Jan 24, 2008
    #2
    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. =?Utf-8?B?RGFiYmxlcg==?=

    select gridview row without using select button?

    =?Utf-8?B?RGFiYmxlcg==?=, Mar 3, 2006, in forum: ASP .Net
    Replies:
    5
    Views:
    101,636
    dch31969
    Feb 27, 2009
  2. =?Utf-8?B?bWdvbnphbGVzMw==?=

    GridView Hierarchical View - Gridview in Gridview

    =?Utf-8?B?bWdvbnphbGVzMw==?=, May 9, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    18,046
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
    May 9, 2006
  3. Laszlo Nagy

    select.select and socket.setblocking

    Laszlo Nagy, Dec 30, 2008, in forum: Python
    Replies:
    12
    Views:
    1,239
    Roy Smith
    Jan 3, 2009
  4. Jean-Paul Calderone

    Re: select.select and socket.setblocking

    Jean-Paul Calderone, Dec 30, 2008, in forum: Python
    Replies:
    1
    Views:
    337
    Francesco Bochicchio
    Dec 31, 2008
  5. palmiere
    Replies:
    1
    Views:
    473
    Erwin Moller
    Feb 9, 2004
Loading...

Share This Page