I've been reading this forum and MSDN library for several hours now, so please re-direct me if this has been answered elsewhere and I've missed the post.
For readability, I want to show names in the form 'FirstName LastName' as a single field in a GridView, but when I edit a row, I want to then display them as separate fields 'Firstname', 'Lastname'. The concatenation to a single field is working well with a stored function, and the datasource I'm using is a SQLDataSource using stored procedures - both in SQLExpress. Later I plan to use a TableAdapter, but not until I can get the basic functionality behaving correctly.
Should I:
- include the fullName as an extra field in the datasource (display it for the select while hiding the firstName and lastName fields, then hide the fullName field while displaying firstName and lastName for edit & insert) ?
- find a way to use separate datasources for the edit and insert templates ?
Has anyone been able to make either of these options work? If so, have you used events to change the visibility of the fields (for option1) or the GridView datasource (for option2)??
If you have a solution, please post enough of the event statement block for me to follow (C# preferred).
TIA