Data Maintenance Using Formviews

Discussion in 'ASP .Net Web Controls' started by ZZ_Scarab, Aug 23, 2007.

  1. ZZ_Scarab

    ZZ_Scarab Guest

    Hi,

    I'm new to the combined C#/ASP.Net environment and have a requirement to
    maintain data in a record by record display. I started by using the FormView
    control but it is proving to be very tedious for the following reasons:

    1. I have to create several templates for display, edit, empty row, insert,
    etc.
    2. I need the controls to look the same wrt position, size, etc. on all the
    templates, and that's not proving to be easy.
    3. Some controls, e.g. radio buttons expect a boolean whereas the values in
    the database might be Yes/No or some other character value, so direct data
    binding doesn't work.
    4. I tried two-way binding of the controls, and switching the ReadOnly
    properties between True and False, but some controls, e.g. DropDownList, do
    not have such a property!!
    5. Trying to access the different fields in the templates to bind them to
    the insert/update query parameters is, to say the least, not straightforward
    at all in that I have to use the FindControl function, and if my controls
    have the same names in the different templates, it gets confused.
    6. There is no "Cancel" CommandName so I can allow the user to back out of
    changes already made prior to the Update operation executed.
    7. All this works flawlessly and effortlessly in the GridView control since
    all the operations, display changes, etc. are all carried out automatically
    by the control, but there does not seem to be a similar default behavior for
    the FormView control, or is it there and I'm just missing it?

    I also am trying just using straight controls without the FormView control
    and using code to copy field values between the controls and the database
    queries. This sounds like it ought to be simpler, but I'm thinking that
    Microsoft must have created the Formview for a very good reason and that I'm
    probably not using it correctly.

    Can anybody please give me some advice on this?

    Thanks
     
    ZZ_Scarab, Aug 23, 2007
    #1
    1. Advertising

  2. ZZ_Scarab

    Duffau Guest

    All of your problems have solutions which you have already
    acknowledged. If you don't like the supplied Formview, then create
    your own. I know that it is more work for you but that is the price
    to pay.

    For instance, with very little work you could easily change your
    database from 'yes no' to 'true false'.

    Don't be lazy.





    On Thu, 23 Aug 2007 10:32:48 -0700, "ZZ_Scarab"
    <> wrote:

    >Hi,
    >
    >I'm new to the combined C#/ASP.Net environment and have a requirement to
    >maintain data in a record by record display. I started by using the FormView
    >control but it is proving to be very tedious for the following reasons:
    >
    >1. I have to create several templates for display, edit, empty row, insert,
    >etc.
    >2. I need the controls to look the same wrt position, size, etc. on all the
    >templates, and that's not proving to be easy.
    >3. Some controls, e.g. radio buttons expect a boolean whereas the values in
    >the database might be Yes/No or some other character value, so direct data
    >binding doesn't work.
    >4. I tried two-way binding of the controls, and switching the ReadOnly
    >properties between True and False, but some controls, e.g. DropDownList, do
    >not have such a property!!
    >5. Trying to access the different fields in the templates to bind them to
    >the insert/update query parameters is, to say the least, not straightforward
    >at all in that I have to use the FindControl function, and if my controls
    >have the same names in the different templates, it gets confused.
    >6. There is no "Cancel" CommandName so I can allow the user to back out of
    >changes already made prior to the Update operation executed.
    >7. All this works flawlessly and effortlessly in the GridView control since
    >all the operations, display changes, etc. are all carried out automatically
    >by the control, but there does not seem to be a similar default behavior for
    >the FormView control, or is it there and I'm just missing it?
    >
    >I also am trying just using straight controls without the FormView control
    >and using code to copy field values between the controls and the database
    >queries. This sounds like it ought to be simpler, but I'm thinking that
    >Microsoft must have created the Formview for a very good reason and that I'm
    >probably not using it correctly.
    >
    >Can anybody please give me some advice on this?
    >
    >Thanks
    >
     
    Duffau, Nov 3, 2007
    #2
    1. Advertising

  3. ZZ_Scarab

    ZZ_Scarab Guest

    Thank you very much for your reply. It's definitely not an issue of laziness.
    I'm prepared to do what it takes. This is a new environment for me and I
    don't want to reinvent any wheels. I'm just trying to understand what I'm
    working with, so if I'm going to use FormViews or SQLDataSources or whatever,
    I want to use them to their optimum capabilities. Sorry if my questions
    appear to be dumb. Three months have gone by without any replies since I
    posted this message and I've learned a lot since then, much of it from users
    who posted positive and helpful responses to other questions.

    "Duffau" wrote:

    >
    > All of your problems have solutions which you have already
    > acknowledged. If you don't like the supplied Formview, then create
    > your own. I know that it is more work for you but that is the price
    > to pay.
    >
    > For instance, with very little work you could easily change your
    > database from 'yes no' to 'true false'.
    >
    > Don't be lazy.
    >
    >
    >
    >
    >
    > On Thu, 23 Aug 2007 10:32:48 -0700, "ZZ_Scarab"
    > <> wrote:
    >
    > >Hi,
    > >
    > >I'm new to the combined C#/ASP.Net environment and have a requirement to
    > >maintain data in a record by record display. I started by using the FormView
    > >control but it is proving to be very tedious for the following reasons:
    > >
    > >1. I have to create several templates for display, edit, empty row, insert,
    > >etc.
    > >2. I need the controls to look the same wrt position, size, etc. on all the
    > >templates, and that's not proving to be easy.
    > >3. Some controls, e.g. radio buttons expect a boolean whereas the values in
    > >the database might be Yes/No or some other character value, so direct data
    > >binding doesn't work.
    > >4. I tried two-way binding of the controls, and switching the ReadOnly
    > >properties between True and False, but some controls, e.g. DropDownList, do
    > >not have such a property!!
    > >5. Trying to access the different fields in the templates to bind them to
    > >the insert/update query parameters is, to say the least, not straightforward
    > >at all in that I have to use the FindControl function, and if my controls
    > >have the same names in the different templates, it gets confused.
    > >6. There is no "Cancel" CommandName so I can allow the user to back out of
    > >changes already made prior to the Update operation executed.
    > >7. All this works flawlessly and effortlessly in the GridView control since
    > >all the operations, display changes, etc. are all carried out automatically
    > >by the control, but there does not seem to be a similar default behavior for
    > >the FormView control, or is it there and I'm just missing it?
    > >
    > >I also am trying just using straight controls without the FormView control
    > >and using code to copy field values between the controls and the database
    > >queries. This sounds like it ought to be simpler, but I'm thinking that
    > >Microsoft must have created the Formview for a very good reason and that I'm
    > >probably not using it correctly.
    > >
    > >Can anybody please give me some advice on this?
    > >
    > >Thanks
    > >

    >
    >
     
    ZZ_Scarab, Nov 5, 2007
    #3
    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. Larry R

    Embedded Formviews

    Larry R, Jun 27, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    343
    Larry R
    Jun 27, 2006
  2. Just Me

    FormViews - ASP.NET 2.0

    Just Me, Apr 11, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    333
    Evan M.
    Apr 12, 2007
  3. dan
    Replies:
    0
    Views:
    356
  4. Bob

    ASP .NET 2.0 - Multiple Formviews - inserting data

    Bob, Apr 8, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    162
  5. Andrew
    Replies:
    17
    Views:
    231
    Alan J. Flavell
    Oct 3, 2005
Loading...

Share This Page