Welcome Guest Search | Active Topics | Sign In | Register

Create Combobox dynamically Options
Camarate
Posted: Friday, September 14, 2012 9:12:45 AM
Rank: Advanced Member
Groups: Member

Joined: 9/2/2010
Posts: 120
Hi,

In ASP.NET how do I create a Combobox object at runtime using a specific template? If possible send me a sample code.

Thanks in advance,

Marcelo Camarate
eo_support
Posted: Friday, September 14, 2012 9:20:16 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
We deleted your post yesterday because we consider this a generic ASP.NET programming question ---- there is no difference between dynamically creating an EO.Web ComboBox and dynamically creating any other controls. As such we will not answer this question.

Thanks
Camarate
Posted: Friday, September 14, 2012 10:40:40 AM
Rank: Advanced Member
Groups: Member

Joined: 9/2/2010
Posts: 120
I posted the topic because, to me, is not exactly the same as creating dynamically any control in ASP.NET.

I need create dynamically a Combobox with a Treeview control inside it. Then, see the little sample code below:

Code: Visual Basic.NET
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Dim Combo As New EO.Web.ComboBox
        Dim Tree As New EO.Web.TreeView
        Dim Node As EO.Web.TreeNode

        Node = New EO.Web.TreeNode("htpp://google.com.br")
        Tree.Nodes.Add(Node)
        Node = New EO.Web.TreeNode("htpp://yahoo.com.br")
        Tree.Nodes.Add(Node)

        Combo.Controls.Add(Tree)

        Me.Controls.Add(Combo)

    End Sub


When I run it I get the following error:



What am I doing wrong? What is missing in my code?

By the way. The next time that you delete a topic posted by me, please send me a feedback. My company is customer of Essential Objects since 2008, and this is that I expect, either to avoid that I stay waiting for a reply forever, either to I don't resend the same topic again.

Thanks in advance,

Marcelo Camarate
ValMark Solutions
eo_support
Posted: Friday, September 14, 2012 10:55:08 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

It is the same as other controls. In this case the error message clearly tells you DropDownTemplate must be set. So that's what you must do. DropDownTemplate is an ITemplate, so setting that is the same as setting any other ITemplate. This is the same as if we tell you something "Button.Text must be set". Obviously in that case we are not suppose to give you code on how to set Button.Text.

We usually do not send feed back when we delete a topic that we considered out of the scope of our support because that will just encourage unnecessary argument as this one you are having with us now ----- we said its a generic programming question and you insisted it is not. The very reason that we replied your post this time is because we considered you a valuable customer so we tried to explain our position to you.

We can not afford to answer generic programming questions and we are very firm on that because do so would just invite all our users to run their questions through us regardless the question has to do with us or not. So in the future, always try to apply that rule when posting your question. I understand that sometimes it maybe not be as clear as black and white when it comes to determine whether the question has anything to do with us or not as in your case. However if you see your question being deleted, then it means it clearly is considered as out of the scope of our support and we will not answer it.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.