Telerik Forums
UI for WinForms Forum
2 answers
523 views
Hi - I'm trying to print silently to the default printer though either the the radPDFViewerNavigator print button or the radPDFViewer default context menu.

For the radPDFViewerNavigator print button click event, I have the following:
me.RadPdfViewer1.Print(False)

This causes the document to print directly to the default printer but then right after that it still brings up the print dialog box.  Is there any way to keep the dialog box from showing?

As for the context menu print option, I can't seem to find a way to get the click event of this in order to override showing the print dialog box.

Any assistance on this will be greatly appreciated.
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 29 Sep 2014
2 answers
198 views
Hi Team,

i am creating new design for my windows application and i am using visual style builder 2014.

i have created design for many controls till now but now i am facing issue in ListView.
When we create design for ListView it will be only applied to simple view but not icon view or detail view.

Now here i need to design Icon View for ListView. So, for this which event i should design?

Thank You.
jhon
Top achievements
Rank 1
 answered on 29 Sep 2014
17 answers
445 views
Hello everybody I'm from Brazil so I do not know if what I wrote here is right, but back to the subject of a need to help make a BubbleBar, if someone had a project to send me an example would be grateful, because I do not know the codes got mount the RadControls for WinForms Q3 2010 Demos and multiple errors. I will mention a few:
* Error 1 'RadControlsWinFormsApp1.Form1'does not contain 'the definition for' EnabledQSFButtons' and the extension method 'EnabledQSFButtons' accepting a first argument of type' RadControlsWinFormsApp1.Form1 'could b found (are you missing a usingdirective or an assembly reference? ) C: \ test \ RadControlsWinFormsApp1 \ RadControlsWinFormsApp1 \ Form1.cs 17 18RadControlsWinFormsApp1
* Error   2   The type or namespace name 'Examples' does not exist in the namespace 'Telerik' (are you missing an assembly reference?)   C:\teste\RadControlsWinFormsApp1\RadControlsWinFormsApp1\Form1.Designer.cs   31   43   RadControlsWinFormsApp1
* Error   3   'RadControlsWinFormsApp1.Form1' does not contain a definition for 'settingsPanel' and no extension method 'settingsPanel' accepting a first argument of type 'RadControlsWinFormsApp1.Form1' could be found (are you missing a using directive or an assembly reference?)   C:\teste\RadControlsWinFormsApp1\RadControlsWinFormsApp1\Form1.Designer.cs   39   62   RadControlsWinFormsApp1
* Error   7   The type or namespace name 'Examples' does not exist in the namespace 'Telerik' (are you missing an assembly reference?)   C:\teste\RadControlsWinFormsApp1\RadControlsWinFormsApp1\Form1.Designer.cs   77   23   RadControlsWinFormsApp1
* Warning   10   Could not find type 'RadControlsWinFormsApp1.BubbleBar'.  Please make sure that the assembly that contains this type is referenced.  If this type is a part of your development project, make sure that the project has been successfully built.       0   0  
* Warning   11   The variable 'bubbleBar1' is either undeclared or was never assigned.   C:\teste\RadControlsWinFormsApp1\RadControlsWinFormsApp1\Form1.Designer.cs   169   0  
* Warning   13   Could not find type 'settingsPanel'.  Please make sure that the assembly that contains this type is referenced.  If this type is a part of your development project, make sure that the project has been successfully built.   C:\teste\RadControlsWinFormsApp1\RadControlsWinFormsApp1\Form1.Designer.cs   173   0   
The sooner help me be very grateful as I am doing my course conclusion work and would like to implement this option.
Thank you for your attention.
Alan


Stefan
Telerik team
 answered on 29 Sep 2014
7 answers
1.2K+ views
I am working on a Windows Forms Application that automatically loads a PDF file and then scrolls through the pages.  I am using 2 timers, one to scroll the page, and the other to check for a new version of the PDF file.  When I find a new version of the PDF file, I unload the current file and then load the new file.  All of this appears to work.  The problem is that the document does not appear unless I click on the form.  I can see the scroll bar moving.

Here is the subroutine that loads the document:

    Private Sub LoadPDFFile()

        If File.Exists(My.Settings.PDFFileName) Then
            mCurrrentFileInfo = My.Computer.FileSystem.GetFileInfo(My.Settings.PDFFileName)

            If PdfViewer.IsLoaded Then
                PdfViewer.UnloadDocument()
            End If

            PdfViewer.LoadDocument(My.Settings.PDFFileName)
            PdfViewer.PdfViewerElement.GoToPage(1)
        End If

    End Sub


OS: Windows 8
.Net 4.5
PDFViewer Version: 2014.2.715.40
michael schroeder
Top achievements
Rank 1
 answered on 26 Sep 2014
5 answers
549 views
I am experimenting with an application that will give me CPU Usage, Memory Usage, and I want to expand it from there. Right now it goes to two Text Boxes. I combined it into the first text box 

How do I display each value in two GridView Columns?

Here is what I have now;

