Jump to content
Software FX Community

displaying other controls in between guages when guages are created dynamically


vivek

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

Link to comment
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.

Link to comment
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

 

Link to comment
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.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...