Questions tagged [dynamic-controls]

310 questions
4
votes
1 answer

What is the difference between a static and a dynamic control in ASP.NET using webforms

I am having a hard time finding a good answer for this question, but what is the difference between a static and a dynamic control in an ASP.NET webforms application. Does having a dropdown list declared in html, but databound in code behind deem it…
TopBanana9000
  • 818
  • 2
  • 14
  • 32
4
votes
3 answers

Adding Control to Gridview Cell

I want to add a button on GridView cell on certain condition. I did the following in RowDatabound event if( i==0) { Button btn= new Button(); btn.Text = "view more"; e.Row.Cells[7].Controls.Add(btn); } When this executes, the text…
Shanna
  • 753
  • 4
  • 14
  • 34
4
votes
2 answers

Dynamic Event Handler not Firing

I want to create an amount of controls dynamically based on a number the user enters into a textbox. This part I have working fine, but I also need the dynamically created textboxes to have event handlers of their own, so the user can enter a number…
4
votes
3 answers

Keep a value accessible in Page.Init between postbacks in asp.net

Ok, I've already learned that in order to keep the dynamic (created) controls and their viewstate in asp.net we must (re)create them in the Page init event, so they already exist within the page's control hierarchy before the view state is…
weilah
  • 463
  • 7
  • 20
4
votes
3 answers

Create an exact copy of TPanel on Delphi5

I have a TPanel pnlMain, where several dynamic TPanels are created (and pnlMain is their Parent) according to user actions, data validations, etc. Every panel contains one colored grid full of strings. Apart from panels, there are some open source…
smok1
  • 2,940
  • 26
  • 35
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
3
votes
5 answers

Validator nightmare on dynamic control C#

I have a requirement to add a RequiredFieldValidator and RegularExpressionValidator to a dynamically created textbox in a dynamically generated tablecell, inside a Web User Control in the Content Area of a Page created from a Master. The problem, as…
One Monkey
3
votes
1 answer

Element not being validated w/ unobtrusive validation after AJAX and dynamic creation using MVC 3 and jQuery

Here's my problem... I have a page that initially renders and displays an AJAX form created using Ajax.BeginForm. Some criteria is entered and the AJAX form is posted. A partial view is returned which contains an HTML form created using…
3
votes
4 answers

Gridview Sorting and Paging with Dynamically Generated Controls

I've gotten myself into a pickle with using dynamic controls in a gridivew. I am binding the gridview to a list and am then adding dyanmic controls. IN order to keep the control state I need to do this in page load. However since events fire…
personaelit
  • 1,633
  • 3
  • 31
  • 59
3
votes
1 answer

Dynamic controls in ASP.NET

I've created a Windows Forms Application in C# which allows users to add controls to a TabPage which they can resize and reposition. Now I want to do the same thing only in ASP.NET. I managed to add the controls dynamically following this tutorial.…
user740136
3
votes
3 answers

ASP.NET / C# confusion over dynamically created controls

Ive been playing around with the default ASP.NET web application template and the following code throws an exception: Object reference not set to an instance of an object. when clicking the created button. Can anyone offer a technical…
maxp
  • 24,209
  • 39
  • 123
  • 201
3
votes
1 answer

Finding Dynamically generated Wcf Controls by FindName()

The FramworkElement.FindName() method of finding a control within a parent control seems like it should straight forward... But I am upping the anty and it seems like the framework does not like what I'm trying to do. First off, I do realize there…
Brett Spencer
  • 212
  • 1
  • 3
  • 13
3
votes
2 answers

okay, exactly where should i create dynamic controls

I have just been active on two questions regarding dynamic controls, the answer is nearly always about re-creating on postback, the question is where is the correct place for this Here are the two SO questions question one question 2 We always do…
Richard Friend
  • 15,800
  • 1
  • 42
  • 60
3
votes
1 answer

Iterating Dynamic FileUpload Control Collection in Panel Control using ASP.NET C#

I'm trying to get the values of dynamically generated FileUpload controls that I add to a Panel: I create the controls during a loop through a record set: foreach(DataRow dr in…
Mr. Smith
  • 5,489
  • 11
  • 44
  • 60
3
votes
2 answers

Nested Dynamic Controls, using Custom Event Handlers

I'm building a WinForm with quite a few dynamic elements, and I think I'm having some trouble with the parent/child relationship within nested controls. All the existing questions I could find seemed exclusive to WebForms, which wasn't entirely…
Tinkerer_CardTracker
  • 3,397
  • 3
  • 18
  • 21
1
2
3
20 21