Z
ZZ_Scarab
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
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