This is a migrated thread and some comments may be shown as answers.

Issue with RadWindow Manager

0 Answers 46 Views
Quick Fixes
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Duc Hoang Viet
Top achievements
Rank 1
Duc Hoang Viet asked on 27 Jan 2010, 10:00 AM

Dim

oDoc As XDocument = XDocument.Load("E:\CurrencyData.xml")

Dim oData = (From info In oDoc.Descendants("Result") _

Select GetCurrency(info)).ToList

DataGridView1.DataSource = oData


Private Function GetCurrency(ByVal el As XElement) As CurrencyQuote

Dim oCurrencyQuote As New CurrencyQuote

oCurrencyQuote.Pair = el.Element("pair").Value

oCurrencyQuote.Bid = el.Element("bid").Value

oCurrencyQuote.Ask = el.Element("ask").Value

oCurrencyQuote.DisplayTime = DateTime.Now.ToString("T")

oCurrencyQuote.TransactionTime = DateTime.Now

oCurrencyQuote.Up = True

 

Return oCurrencyQuote

End Function

 

Public

Class CurrencyQuote

Private m_Pair As String

 

 

 

Private m_Bid As Double

 

 

 

Private m_Ask As Double

 

 

 

Private m_TransactionTime As DateTime

Private m_DisplayTime As String

 

 

 

Private m_Up As Boolean

 

 

 

Public Property Pair() As String

 

 

 

Get

 

 

 

Return m_Pair

End Get

 

 

 

Set(ByVal value As String)

m_Pair = value

End Set

 

 

 

End Property

 

 

 

Public Property Bid() As Double

 

 

 

Get

 

 

 

Return m_Bid

End Get

 

 

 

Set(ByVal value As Double)

m_Bid = value

End Set

 

 

 

End Property

 

 

 

Public Property Ask() As Double

 

 

 

Get

 

 

 

Return m_Ask

End Get

 

 

 

Set(ByVal value As Double)

m_Ask = value

End Set

 

 

 

End Property

 

 

 

Public Property TransactionTime() As DateTime

Get

 

 

 

Return m_TransactionTime

End Get

 

 

 

Set(ByVal value As DateTime)

m_TransactionTime = value

End Set

 

 

 

End Property

 

 

 

Public Property DisplayTime() As String

 

 

 

Get

 

 

 

Return m_DisplayTime

End Get

 

 

 

Set(ByVal value As String)

m_DisplayTime = value

End Set

 

 

 

End Property

 

 

 

Public Property Up() As Boolean

 

 

 

Get

 

 

 

Return m_Up

End Get

 

 

 

Set(ByVal value As Boolean)

m_Up = value

End Set

 

 

 

End Property

 

End

Class



 

Private

Sub DataGridView1_DataBindingComplete(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewBindingCompleteEventArgs) Handles DataGridView1.DataBindingComplete

DataGridView1.Columns("Up").Visible = False

 

 

 

DataGridView1.Columns("TransactionTime").Visible = False

 

 

 

Dim count As Integer = 0

For Each oCurrencyQuote As CurrencyQuote In DataGridView1.DataSource

If oCurrencyQuote.Up Then

 

 

 

DataGridView1.Rows(count).DefaultCellStyle.BackColor = Color.Blue

Else

 

 

 

DataGridView1.Rows(count).DefaultCellStyle.BackColor = Color.Red

End If

 

 

 

count = count + 1

Next

 

 

 

End Sub


==========

 

Private

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

Dim ds As New DataClasses1DataContext

Dim query = From q In ds.EmployeeBenefits _

Take (10) _

Select q

Dim oseries As DevExpress.XtraCharts.Series

oseries = Me.ChartControl1.Series(0)

oseries.DataSource = query

oseries.ArgumentScaleType = ScaleType.Numerical

oseries.ArgumentDataMember = "EmployeeDeduction"

 

 

 

oseries.ValueDataMembers.AddRange(New String() {"CompanyDeduction"})

CType(oseries.View, SideBySideBarSeriesView).ColorEach = True

 

 

 

CType(ChartControl1.Diagram, XYDiagram).AxisY.Visible = False

 

 

 

ChartControl1.Legend.Visible = False

 

 

 

End Sub

 

Tags
Quick Fixes
Asked by
Duc Hoang Viet
Top achievements
Rank 1
Share this question
or