awekelun Posted April 1, 2009 Report Share Posted April 1, 2009 I need help getting a constaint line in a chart that is inside of a datalist control. When I try to use the CustomGridLine function I keep getting a "System.NullReferenceException was unhandled by user code Message="Object reference not set to an instance of an object." error during post back. This works fine when I add a chart to the form that is not inserted in the datalist control. See code below. Partial Class Chart Inherits System.Web.UI.Page Dim AddAssyLines As String Dim Chart As ChartFX.WebForms.Chart Protected Sub ChartBtn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ChartBtn.Click AssyChkBox.Visible = False ChartBtn.Visible = False DataListRadar.Visible = True AddAssyLines = BuildValueList(AssyChkBox.Items, True) AssyLinesBTTlbl.Text = AddAssyLines Chart = DataListRadar.FindControl("Chart1") Dim custom1 As ChartFX.WebForms.CustomGridLine custom1 = New ChartFX.WebForms.CustomGridLine custom1.Value = 95 custom1.Color = System.Drawing.Color.DarkBlue custom1.Text = "Target 95%" custom1.Width = 2 Chart.AxisY.CustomGridLines.Add(custom1) End Sub Protected Function BuildValueList(ByVal items As ListItemCollection, ByVal itemMustBeSelected As Boolean) As String Dim idList As StringBuilder = New StringBuilder() For Each item As ListItem In items If itemMustBeSelected AndAlso (Not item.Selected) Then Continue For Else idList.Append(item.Value.ToString()) idList.Append(",") End If Next item Return idList.ToString() End FunctionEnd Class Quote Link to comment Share on other sites More sharing options...
RandyJ Posted April 29, 2009 Report Share Posted April 29, 2009 Hi,Could you please report this problem to support at softwarefx dot com? We will try to replicate the issue on our side so we can confirm it as a bug. However we would appreciate that you send an email detailing what exactly happens at your end so we can properly track the incident. Regards, RandyJ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.