Please refer the following code snippet to achieve this.
<code>
[VB]
'Click event for Chart Control
AddHandler Me.chartControl1.ChartRegionClick, AddressOf chartControl1_ChartRegionClick
'Key events for Form
Me.KeyPreview = True
AddHandler Me.KeyDown, AddressOf Form1_KeyDown
AddHandler Me.KeyUp, AddressOf Form1_KeyUp
'Key up event
Private Sub Form1_KeyUp(ByVal sender As Object, ByVal e As KeyEventArgs)
CtrlKeyDown = False
End Sub
'Click event for Chart Control
Private Sub chartControl1_ChartRegionClick(ByVal sender As Object, ByVal e As ChartRegionMouseEventArgs)
If CtrlKeyDown Then
HighLightGrid()
End If
End Sub
'Method to highlight first and last point of Grid
Private Sub HighLightGrid()
Dim data As New List(Of Double)()
For Each series As ChartSeries In Me.chartControl1.Series
data.Add(series.Points(0).X)
data.Add(series.Points(series.Points.Count - 1).X)
Next series
'Selecting Grid Data
Me.gridDataBoundGrid1.Selections.Clear()
For i As Integer = 1 To Me.gridDataBoundGrid1.Model.RowCount - 1
Dim cellValue As Double = Convert.ToDouble(Me.gridDataBoundGrid1(i, 1).CellValue)
If data.Contains(cellValue) Then
Me.gridDataBoundGrid1.Selections.Add(GridRangeInfo.Row(i))
End If
Next i
End Sub
'Key down event to select first and last points when "Ctrl" and left click is performed
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As KeyEventArgs)
If e.KeyCode.ToString().Equals("ControlKey") Then
CtrlKeyDown = True
Else
CtrlKeyDown = False
End If
End Sub
'Hiding unselected rows in grid
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button1.Click
FilterTO(True)
End Sub
'Hiding selected rows in grid
Private Sub button2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button2.Click
FilterTO(False)
End Sub
'Method for FilterTO or FilterOUT
Private Sub FilterTO(ByVal IsFilterTO As Boolean)
For i As Integer = 1 To Me.gridDataBoundGrid1.Model.RowCount - 1
Me.gridDataBoundGrid1.Model.Rows.Hidden(i) = IsFilterTO
Next i
Dim selectedList As GridRangeInfoList = Me.gridDataBoundGrid1.Selections.Ranges.GetRowRanges(GridRangeInfoType.Rows)
Dim selectedRow As New List(Of Integer)()
Dim rowCollection() As String = selectedList.Info.Split(New Char() { ";"c })
For Each row As String In rowCollection
If Not String.IsNullOrWhiteSpace(row) Then
row.Replace(" ", String.Empty)
Dim rowRanges() As String = row.Split(":"c)
If rowRanges.Length = 1 Then
rowRanges(0)=rowRanges(0).Replace(" ", String.Empty)
If Not String.IsNullOrWhiteSpace(rowRanges(0)) Then
selectedRow.Add(Convert.ToInt32(rowRanges(0).Remove(0, 1)))
End If
Else
rowRanges(0)=rowRanges(0).Replace(" ", String.Empty)
rowRanges(1)=rowRanges(1).Replace(" ", String.Empty)
Dim startRange As Integer = Convert.ToInt32(rowRanges(0).Remove(0, 1))
Dim endRange As Integer = Convert.ToInt32(rowRanges(1).Remove(0, 1))
For k As Integer = startRange To endRange
selectedRow.Add(k)
Next k
End If
End If
Next row
For Each index As Integer In selectedRow
Me.gridDataBoundGrid1.Model.Rows.Hidden(index) = Not IsFilterTO
Next index
End Sub
</code>
Query : 3D surface charts in windows functions?
Currently, support for surface chart is not available in Essential Windows forms Chart. We have already logged a feature request in our features management system.
http://www.syncfusion.com/support/directtrac/features/WF-4457
Please let us know if you have any concern.
Regards,
Anand