Jump to content
Software FX Community
vivek

displaying other controls in between guages when guages are created dynamically

Recommended Posts

hi

i ahve written the code to generate guages dynamically using .net

now i need to add another controls say heading for that guage in between the guage

i tried many methods to add them but what i can see is the all the guages first and the controls whcih i added in the end

is there any way by which i can control this behaviour and insert heading for that guage in between the guages as labels

i give you the code to ahve a look

 

If display.printrowvalue > 300 And display.printrowvalue < 400 Then

collectionlabel.Text = display.collectionvalue

linebreak.Text =

"<br/>"

titlelabel.Text = display.titlevalue

Controls.Add(collectionlabel)

Controls.Add(linebreak)

Controls.Add(titlelabel)

Controls.Add(linebreak)

displayguage(display, maxmincombination(8), maxmincombination(9))

Controls.Add(linebreak)

End If

here display is the object of the class which contains all the marker values for the guage which i am showing on browser, print row is one of its property

display guage is the method with the help of whcih i am generating the guages

maxmincombination is the array which contains maximum and minimum values for the guage

now i also want to insert labels collection label and title label along with guages but i can only see the guages to be appearing and no labels

after all the guages according to loop condition are displayed i can see only the last label values

does it mean that guages does not allow the generation of other controls in between

thanks in advance

regards

vivek

Share this post


Link to post
Share on other sites

Calling Controls.Add(...) is adding the controls to the control tree at the top level. This means that they are not inside any form. div or any other DOM element in your page.

I think what you want to do is to create some parent control as the container of all these.

It is not clear from this code whether or not you are adding the gauges to the controls collection as well.

Share this post


Link to post
Share on other sites

Can you please give an example for this

also can you please tell me how could i take the child controls from the parent control and display it on browser

I am using hguage.rendercontrol() method for displaying guage directly on the browser so i doubt it that i can add horizontal guage in the container.Is there any better meyhod for doing this thing.I mean converting guage into some object and then putting in container and then rendering the guage when i take out child elements one by one on the browser from the parent control

thanks

regards

vivek

 

Share this post


Link to post
Share on other sites

> I am using hguage.rendercontrol() ...

That's the problem. On one hand you are adding your controls to the Control tree (labels etc), in the other you are writing directly to the output stream.

Instead of calling hguage.rendercontrol(), add the hgauge control to your Controls collection at the appropriate place (between the controls you want it to be).

Notice that none of this is specific to gauges, this is all general ASP.NET stuff.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...