By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,551 Members | 2,710 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,551 IT Pros & Developers. It's quick & easy.

Change Dynamic control properties at run time

P: n/a
I'm creating webcharts control dynamically based on user input as to
how many charts they would like to see. I'm running into problem as to
how to set properties for those charts at run time so they behave and
look all the same.

Creating dynamic chart code looks something like this....

/////////////////////////////////////////////////////////////////////////////////
Sub CreateChartControl(ByVal sender As Object, ByVal e As EventArgs)
Dim ds1 As DataSet = CreateDataSet()
Dim charttest As ColumnChart = New ColumnChart

For Each row As DataRow In ds1.Tables(0).Rows
charttest.Data.Add(New ChartPoint(row("LNAME").ToString,
CType(row _

("AGE"), Integer)))
Next

Dim z As Integer

For z = 1 To 3
ReDim Preserve mycharts(z)
mycharts(z) = New ChartControl
form1.Controls.Add(mycharts(z))
mycharts(z).Visible = True
mycharts(z).Charts.Add(charttest)
mycharts(z).RedrawChart()
Next z
End Sub

///////////////////////////////////////////////////////////////////////

Is there a way to call a routine from FOR loop to format each chart
control and set the properties.

Here are some chartcontrol properties i would like to change at run
time...

<web:ChartControl Runat="server" ID="chartControl1"
ChartPadding="30"
BottomChartPadding="20"
TopPadding="20"
Padding="20" Width="848px" Height="438px"
BorderStyle="outset" GridLines="Both"
Legend-Position="Bottom" Legend-Width="30">
<Background Type="LinearGradient"
Color="#C0FFC0"
EndPoint="900, 900"
LinearGradientMode="BackwardDiagonal"
/>
<Border Color="102, 153, 255" />
<ChartTitle Text="Web Chart Example"
Font="Tahoma, 12pt,
style=Bold" ForeColor="White"

StringFormat="Center,Near,Character,LineLimit" />
</web:ChartControl>

Thanks,
Nick

Jan 6 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.