Home All Groups Group Topic Archive Search About

Re: Data Maintenance Using Formviews

Author
3 Nov 2007 12:14 PM
Duffau
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"
<w_b1o2c3t4o***@hotmail.com> wrote:

Show quote
>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
>

Author
5 Nov 2007 6:05 PM
ZZ_Scarab
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.

Show quote
"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"
> <w_b1o2c3t4o***@hotmail.com> 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
> >
>
>

AddThis Social Bookmark Button