I have DropDown template fields that pull data through to insert on DetailsView insert form. How can I hide the DropDown fields and still get them inserted. If I use the TemplateFieldProperty Visible = False, the insert property does not work. Please urgent
help is needed.
Then No need of a DDL . A Label will do the purpose.
Whatever it may be .. The best thing you can do is avoid binding the value to a DDL or a Label and In item inserting event of the DetailsView get the value to insert from he DB table by establishing a database connection and assign it as the
e.Values['ThatFieldName"]
Kindly mark this post as "Answer", if it helped you.
I do not write code but I am able to use the databinding and choosedata properties of the DDL. Label does not have the choosedata function. You won't believe the amazing things I can do with that.
asante_za
Member
16 Points
113 Posts
Hide field but insert in DetailsView
May 04, 2012 06:35 PM|LINK
I have DropDown template fields that pull data through to insert on DetailsView insert form. How can I hide the DropDown fields and still get them inserted. If I use the TemplateFieldProperty Visible = False, the insert property does not work. Please urgent help is needed.
basheerkal
Star
10672 Points
2426 Posts
Re: Hide field but insert in DetailsView
May 04, 2012 06:43 PM|LINK
Hi
If you hide the DropdownList how can you select a value from it to insert in DB?
Please clarify.
(Talk less..Work more)
ksqcoder
Participant
1292 Points
207 Posts
Re: Hide field but insert in DetailsView
May 04, 2012 06:43 PM|LINK
You could try setting the dropdownlist's style property to display: none, that might work.
asante_za
Member
16 Points
113 Posts
Re: Hide field but insert in DetailsView
May 04, 2012 06:57 PM|LINK
I am unable to find the display property. Is it because I have converted the field to template? Please clarify.
asante_za
Member
16 Points
113 Posts
Re: Hide field but insert in DetailsView
May 04, 2012 06:59 PM|LINK
The ddl has been linked to a value from a table.
basheerkal
Star
10672 Points
2426 Posts
Re: Hide field but insert in DetailsView
May 04, 2012 07:13 PM|LINK
DDL may have many value as ListItems. out of this which value would you like to Insert in DB?
(Talk less..Work more)
asante_za
Member
16 Points
113 Posts
Re: Hide field but insert in DetailsView
May 04, 2012 07:20 PM|LINK
The DDL has only one item pulled through with criteria. For example one is populated with the username of the current user logged in.
basheerkal
Star
10672 Points
2426 Posts
Re: Hide field but insert in DetailsView
May 04, 2012 07:28 PM|LINK
Then No need of a DDL . A Label will do the purpose.
Whatever it may be .. The best thing you can do is avoid binding the value to a DDL or a Label and In item inserting event of the DetailsView get the value to insert from he DB table by establishing a database connection and assign it as the e.Values['ThatFieldName"]
(Talk less..Work more)
asante_za
Member
16 Points
113 Posts
Re: Hide field but insert in DetailsView
May 04, 2012 07:51 PM|LINK
I do not write code but I am able to use the databinding and choosedata properties of the DDL. Label does not have the choosedata function. You won't believe the amazing things I can do with that.
basheerkal
Star
10672 Points
2426 Posts
Re: Hide field but insert in DetailsView
May 05, 2012 01:31 AM|LINK
OK, But without writing code I think you cannot do what you need to do. Let us wait for suggestions from some experts.
Till then
Bye.
(Talk less..Work more)