Mater-Detail

Discussion in 'ASP .Net Web Controls' started by Fabiano, Apr 29, 2004.

  1. Fabiano

    Fabiano Guest

    Please,

    i need to create a web page that show data from an ORDER table. But when the
    user browses over the records, dropdownlist, radiobuttons and others bounded
    controls must refresh they data, such as Credit Card, Supplyer, and on.

    How can i do this, using programatically Datasets? Everything automatic.

    When browse refresh, when ADD button is clicked every control must be
    cleared and accept data entry.

    Tks a lot.

    Fabiano
     
    Fabiano, Apr 29, 2004
    #1
    1. Advertising

  2. Hi Fabinao,

    From your description, you'd like to build a master detailed databind
    asp.net webform page. In the page you use a DataGrid to display the main
    records and when one recored in the datagrid is selected, those textboxes
    or dropdownlists or .. will be filled with the certain selected record's
    detailed data. And when we want to add record, those fields will be cleared
    ,yes?

    As for this problem, here are my suggestions:
    1. Retrieved the master-detailed datas from the databse when the web form
    page is first time loaded(using DataSet). Then store them in some place for
    later use, maybe in Session or ViewState.

    2. Then bind the master table's records with the DataGrid control, note you
    need to provide a button column in the datagrid which is used to let the
    user select a certain row of record. When first time loaded, bind those
    textboxes or dropdownlist's value with the first record's detailed value.

    3. Then when a certain record's row's button is clicked, in the
    serverside's click event(datagrid's itemcommand event) retrieve the certain
    selected record's datas and fill them in the textboxes or dropdownlists....

    4. If you want to provide insert function, you can add a "Add" button and
    in its "click" event, you can use code to clear all the textboxes or other
    fields' value and let the user to input new record's value. And then after
    user click submit, in the submit button's click event, insert the new
    record and update the local dataset.

    If you fill it abit too complex, you can view the following turoial in the
    ASP.NET Quickstart:

    http://samples.gotdotnet.com/quickstart/aspplus/doc/webdataaccess.aspx

    http://samples.gotdotnet.com/quickstart/aspplus/doc/webdatalist.aspx

    Also, here are some more detailed tech articles on master-detailed
    databinding:
    #HOW TO: Create a Master/Detail Page with Web Form Controls
    http://support.microsoft.com/?id=308485

    #Master-Detail DataGrids in ASP.Net...
    http://www.dotnetjohn.com/articles/articleid14.aspx

    #Creating Master-Detail Listings using ASP.NET controls
    http://www.dotnetbips.com/displayarticle.aspx?id=184

    #Building DataBound Templated Custom ASP.NET Server Controls
    http://msdn.microsoft.com/library/en-us/dnaspp/html/databoundtemplatedcontro
    ls.asp?frame=true

    Hope also helps. Thanks.

    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)

    Get Preview at ASP.NET whidbey
    http://msdn.microsoft.com/asp.net/whidbey/default.aspx
     
    Steven Cheng[MSFT], Apr 29, 2004
    #2
    1. Advertising

  3. Fabiano

    Fabiano Guest

    Something like this. Your answer helped me a lot. But what i would like to
    do is something without a DataGrid.

    Something like "a contact page" with lots of textboxes and a dropdownlist.
    When user is navigating through it every DDL must show related data from
    table.

    Something like a lookupcombbox as named at Delphi. Or DDL databinding
    allowed at winforms.

    tks if u can help me again.

    Fabiano


    "Steven Cheng[MSFT]" <> escreveu na mensagem
    news:...
    > Hi Fabinao,
    >
    > From your description, you'd like to build a master detailed databind
    > asp.net webform page. In the page you use a DataGrid to display the main
    > records and when one recored in the datagrid is selected, those textboxes
    > or dropdownlists or .. will be filled with the certain selected record's
    > detailed data. And when we want to add record, those fields will be

    cleared
    > ,yes?
    >
    > As for this problem, here are my suggestions:
    > 1. Retrieved the master-detailed datas from the databse when the web form
    > page is first time loaded(using DataSet). Then store them in some place

    for
    > later use, maybe in Session or ViewState.
    >
    > 2. Then bind the master table's records with the DataGrid control, note

    you
    > need to provide a button column in the datagrid which is used to let the
    > user select a certain row of record. When first time loaded, bind those
    > textboxes or dropdownlist's value with the first record's detailed value.
    >
    > 3. Then when a certain record's row's button is clicked, in the
    > serverside's click event(datagrid's itemcommand event) retrieve the

    certain
    > selected record's datas and fill them in the textboxes or

    dropdownlists....
    >
    > 4. If you want to provide insert function, you can add a "Add" button and
    > in its "click" event, you can use code to clear all the textboxes or other
    > fields' value and let the user to input new record's value. And then after
    > user click submit, in the submit button's click event, insert the new
    > record and update the local dataset.
    >
    > If you fill it abit too complex, you can view the following turoial in the
    > ASP.NET Quickstart:
    >
    > http://samples.gotdotnet.com/quickstart/aspplus/doc/webdataaccess.aspx
    >
    > http://samples.gotdotnet.com/quickstart/aspplus/doc/webdatalist.aspx
    >
    > Also, here are some more detailed tech articles on master-detailed
    > databinding:
    > #HOW TO: Create a Master/Detail Page with Web Form Controls
    > http://support.microsoft.com/?id=308485
    >
    > #Master-Detail DataGrids in ASP.Net...
    > http://www.dotnetjohn.com/articles/articleid14.aspx
    >
    > #Creating Master-Detail Listings using ASP.NET controls
    > http://www.dotnetbips.com/displayarticle.aspx?id=184
    >
    > #Building DataBound Templated Custom ASP.NET Server Controls
    >

    http://msdn.microsoft.com/library/en-us/dnaspp/html/databoundtemplatedcontro
    > ls.asp?frame=true
    >
    > Hope also helps. Thanks.
    >
    > Regards,
    >
    > Steven Cheng
    > Microsoft Online Support
    >
    > Get Secure! www.microsoft.com/security
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    >
    > Get Preview at ASP.NET whidbey
    > http://msdn.microsoft.com/asp.net/whidbey/default.aspx
    >
     
    Fabiano, Apr 29, 2004
    #3
  4. Hi Fabianao,

    Thanks for the followup. As for the
    ==================
    Something like "a contact page" with lots of textboxes and a dropdownlist.
    When user is navigating through it every DDL must show related data from
    table.
    And not use DataGrid
    ===================
    you mentioned, do you meand that you're wanting to generate a certain
    records navigate page which only show each record's detailed datas and have
    some navigate buttons such as
    <<First <Previous >Next >>Last ?
    Is is like the following layout?
    ------------------------------------------------------------------
    textbox textbox textbox dropdownlist |
    textbox textbox textbox dropdownlist | ------ databinding
    controls
    textbox textbox textbox dropdownlist |

    << < > >>
    | ----------navigate buttons
    First Previous Next Last |



    If so, I think it's just something as I mentioned in the last reply. You
    can Retrive all the records when the page first time loaded and store in a
    certain place (Session or page's ViewState), otherwise you need to retrieve
    them(put in a DataSet) from database everytime the navigate button is
    clicked.

    Then, when the user click navigator button and the page posted back, you
    retieve the certain record's data from the stored DataSet and then replace
    all the controls on the page with the new values. All these operations are
    common data retrieveing and databinding ops, you may view the weblinks in
    my last reply for detailed reference.
    Also, if you feel anything unclear, please feel free to post here. thanks.

    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)

    Get Preview at ASP.NET whidbey
    http://msdn.microsoft.com/asp.net/whidbey/default.aspx
     
    Steven Cheng[MSFT], Apr 30, 2004
    #4
    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?RWQ=?=

    Mater Pages and Cross-page Postbacks.

    =?Utf-8?B?RWQ=?=, Jun 23, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    435
    =?Utf-8?B?QXR1bCBCYWhs?=
    Jul 25, 2005
  2. cplusplus

    MATER

    cplusplus, Oct 26, 2007, in forum: C++
    Replies:
    2
    Views:
    423
    Default User
    Oct 26, 2007
  3. ghelbig
    Replies:
    0
    Views:
    472
    ghelbig
    Sep 18, 2008
  4. Arun Kumar Menon

    Master Detail detail

    Arun Kumar Menon, Aug 6, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    218
    Arun Kumar Menon
    Aug 6, 2003
  5. Frederik Borg

    ASp.net data binding: Master-detail-detail

    Frederik Borg, Jun 9, 2006, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    380
    Frederik Borg
    Jun 9, 2006
Loading...

Share This Page