Telerik Forums
UI for WinForms Forum
11 answers
405 views

I've been working with the RadRichTextEditor control in my application. It imports and exports simple html -- as I only need things like bold, italics, centering. However, even if I set the FontFamily of the RadRichTextEditor and even the RichTextBoxElement within to Arial, it doesn't respect that when I paste in plain text from an application like Notepad. It changes the text to Verdana with a font size of 12.

 If I copy and paste text from Word, I am fine. It keeps whatever font is was in Word. 

 Additionally, if I use the keyboard and hit shift + enter to give me a single line break (</ br>), It wraps that html with a style tag with the Verdana 12 font. I don't mind the style tag, but it would be nice if it respected the current font where the cursor is.

 Any ideas?

Here is my font properties code (which is overkill, but I'm trying everything to fix this).

public void SetDefaultFontPropertiesToEditor(RadRichTextEditor editor)
        {
            editor.DocumentInheritsDefaultStyleSettings = true;
            editor.RichTextBoxElement.ChangeFontFamily(new Telerik.WinControls.RichTextEditor.UI.FontFamily("Arial"));
            editor.RichTextBoxElement.ChangeFontSize(Unit.PointToDip(10));
            editor.RichTextBoxElement.ChangeFontStyle(Telerik.WinControls.RichTextEditor.UI.FontStyles.Normal);
            editor.RichTextBoxElement.ChangeFontWeight(Telerik.WinControls.RichTextEditor.UI.FontWeights.Normal);
 
            editor.ChangeFontFamily(new Telerik.WinControls.RichTextEditor.UI.FontFamily("Arial"));
            editor.ChangeFontSize(Unit.PointToDip(10));
            editor.ChangeFontStyle(Telerik.WinControls.RichTextEditor.UI.FontStyles.Normal);
            editor.ChangeFontWeight(Telerik.WinControls.RichTextEditor.UI.FontWeights.Normal);
 
            editor.RichTextBoxElement.Document.LineSpacingType = LineSpacingType.AtLeast;
            editor.RichTextBoxElement.Document.LineSpacing = 0;
            editor.RichTextBoxElement.Document.ParagraphDefaultSpacingAfter = 0;
            editor.RichTextBoxElement.Document.ParagraphDefaultSpacingBefore = 10;
        }

Dimitar
Telerik team
 answered on 23 Jun 2015
3 answers
109 views
How can i implement the behaviour that when a user edit´s a Task by moving start and end date the control only snaps every day.
Hristo
Telerik team
 answered on 23 Jun 2015
4 answers
372 views
Hello,

How do we change background color of a radlistitem in radlistbox when mouse is over that specific item programatically?
Currently we can see background color getting changed only when item is selected. Thank you.
Hristo
Telerik team
 answered on 23 Jun 2015
1 answer
61 views

Hi, 

I have a main windows form that includes a racDock with the "AutoDetectMdiChildren" to true.

I need that children MDI winform can be only docked inside the racDock area, so, I would like that the user can dock the MID child form to the top/botton/left/right but not be able to extract the windows to another independent windows outside the parent form where is the racDock control.

How can I disable that the MDI child form could be outside of the parent form?.

Thanks a lot.

Francisco

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 22 Jun 2015
1 answer
85 views

I am adding a simple Progress bar
When I scroll left and right, it appears elsewhere

 

See the attached images A and B (see the subject line)

 

1 is a screen which contains the text in the first row.

I transferred to scroll to the right (2 screens)

I move the scroll to the left (3 screen)

3 is different from the display screen 1 and information
(It overwrites the text the progress bar)
This is an obvious bug!

Dimitar
Telerik team
 answered on 22 Jun 2015
3 answers
316 views

Hi,

I am hoping someone can help me. I am trying to implement a collapsible panel. I have done so far is set the HorizontalHeaderAlignment to the right. I have added header text and an image. I then set the horizontal stretch property to true. So, at this point I have almost achieved my goal. What I would like, is to have image and header text left justified. I can't seem to find any other properties that will help me do this. Is this doable? I have included a screenshot of what I have been able to do so far. Thanks.

Dimitar
Telerik team
 answered on 22 Jun 2015
4 answers
197 views
Hello,

I'm trying to filter a RadGridView against a standard Dataset tableadapter with a SQL server DateTime field.

Some of the field values in the background table column are Null.

The datatable has the field properties set to "AllowDBNull" values, however the error I am receiving is "Invalid filter expression"

When viewing the detail exception I am seeing "Object cannot be cast from DBNull to other types".

The attached image shows the tableadapter field settings and the error dialogs.

Any ideas on how to work around this error without changing from a dataset.

Thanks in advance.
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 19 Jun 2015
1 answer
196 views
(I posted this in general discussion, but I think that was wrong place).  Issue: I had no trouble creating a printable panel control using the documentation provided.  However if I add header and footer height and text to the radprintdocument in the control, the panel is printed overtop of the header.  How can I change so this doesn't happen?  (code for print preview of printable panel pnlCashReceiptsSummary and of custom control below)  Code I'm using for print preview:Dim doc As New RadPrintDocument()
doc.DefaultPageSettings.Landscape = True

doc.HeaderHeight = 100
doc.HeaderFont = New Font("Arial", 14, FontStyle.Bold)
doc.RightHeader = "AAAA"
doc.LeftHeader = "[Date Printed]"
doc.FooterHeight = 100
doc.FooterFont = New Font("Arial", 12)
doc.LeftFooter = GlobalVariables.CurrentDealer.Dealer_Fxd.DealerCode pnlCashReceiptsSummary.PrintPreview(doc) My Control :   Imports Telerik.WinControls.UI
Imports System.Drawing.Printing

Public Class PrintablePanel
Inherits RadPanel
Implements IPrintable


Public Function BeginPrint(sender As RadPrintDocument, args As PrintEventArgs) As Integer Implements IPrintable.BeginPrint

Return 1
End Function

Public Function EndPrint(sender As RadPrintDocument, args As PrintEventArgs) As Boolean Implements IPrintable.EndPrint
Return True
End Function

Public Function GetSettingsDialog(document As RadPrintDocument) As Form Implements IPrintable.GetSettingsDialog
Return New PrintSettingsDialog(document)
End Function

Public Function PrintPage(pageNumber As Integer, sender As RadPrintDocument, args As PrintPageEventArgs) As Boolean Implements IPrintable.PrintPage
Dim bmp As New Bitmap(Me.Width, Me.Height)
Me.DrawToBitmap(bmp, New Rectangle(Point.Empty, Me.Size))
args.Graphics.DrawImage(bmp, Point.Empty)
Return False
End Function

Public Sub Print(ByVal doc As RadPrintDocument)
doc.AssociatedObject = Me
doc.Print()
End Sub

Public Sub PrintPreview(ByVal doc As RadPrintDocument)
doc.AssociatedObject = Me
Dim dialog As New RadPrintPreviewDialog(doc)
dialog.ThemeName = Me.ThemeName
dialog.ShowDialog()
End Sub

Private Function CreatePrintDocument() As RadPrintDocument
Dim doc As New RadPrintDocument()
doc.AssociatedObject = Me
Return doc
End Function
End Class
William
Top achievements
Rank 1
 answered on 18 Jun 2015
2 answers
184 views

I had no trouble creating a printable panel control using the documentation provided.  However if I add header and footer height and text to the radprintdocument in the control, the panel is printed overtop of the header.  How can I change so this doesn't happen?  (code for print preview of printable panel pnlCashReceiptsSummary and of custom control below)

 

 Code I'm using for print preview:

Dim doc As New RadPrintDocument()
doc.DefaultPageSettings.Landscape = True

doc.HeaderHeight = 100
doc.HeaderFont = New Font("Arial", 14, FontStyle.Bold)
doc.RightHeader = "AAAA"
doc.LeftHeader = "[Date Printed]"
doc.FooterHeight = 100
doc.FooterFont = New Font("Arial", 12)
doc.LeftFooter = GlobalVariables.CurrentDealer.Dealer_Fxd.DealerCode

 pnlCashReceiptsSummary.PrintPreview(doc)

 

My Control :  

 Imports Telerik.WinControls.UI
Imports System.Drawing.Printing

Public Class PrintablePanel
Inherits RadPanel
Implements IPrintable


Public Function BeginPrint(sender As RadPrintDocument, args As PrintEventArgs) As Integer Implements IPrintable.BeginPrint

Return 1
End Function

Public Function EndPrint(sender As RadPrintDocument, args As PrintEventArgs) As Boolean Implements IPrintable.EndPrint
Return True
End Function

Public Function GetSettingsDialog(document As RadPrintDocument) As Form Implements IPrintable.GetSettingsDialog
Return New PrintSettingsDialog(document)
End Function

Public Function PrintPage(pageNumber As Integer, sender As RadPrintDocument, args As PrintPageEventArgs) As Boolean Implements IPrintable.PrintPage
Dim bmp As New Bitmap(Me.Width, Me.Height)
Me.DrawToBitmap(bmp, New Rectangle(Point.Empty, Me.Size))
args.Graphics.DrawImage(bmp, Point.Empty)
Return False
End Function

Public Sub Print(ByVal doc As RadPrintDocument)
doc.AssociatedObject = Me
doc.Print()
End Sub

Public Sub PrintPreview(ByVal doc As RadPrintDocument)
doc.AssociatedObject = Me
Dim dialog As New RadPrintPreviewDialog(doc)
dialog.ThemeName = Me.ThemeName
dialog.ShowDialog()
End Sub

Private Function CreatePrintDocument() As RadPrintDocument
Dim doc As New RadPrintDocument()
doc.AssociatedObject = Me
Return doc
End Function
End Class

 

William
Top achievements
Rank 1
 answered on 18 Jun 2015
5 answers
179 views
I've created a simple test application to test the RadPanorama.
My questions:
  1. Is there a way to say "This is the selected tile and this is the visual feedback for it"?
  2. How do I know which is the parent group of a tile?
  3. When rearranging the tiles via Drag&Drop there are always "gaps" in the layout. Is there a way to automatically "close" those gaps?

My found glitsches (see image):
  1. When using a RoundRectShape(12) and setting the Image of a tile, the image is drawn outside of the tile. I've also tested this with BackgroundImage instead of Image.
  2. When resizing the control, the scrollbar is going behind the tiles and there is no way to click the scrollbar.

For the sake of completeness, my source code:
//rama is the RadPanoramaControl
 
public class CustomItem
    {
        public string Group { get; set; }
        public Color Back { get; set; }
        public string Name { get; set; }
        public int Index { get; set; }
 
        public Image Picture { get; set; }
    }
 
public partial class Form1 : Form
    {
        private const int COUNT = 30;
        private List<CustomItem> ItemList = new List<CustomItem>();
 
        public Form1()
        {
            InitializeComponent();
 
            fillList();
        }
 
        private void fillList()
        {
            for (int i = 0; i < COUNT; i++)
            {
                using (Image image = Image.FromFile(@"C:\Users\Public\Pictures\Sample Pictures\JellyFish.jpg"))
                {
                    Image thumb = image.GetThumbnailImage(120, 120, () => false, IntPtr.Zero);
                    ItemList.Add(new CustomItem
                    {
                        Group = "Group 1",
                        Back = Color.BlanchedAlmond,
                        Name = "1-Item " + i,
                        Index = i,
                        Picture = thumb
                    });
                }
            }
 
            for (int i = 0; i < COUNT * 2; i++)
            {
                using (Image image = Image.FromFile(@"C:\Users\Public\Pictures\Sample Pictures\Penguins.jpg"))
                {
                    Image thumb = image.GetThumbnailImage(120, 120, () => false, IntPtr.Zero);
                    ItemList.Add(new CustomItem
                    {
                        Group = "Group 2",
                        Back = Color.LightSkyBlue,
                        Name = "2-Item " + i,
                        Index = i,
                        Picture = thumb
                    });
                }
            }
 
            for (int i = 0; i < COUNT; i++)
            {
                ItemList.Add(new CustomItem
                {
                    Group = "Group 3 has the looooooooooongest Name I've ever seen" + Environment.NewLine + " and even a second line",
                    Back = Color.LimeGreen,
                    Name = "3-Item " + i,
                    Index = i
                });
            }
 
            for (int i = 0; i < COUNT; i++)
            {
                using (Image image = Image.FromFile(@"C:\Users\Public\Pictures\Sample Pictures\Desert.jpg"))
                {
                    Image thumb = image.GetThumbnailImage(120, 120, () => false, IntPtr.Zero);
                    ItemList.Add(new CustomItem
                    {
                        Group = "Group 4",
                        Back = Color.LimeGreen,
                        Name = "4-Item " + i,
                        Index = i,
                        Picture = thumb
                    });
                }
            }
        }
 
        private void fillControl()
        {
            var groups = (from x in ItemList
                          select x.Group).Distinct();
 
            foreach (var groupKey in groups)
            {
                int rowcount = groupKey == "Group 4" ? 5 : 3;
 
                rama.Groups.Add(new TileGroupElement { Name = groupKey, Text = groupKey, RowsCount = rowcount });
            }
 
            foreach (var curViewItem in ItemList)
            {
                if (curViewItem.Index % 2 == 0)
                {
                    Image thumb1;
                    Image thumb2;
                    using (Image image = Image.FromFile(@"C:\Users\Public\Pictures\Sample Pictures\Desert.jpg"))
                    {
                        thumb1 = image.GetThumbnailImage(120, 120, () => false, IntPtr.Zero);
                    }
                    using (Image image = Image.FromFile(@"C:\Users\Public\Pictures\Sample Pictures\Koala.jpg"))
                    {
                        thumb2 = image.GetThumbnailImage(120, 120, () => false, IntPtr.Zero);
                    }
 
                    var liveTile = new RadLiveTileElement
                        {
                            //Text = curViewItem.Name,
                            BackColor = curViewItem.Back,
                            NumberOfColors = 1,
                            ColSpan = 1,
                            ForeColor = Color.CadetBlue,
                            Shape= new RoundRectShape(12)
                            //Image = curViewItem.Picture,
                            //ImageLayout = ImageLayout.Zoom,
                            //TextImageRelation = TextImageRelation.ImageAboveText
                        };
 
                    liveTile.Items.Add(new LightVisualElement
                                           {
                                               Text = "Movie Idea: Pirates of the Carribean",
                                               Image = thumb1,
                                               ImageLayout = ImageLayout.Zoom
                                           });
                    liveTile.Items.Add(new LightVisualElement
                                           {
                                               //Text = "Movie Idea: Inception",
                                               Image = thumb2,
                                               ImageLayout = ImageLayout.Zoom
                                           });
                    liveTile.Items.Add(new LightVisualElement
                                           {
                                               Text = "Movie Idea: The Expendables"
                                           });
                    liveTile.Items.Add(new LightVisualElement
                                           {
                                               Text = "Movie Idea: Harry Potter and the Deathly Hallows"
                                           });
 
                    liveTile.AnimationFrames = 60; //sets the number of frames in a transition
                    liveTile.AnimationInterval = 20; //sets the interval between each frame in the transition in miliseconds
                    liveTile.ContentChangeInterval = 6000; //sets the interval between each content change
                    liveTile.TransitionType = ContentTransitionType.SlideLeft; //sets the type of the transition animation
 
                    ((TileGroupElement)rama.Groups[curViewItem.Group]).Items.Add(liveTile);
                }
                else
                {
                    ((TileGroupElement)rama.Groups[curViewItem.Group]).Items.Add(new RadTileElement
                    {
                        Text = curViewItem.Name,
                        BackColor = curViewItem.Back,
                        NumberOfColors = 1,
                        ColSpan = curViewItem.Index % 3 == 0 ? 2 : 1,
                        //BackgroundImage = curViewItem.Picture,
                        //BackgroundImageLayout=ImageLayout.Zoom,
                        Image = curViewItem.Picture,
                        ImageLayout = ImageLayout.Zoom,
                        TextImageRelation = TextImageRelation.ImageAboveText,
                        Shape = new RoundRectShape(12)
                    });
                }
            }
        }
 
        private void Form1_Load(object sender, EventArgs e)
        {
            rama.ShowGroups = true;
            rama.AllowDragDrop = true;
            rama.ScrollBarAlignment = HorizontalScrollAlignment.Bottom;

            fillControl();
        }
    }

Hristo
Telerik team
 answered on 18 Jun 2015
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)
Chart (obsolete as of Q1 2013)
Form
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
Toolstrip (obsolete as of Q3 2010)
VirtualGrid
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
CheckedDropDownList
ProgressBar
TrackBar
MessageBox
Rotator
SpinEditor
CheckedListBox
StatusStrip
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
Conversational UI, Chat
DateTimePicker
CollapsiblePanel
TabbedForm
CAB Enabling Kit
GroupBox
WaitingBar
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
Styling
Barcode
BindingNavigator
PopupEditor
RibbonForm
TaskBoard
Callout
ColorBox
PictureBox
FilterView
NavigationView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
BarcodeView
BreadCrumb
Security
LocalizationProvider
Dictionary
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
ToolbarForm
NotifyIcon
DateOnlyPicker
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?