using System;
using System.Diagnostics;
using System.Data;
using System.Windows.Forms;
 
namespace MemOV
{
    public partial class FrmMain : Form
    {
        private PerformanceCounter cpuCounter;
        private PerformanceCounter ramCounter;
 
        public FrmMain()
        {
            InitializeComponent();
            InitializeCpuCounter();
            InitializeRamCounter();
            updateTimer.Start();
        }
 
        private void UpdateTimerTick(object sender, EventArgs e)
        {
            this.textBox1.Text = "CPU Usage: " + Convert.ToInt32(cpuCounter.NextValue()).ToString() + "%" + "  | " + "Memory Usage: " + Convert.ToInt32(ramCounter.NextValue()).ToString() + "Mb";
            this.textBox2.Text = Convert.ToInt32(ramCounter.NextValue()).ToString() + "Mb";
        }
 
        private void Form1_Load(object sender, EventArgs e)
        {
 
        }
 
        private void InitializeCpuCounter()
        {
            cpuCounter = new PerformanceCounter("Processor", "% Processor Time", "_Total", true);
        }
 
        private void InitializeRamCounter()
        {
            ramCounter = new PerformanceCounter("Memory", "Available MBytes", true);
        }
    }
}


Dimitar
Telerik team
 answered on 26 Sep 2014
3 answers
92 views
Hello,

I develop stock manager application for my company

I've a error message  converter can't convert

With VS2013 DataGridView, it's work but not with RadGridView

My code :

