Dim contextMenu_Active As New RadContextMenu Dim menuItem1 = New RadMenuItem("Stop") menuItem1.ForeColor = Color.Red AddHandler menuItem1.Click, AddressOf menuItem1_Click Dim menuItem2 As New RadMenuItem("Remove") AddHandler menuItem2.Click, AddressOf menuItem2_Click contextMenu_Active.Items.Add(menuItem1) contextMenu_Active.Items.Add(menuItem2) Private Sub RadGridView_Active_ContextMenuOpening(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.ContextMenuOpeningEventArgs) Handles RadGridView_Active.ContextMenuOpening If TypeOf Me.RadGridView_Active.CurrentRow Is GridViewDataRowInfo Then e.ContextMenu = contextMenu_Active.DropDown End If End Sub Private Sub menuItem1_Click(ByVal sender As Object, ByVal e As EventArgs) Dim index As Integer = Me.RadGridView_Active.Rows.IndexOf(TryCast(Me.RadGridView_Active.CurrentRow, GridViewDataRowInfo)) If index >= 0 Then Dim strGUID = Me.RadGridView_Active.Rows(index).Cells(0).Value Try ccJob.JobStop(strGUID) Catch ex As Exception End Try End If End Sub Private Sub menuItem2_Click(ByVal sender As Object, ByVal e As EventArgs) 'TODO End Sub1. When I render a chart on the screen I simply want to display the chart title at top left, such as:
(Chart Title)
2. However, when that chart is printed, (using RadChart.Printing.PrintChart()), I want the date printed as well, but right justified, and not as impacting, such as a smaller font or italic, such as this:
(Chart Title) Date Printed: 1/13/2011
Is this possible? I figure I could simply add the date printed part to the chart title text when a user prints a chart, and then remove it when printing is completed. However, that doesn't resolve the issues of a different font and right justification.
Can a chart have multiple titles, like a ChartMainTitle and ChartSubTitle? I think that would be the best solution, cause of course each could then be set up completely independently of each other to satisfy all user requests. If this isn't possible, could the feature be added to a future version?
Thanks much,
Dan
| this.radContextMenuManager1.SetRadContextMenu(this.treeView1,this.radContextMenuTree); |
| RadTreeNode node = new RadTreeNode(); | |
| // fill more node properties | |
| node.ContextMenu = radContextMenuNodes.DropDown; |
RadGridViewSearch.DataSource = from pharms in DbContext.Pharmacies where pharms.IsActive && pharms.Branches.Count > 0 orderby pharms.Name select new { pharms.OID, pharms.Name, pharms.PhoneNumber, AddressInfo = String.Format("{0} {1} {2} {3}", pharms.Contact.Addresses.FirstOrDefault().HouseNumber ?? String.Empty, pharms.Contact.Addresses.FirstOrDefault().Street ?? String.Empty, pharms.Contact.Addresses.FirstOrDefault().Area ?? String.Empty, pharms.Contact.Addresses.FirstOrDefault().PostCode ?? String.Empty), CityName = pharms.Contact.Addresses.FirstOrDefault().City.Name, pharms.Branches, pharms.PharmacyCoordinators };RadGridViewSearch.DataSource = from pharms in DbContext.Pharmacies from branches in pharms.Branches.DefaultIfEmpty() from coords in pharms.PharmacyCoordinators.DefaultIfEmpty() where pharms.IsActive && pharms.Branches.Count > 0 && pharms.PharmacyCoordinators.Count > 0 orderby pharms.Name select new { ClientOID = pharms.OID, ClientName = pharms.Name, ClientPhoneNumber = pharms.PhoneNumber, ClientAddressInfo = string.Format("{0} {1} {2} {3}", pharms.Contact.Addresses.FirstOrDefault().HouseNumber ?? string.Empty, pharms.Contact.Addresses.FirstOrDefault().Street ?? string.Empty, pharms.Contact.Addresses.FirstOrDefault().Area ?? string.Empty, pharms.Contact.Addresses.FirstOrDefault().PostCode ?? string.Empty), ClientCityName = pharms.Contact.Addresses.FirstOrDefault().City.Name, BranchOID = branches.OID, BranchName = branches.BranchNumber, BranchPhoneNumber = branches.PhoneNumber, BranchAddressInfo = String.Format("{0} {1} {2} {3}", branches.Contact.Addresses.FirstOrDefault().HouseNumber ?? String.Empty, branches.Contact.Addresses.FirstOrDefault().Street ?? String.Empty, branches.Contact.Addresses.FirstOrDefault().Area ?? String.Empty, branches.Contact.Addresses.FirstOrDefault().PostCode ?? String.Empty), BranchCityName = branches.Contact.Addresses.FirstOrDefault().City.Name, CoordinatorOID = coords.OID, CoordinatorName = coords.FirstName + " " + coords.LastName, CoordinatorCell = coords.MobileNumber, CoordinatorEmail = coords.Email };Private Sub TV_Reports_MouseDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TV_Reports.MouseDoubleClick Try Dim filter As String = "ID='" & TV_Reports.SelectedNode.Tag.ToString & "'" For Each row As DataRow In ds.Tables("TreeView_Reports").Select(filter) If row("Menu_Type").ToString = "Report" Then Me.SqlReportStr = row("Sql_Query") Me.Parent_StatusStripLabel.Text = "Running report: " & row("Name") Me.Parent_StatusStrip.Update() Me.Parent_StatusStrip.Refresh() Dim frm As New Form_Report frm.Text = "Report: " & row("Name") frm.MdiParent = Me frm.FormBorderStyle = Windows.Forms.FormBorderStyle.Sizable frm.Dock = DockStyle.Fill frm.WindowState = FormWindowState.Maximized frm.Show() End If NextCatch ex As Exception End TryEnd SubPublic Class Form_Report Dim ds As New DataSet Dim DT_Report_Results As New DataTable("ReportResults") Dim SqlReportStr As String = Nothing Dim jobcount As Integer = 0 Private Sub Form_Report_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed ds.Clear() ds.Dispose() Me.Dispose() Me.Cursor = Cursors.Default GC.Collect() GC.WaitForPendingFinalizers() GC.WaitForFullGCComplete() GC.WaitForFullGCApproach() GC.Collect() End Sub Private Sub Form_Report_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load ds.Tables.Add(DT_Report_Results) SqlReportStr = Form_Parent.SqlReportStr Me.Cursor = Cursors.WaitCursor Dim Search_Worker As New BackgroundWorker jobcount += 1 AddHandler Search_Worker.DoWork, New DoWorkEventHandler(AddressOf StartReportFill) AddHandler Search_Worker.RunWorkerCompleted, _ New RunWorkerCompletedEventHandler(AddressOf Search_worker_RunWorkerCompleted) Search_Worker.RunWorkerAsync() Search_Worker.Dispose() End Sub Private Sub StartReportFill(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs) FillSqlDs("ReportResults", SqlReportStr) End Sub Private Sub Search_worker_RunWorkerCompleted(ByVal sender As Object, ByVal e As RunWorkerCompletedEventArgs) jobcount -= 1 GridLayout() Me.Cursor = Cursors.Default End Sub Private Sub GridLayout() Try GV_Reports.DataSource = ds GV_Reports.DataMember = "ReportResults" Catch ex As Exception MsgBox(ex.Message) End Try GV_Reports.Columns("Sys_ID").IsVisible = False Form_Parent.Parent_StatusStripLabel.Text = "Ready!" Form_Parent.Parent_StatusStrip.Update() Form_Parent.Parent_StatusStrip.Refresh() End Sub Private Sub FillSqlDs(ByVal tbl As String, ByVal qry As String) If Form_Parent.MyConnection.State = ConnectionState.Closed Then Form_Parent.MyConnection.Open() End If 'Using Form_Parent.MyConnection Dim Dadapter As New SqlDataAdapter Using Dadapter Try Dadapter.SelectCommand = New SqlCommand(qry, Form_Parent.MyConnection) Dadapter.Fill(ds, tbl) Catch ex As Exception MsgBox(ex.Message) End Try End Using End SubEnd Class