Questions tagged [createchildcontrols]
14 questions
4
votes
1 answer
Removing dynamic controls : Clear is working but not remove
I faced a recent problem, where I was generating the dynamic control on the selection of drop down. When the selection changes, I have to generate another set of dynamic controls, removing the existing controls.
So I was doing following which is…

kinshuk4
- 3,241
- 3
- 33
- 41
2
votes
0 answers
How to persist child controls in a CompositeDataBoundControl
The documentation for the CompositeDataBoundControl class (http://msdn.microsoft.com/en-us/library/ms366539(v=vs.100).aspx) states the following:
This is the base class that extends the DataBoundControl class, providing the following…

JKasper11
- 772
- 1
- 7
- 21
1
vote
1 answer
what will happen if we don't call base.createchildcontrols()
I just would like to know what will happen if we don't put base.createchildcontrols() in the code. Will composite control be created without calling base.createchildcontrols()?
[ToolboxData("<{0}:Login runat=server>{0}:Login>")]
public class…

dotnetrocks
- 2,589
- 12
- 36
- 55
1
vote
2 answers
What is the correct ASP.NET Control event/method in which to add nested controls?
What is the correct event/method in the ASP.NET life cycle to dynamically add Child Controls ?
My objective is to ensure that all the input controls on a User Control have the correct associated Validator and Label controls, based on configuration…

smartcaveman
- 41,281
- 29
- 127
- 212
1
vote
1 answer
RadGrid override CreateChildControls
I'm extending the tellerick RadGrid control to give it an optional CustomSearchControl.
protected override void CreateChildControls()
{
this.Controls.Add(CustomSearchControl);
base.CreateChildControls();
…

D.Forrest
- 845
- 1
- 9
- 23
1
vote
1 answer
Why clear controls in CreateChildControls
All of the examples of ASP.NET composite controls always clear child controls as the first action within CreateChildControls. Why is this? As I understand it this method is always called via EnsureChildControls which sets a flag to indicate that it…

Rob West
- 5,189
- 1
- 27
- 42
0
votes
1 answer
createchildcontrol() - user control, custom control, web control
I am new to .Net trying to understand about different controls here. I know, custom control, an extension of existing control. User control, a complicated control constructed in .ascx file and can be used anywhere in the application. I couldn't the…

dotnetrocks
- 2,589
- 12
- 36
- 55
0
votes
1 answer
Unable to retain value of a label during post back(button click) in sharepoint
While writing code for connecting two webparts,I created a two labels. the text value for both the labels were written in OnPreRender method. However, i forgot to add control for one label in CreateChildControl method.
So while debugging, i noticed…

Thomas Mathew
- 1,151
- 6
- 15
- 30
0
votes
1 answer
Kendo UI TreeList - adding row
I have some troubles when adding row in a treelist Kendo, espessially Add Child Row. I click Add Child Row, then put data into fields, and after clicking OK, row disappeared. So i can't add CHILD row.
I took sample from official site.…

Роберт Иванов
- 79
- 7
0
votes
1 answer
Which way of programmatically referencing a CSS class is most reliable?
In my Sharepoint project, I am dynamically creating controls in the overridden CreateChildControls() method. I don't know which of the two ways to reference the .css file is preferred:
protected override void CreateChildControls()
{
…

B. Clay Shannon-B. Crow Raven
- 8,547
- 144
- 472
- 862
0
votes
1 answer
How can I get my Sharepoint Child Controls to align horizontally?
I am creating controls in a Web Part's overridden CreateChildControls() method.
My code is this (no pun intended):
this.Controls.Add(new LiteralControl("
Duckbilled Platypus Unlimited
")); this.Controls.Add(new LiteralControl("Angle of…

B. Clay Shannon-B. Crow Raven
- 8,547
- 144
- 472
- 862
0
votes
1 answer
Why are the controls on my WebPart not displaying?
I have created a Sharepoint WebPart and successfully deployed it and added it to a page.
It should sport a Label, a TextBox, and a button, but it does not. It is "naked", as you can see here:
Why would it be that the controls are not displaying?…

B. Clay Shannon-B. Crow Raven
- 8,547
- 144
- 472
- 862
0
votes
1 answer
Does overriding Sharepoint's Render method accomplish the same thing as overriding CreateChildControls?
Based on what I've read (I'm new to SP), ISTM that CreateChildControls() is the preferred method for dynamically adding controls to a WebPart, a la:
protected override void CreateChildControls()
{
base.CreateChildControls();
lbl = new…

B. Clay Shannon-B. Crow Raven
- 8,547
- 144
- 472
- 862
0
votes
4 answers
SharePoint AJAX implementation: ScriptHandler being added twice
I am currently in the process of setting up AJAX capabilities in a SharePoint environment to support web parts I'm creating with C#. I am using Microsoft's walkthrough as a starting point just to get up and running, and I am running into what I…

Geo Ego
- 1,315
- 7
- 27
- 53