473,406 Members | 2,273 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Dynamically creating TemplateField for DetailsView in asp.net.....

8
Hello,

How to create TemplateField programmatically for detailsView in asp.net??


Please help me.

Thanks
Mar 19 '07 #1
2 5340
kenobewan
4,871 Expert 4TB
Welcome to the site. Please provide more information. What have you tried so far?
Mar 19 '07 #2
aekta
8
Welcome to the site. Please provide more information. What have you tried so far?

I have tried as:
----------------------

<script runat="server">
Sub page_load()
Dim tf As New TemplateField()
Dim t As New TextBox()
t = tf.InsertItemTemplate()
DetailsView1.Fields.Add(tf)
DetailsView1.Fields(2).HeaderText = "OK"
DetailsView1.Fields.Add(t)

End Sub
</script>
------------------

Compiler Error Message: BC30311: Value of type 'System.Web.UI.WebControls.TextBox' cannot be converted to 'System.Web.UI.WebControls.DataControlField'.

Please reply me soon.It's urgent..

Thanks for replying me
Mar 19 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: sck10 | last post by:
Hello, I am trying to programically make the following TemplateField ("MyTemplate") visible when the user clicks on the "Edit" Button using the PreRender handle event. My question is, how do...
5
by: clickon | last post by:
This is driving me nuts, it is such a simply thing to do but i cannot for the life of me work out how you are suposed to do it. I want to update the data in DropDownListB based on what is...
1
by: odd.morten.sveas | last post by:
Hi I'm building a web site where some users can create receivables (invoices). This website will support several organisations and different users migth have responibility for more that one...
4
by: bryan | last post by:
Hi all, I am working on a .net 2.0 web app. On page load I display a gridview with a drop down list (Employees), when the user selects from the drop down list, the grid view is filled with...
0
by: Cas | last post by:
Hi, I want to create a InsertItemTemplate in a detailsview (only insertmode)programmatically. I first defined a Template, then i tried to create within that templatefield a InsertItemTemplate...
2
by: =?Utf-8?B?Q2FybG8gTWFyY2hlc29uaQ==?= | last post by:
I am building a GridView dynamically adding templatFields according to a Microsoft article. I had to create a class with the ITemplate interface and a method called InstantiateIn. Everything works...
1
by: Lazy Man | last post by:
Hi, custom DetailsView or Table with controls? For various reasons, I need to generate the edit controls in a DetailsView programmatically. I already do this to display an item, so Item mode...
1
by: ajrock2000 | last post by:
I am using a DetailsView to display some data. I am basically getting a firstname, and lastname fields from a database (the database cannot be changed, nor the queries), and I must concatenate the ,...
2
by: =?ISO-8859-1?Q?=22Fernando_A=2E_G=F3mez_F=2E=22?= | last post by:
Hello all. I'm building a WebControl. In it's CreateChildControls, I'm creating a DataSource and a DetailsView controls and set de DV's DataSourceID to the control I just created. Now, I'm...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.