Jump to content
Software FX Community

Hightlight Events & Dbl Click on Datagrid not able to work in Web Program


lewis_leeheng

Recommended Posts

 Hi Frank, 
	i try create a web application to allow change on the Datagrid. Below is my program but i dont know why it seens like canot work on double click on datagrid. 
Even when i click on datagrid it not event have been perform and highlight events also not able to perform. 
Is there anything i miss out on my program?? Please advise. Thank you.
 ************************************************** ************************************************** **************************************************

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Chart1.DataGrid.ReadOnly = False

Chart1.DataGrid.UseRawData = True

Chart1.AllowChanges = ChartFX.WebForms.AllowChanges.All

'Chart Highlighting Settings

Chart1.Highlight.Dimmed = True

Chart1.Highlight.Enabled = True

Chart1.Highlight.PointAttributes.Color = Color.Red

Chart1.Highlight.Speed = ChartFX.WebForms.HighlightSpeed.Fast


'DataGrid Highlighting Settings

Chart1.DataGrid.Highlight.BorderColor = Color.Blue

Chart1.DataGrid.Highlight.Enabled = True

Chart1.DataGrid.Highlight.DimText = True

Chart1.DataGrid.Highlight.FontStyle = FontStyle.Bold

Chart1.DataGrid.Highlight.Immediate = True

Chart1.DataGrid.Highlight.TextColor = Color.Red

     End Sub
 
    Protected Sub Chart1_Click(ByVal sender As Object, ByVal e As ChartFX.WebForms.HitTestEventArgs) Handles Chart1.Click

If e.Series = 0 Then

Chart1.Points(0, e.Point).Link.Url = "Series0.aspx?Point=%N&Series=%S"

Chart1.Points(0, e.Point).Link.Target = "_blank"

ElseIf e.Series = 1 Then

Chart1.Points(1, e.Point).Link.Url = "Series1.aspx?Point=%N&Series=%S"

Chart1.Points(1, e.Point).Link.Target = "_blank"

End If

End Sub

    Protected Sub Chart1_ChangedByUser(ByVal sender As Object, ByVal e As ChartFX.WebForms.ChangedByUserEventArgs) Handles Chart1.ChangedByUser

End Sub

 
Link to comment
Share on other sites

hi Frank,

Below is my program,

If RenderFormat to ".Net" it Not able to work at click events on each data point but it able to changes on Datagrid.

If RenderFormat = "Image" it able to work at click events on each data point but it Not allow me to changes on Datagrid.

Actually i would like to perform these both which is click events on each data point and allow to changes on Datagrid. Is there possible??

Test1.aspx

<chartfx7:Chart ID="Chart1" runat="server" Height="450px" Width="900px" Visible="true" RenderFormat=".NET" >
  <AxisY Title-Text="Utilization %">
  <LabelsFormat CustomFormat="0" Decimals="2" Format="Percentage" />
  </AxisY>
  <AxisX LabelAngle="90" Title-Text="">
  </AxisX>
  <Series>
  <chartfx7:SeriesAttributes />
  <chartfx7:SeriesAttributes />
  <chartfx7:SeriesAttributes />
  </Series>
  <LegendBox ContentLayout="Spread" Dock="Bottom">
  </LegendBox>
  <MainPane AxisY-Title-Text="Utilization %" />
  <DataGrid Visible="True" />
  <Titles>
  <chartfx7:TitleDockable Font="Arial, 12pt, style=Bold' Text='Testing' />
  <chartfx7:TitleDockable Text="" />
  </Titles>
  <ToolBar Visible="True" />
  </chartfx7:Chart>

Test1.aspx.vb

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 

  Chart1.DataGrid.ReadOnly = False
  Chart1.DataGrid.UseRawData = True
  Chart1.AllowChanges = ChartFX.WebForms.AllowChanges.All
  Chart1.AllowDrag = False

  'DataGrid Highlighting Settings
  Chart1.DataGrid.Highlight.BorderColor = Color.Blue
  Chart1.DataGrid.Highlight.Enabled = True
Chart1.DataGrid.Highlight.FontStyle = FontStyle.Bold
  Chart1.DataGrid.Highlight.Immediate = True
  Chart1.DataGrid.Highlight.TextColor = Color.Red

  Dim i As Integer

  For i = 0 To 10

  Dim myUrl1 As String
  myUrl3R = "Serial0.aspx?SessionId=123&Point=%N&Series=%S"
  Chart1.Points(0, i).Link.Url = myUrl3R
  Chart1.Points(0, i).Link.Target = "_blank"

  Dim myUrl2 As String
  myUrl2 = "Serial1.aspx?SessionId=123&Point=%N&Series=%S"

  Chart1.Points(1, i).Link.Url = myUrl2
  Chart1.Points(1, i).Link.Target = "_blank"


  Next

End sub

  Protected Sub Chart1_Click(ByVal sender As Object, ByVal e As ChartFX.WebForms.HitTestEventArgs) Handles Chart1.Click

  If e.Series = 0 Then

  Chart1.Points(0, e.Point).Link.Url = "Series0.aspx?Point=%N&Series=%S"
  Chart1.Points(0, e.Point).Link.Target = "_blank"

  ElseIf e.Series = 1 Then

  Chart1.Points(1, e.Point).Link.Url = "Series1.aspx?Point=%N&Series=%S"
  Chart1.Points(1, e.Point).Link.Target = "_blank"
  End If

  End Sub

 

Link to comment
Share on other sites

A click on the client will not always cause a Click event to be fired in the server, only clicks made on points are sent back to the server as a PostBack/CallBack. A MouseClick event will fire on the client everytime.

You can capture client-side event using JavaScript. For example:

<SCRIPT  LANGUAGE="JavaScript" FOR="Chart1" EVENT="MouseDown(sender,eventargs)"><!-- Chart1.AllSeries.PointLabels = true;--></SCRIPT>

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...