Private Sub MasterTemplate_CellClick(sender As Object, e As Telerik.WinControls.UI.GridViewCellEventArgs) Handles RadGridView1.CellClick
        If e.ColumnIndex = 0 Then
            Dim oCell As GridViewCellInfo = DirectCast(RadGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex), GridViewCellInfo)
            If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
                Dim oImage As Image = Image.FromFile(OpenFileDialog1.FileName)
                oCell.Value = resizeImage(oImage, 48, 48)
            Else
                Dim oResult As DialogResult = MessageBox.Show("Voulez-vous supprimer l'icône associée à ce produit ?", "Icône du produit", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
                If oResult = Windows.Forms.DialogResult.Yes Then oCell.Value = Nothing
            End If
        End If
End Sub

Private Function resizeImage(ByVal oImage As Image, iWidth As Integer, iHeight As Integer) As Image
        Dim oSource As Bitmap = New Bitmap(oImage)
        Dim dScale As Double = oSource.Height / oSource.Width
        Dim oDest As New Bitmap(iWidth, iHeight)
        Dim gDest As Graphics = Graphics.FromImage(oDest)
        With gDest
            .InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic
            .SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias
            .CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality
            .DrawImage(oSource, 0, 0, oDest.Width, oDest.Height)
            Return oDest
        End With
End Function





Dimitar
Telerik team
 answered on 26 Sep 2014
1 answer
109 views
Hi,

I use telerik Version 2011.1.411.2 (Runtime 2.0.50727).

I added a new colum in my database schema (for information double d_Value),
and I want that the data that is already memorized in database take value "1.0" not "0.0".

Can you explain how can I do ?

In advance, Thanks,
Richard.
Doroteya
Telerik team
 answered on 26 Sep 2014
5 answers
138 views
Hello to all!

I've a GridViewMaskBoxColumn, where float are displayed using the exponental notation.  When I try to change a cells value, I can put the wished values, but when I leave the editor, the application crashs (even if I put only a '0')

The crash happens immediately after leaving the 'CellEndEdit'.

What went wrong in my source?

Thanks for your help!




   
   System.NullReferenceException wurde nicht behandelt.
  Message=Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
  Source=Telerik.WinControls.UI
  StackTrace:
       bei Telerik.WinControls.UI.RegexMaskTextBoxProvider.KeyDown(Object sender, KeyEventArgs e)
       bei Telerik.WinControls.UI.RadMaskedEditBoxElement.TextBoxItem_KeyDown(Object sender, KeyEventArgs e)
       bei System.Windows.Forms.KeyEventHandler.Invoke(Object sender, KeyEventArgs e)
       bei Telerik.WinControls.RadItem.OnKeyDown(KeyEventArgs e)
       bei Telerik.WinControls.UI.RadTextBoxItem.TextBoxControl_KeyDown(Object sender, KeyEventArgs e)
       bei System.Windows.Forms.Control.OnKeyDown(KeyEventArgs e)
       bei System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
       bei System.Windows.Forms.Control.ProcessKeyMessage(Message& m)
       bei System.Windows.Forms.Control.WmKeyChar(Message& m)
       bei System.Windows.Forms.Control.WndProc(Message& m)
       bei System.Windows.Forms.TextBoxBase.WndProc(Message& m)
       bei System.Windows.Forms.TextBox.WndProc(Message& m)
       bei Telerik.WinControls.UI.HostedTextBoxBase.WndProc(Message& message)
       bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
       bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       bei System.Windows.Forms.Application.Run(Form mainForm)
       bei Maxsyma.PLCExplorer.Program.Main() in e:\...\SourceCode\Regex\Program.cs:Zeile 40.
  InnerException:



Here is my code:

private void InitializeGrid()
{
..
    newColumn = new GridViewMaskBoxColumn();    // for float
    newColumn.Name = "Gleitpunkt";
    newColumn.TextAlignment = ContentAlignment.MiddleRight;
    newColumn.Width = 60;
    newColumn.HeaderText = "Gleitpunkt";
    newColumn.FormatString = "{0:0.000000e0}";
    this.radGridViewCapture.Columns.Add(newColumn);
..
}

private void CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
{
    if (this.radGridViewCapture.ActiveEditor is RadMaskedEditBoxEditor)
    {
        RadMaskedEditBoxEditor spinEditor = this.radGridViewCapture.ActiveEditor as RadMaskedEditBoxEditor;
        spinEditor.EditorElement.Alignment = ContentAlignment.MiddleCenter;
        spinEditor.EditorElement.StretchVertically = false;
        this.radGridViewCapture.CurrentCell.Alignment = ContentAlignment.MiddleCenter;
    }
}

private void CellEditorInitialized(object sender, GridViewCellEventArgs e)
{
    if (this.radGridViewCapture.ActiveEditor is RadMaskedEditBoxEditor)
    {
        RadMaskedEditBoxEditor spinEditor = this.radGridViewCapture.ActiveEditor as RadMaskedEditBoxEditor;
        if (e.Column.Name == ColumnName.Names[ColumnName.ResultGleitpunkt])
        {
            spinEditor.MaskTextBox.MaskType = MaskType.Regex;
            spinEditor.MaskTextBox.Mask = "[-+]?([0-9]*[,.])?[0-9]+([eE][-+]?[0-9]+)?"; // e.g. 123.4e+5
        }
    }
}

private void CellEndEdit(object sender, GridViewCellEventArgs e)
{
    if (e.Column.Name == "Gleitpunkt")
    {
        float myNewValue = float.Parse(e.Row.Cells[e.ColumnIndex].Value.ToString());
        
        // myNewValue is e.g. 0 or  123  or  123.4e-88 and is correct so far
    }
}            




George
Telerik team
 answered on 25 Sep 2014
3 answers
198 views
I  have  Telerik winforms Q3 2011 SP1 version. I want to print a gridview but I didn't find RadPrintDocument. Is there any way gridview printing.
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 25 Sep 2014
2 answers
477 views
I need to disable the radbutton just before the click event is fired, and finally resume its enabled state after the click event.
I tried to create a property like this in my CustomRadButton:
/// <summary>
        /// On click event
        /// </summary>
        /// <param name="e"></param>
        protected override void OnClick(EventArgs e)
        {
            if (this.multiClickAccepted)
                base.OnClick(e);
            else
            {
                //if the multiclick is disabled (as default) disable the button before raise any event
                this.temporaryEnabled = this.Enabled;
                base.Enabled = false;
                base.OnClick(e);
                base.Enabled = (bool)this.temporaryEnabled;
                this.temporaryEnabled = null;
                //after the reactivation look for any binding to restore the correct button state
                if (this.DataBindings != null)
                {
                    foreach (System.Windows.Forms.Binding b in this.DataBindings)
                    {
                        if (b.PropertyName.Equals("Enabled"))
                            b.ReadValue();
                    }
                }
            }
        }

But in debug I found out that the base.OnClick(e); event is asynchronous.

Can you suggest something to solve my problem?

Thanks
Dimitar
Telerik team
 answered on 25 Sep 2014
Narrow your results
Selected tags
Tags
GridView
General Discussions
Scheduler and Reminder
Treeview
Dock
RibbonBar
Themes and Visual Style Builder
ChartView
Calendar, DateTimePicker, TimePicker and Clock
DropDownList
Buttons, RadioButton, CheckBox, etc
ListView
ComboBox and ListBox (obsolete as of Q2 2010)
Form
Chart (obsolete as of Q1 2013)
PageView
MultiColumn ComboBox
TextBox
RichTextEditor
PropertyGrid
Menu
RichTextBox (obsolete as of Q3 2014 SP1)
Panelbar (obsolete as of Q2 2010)
PivotGrid and PivotFieldList
Tabstrip (obsolete as of Q2 2010)
MaskedEditBox
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
VirtualGrid
Toolstrip (obsolete as of Q3 2010)
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
SplitContainer
Documentation
Map
DesktopAlert
CheckedDropDownList
ProgressBar
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
CollapsiblePanel
LayoutControl
ShapedForm
SyntaxEditor
Wizard
TextBoxControl
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
GroupBox
WaitingBar
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
FileDialogs
ColorDialog
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
RibbonForm
Styling
Barcode
PopupEditor
TaskBoard
NavigationView
Callout
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
BreadCrumb
ButtonTextBox
FontDropDownList
BarcodeView
Overlay
Security
LocalizationProvider
Dictionary
SplashScreen
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
SpeechToTextButton
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?