473,473 Members | 2,008 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

ITemplate for textbox

Hi All,
public class clsITextBox : ITemplate
{
string controlName = "";
object dataSource = null;
string fieldName = "";
public clsITextBox(string controlName, object dataSource, string fieldName)
{
this.controlName = controlName;
this.dataSource = dataSource;
this.fieldName = fieldName;
}
public void InstantiateIn(Control objContainer)
{
TextBox myTextBox = new TextBox();
myTextBox.ID = this.controlName;
//TextBox doesn't have DataSource Property
objContainer.Controls.Add(myTextBox);
}
}

I would like to bind textbox to certain column on certain datasource. but I
donot know how to complete this class.
Anybody out there could helpme? TIA.
Regards,
Gun
Apr 5 '07 #1
0 936

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: cosine... zero | last post by:
Hi! I've got a databound templated control that I want the itemplate class itself to be postback aware to process form data. But calling Page.RegisterRequiresPostBack( instantiatedtemplate )...
1
by: Amine | last post by:
Hello, I am trying to create textbox control dynamically into a datagrid. I do not know the number of columns until run time so I thought I could use template columns dynamically and add them into...
0
by: Steve Richter | last post by:
trying to understand how to support templates in server controls ... a few quick questions on the following snippet of code pulled from a server control class: ITemplate _headingStyle; ...
0
by: vicgroups | last post by:
Hello, I am adding columns to the datagrid programmatically. And I have created a countries drop down list in an ascx file. I have added the countries drop down list to the datagrid column as...
0
by: Amine | last post by:
Hello, I am trying to create textbox control dynamically into a datagrid. I do not know the number of columns until run time so I thought I could use template columns dynamically and add them into...
5
by: Ben Schumacher | last post by:
Ok smart guys and gals ... I have a GridView control with a dynamically created checkbox column. The checkbox is created using ITemplate interface. In my class that implements the ITemplate...
0
by: imranabdulaziz | last post by:
Hi all, I am using asp.net2.0 and C# VS2005. I am creating asp.net web server control templates Dynamically . My requirement is such that sp return very no of field( 4 or 5 or 6 …). Now I am...
0
by: John | last post by:
I'm dynamically creating all the Columns in a GridView at run time and binding it to a DataTable. I have to build it at runtime (using an ITemplate subclass) because the number of columns is based...
1
by: wojski696969 | last post by:
Hi, i've made my own Custom Server Control, wich inherits from WebControl class. Inside of my control I've create three ITemplate properties wich should be used as containers for Head, Content and...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.