Telerik Forums
UI for WinForms Forum
3 answers
662 views

Hi Telerik forum,
I began to use the RichTextEditor to create programmatically a radDocument (so i use the paragraph, span, section object to create it).
Once the document is shown, users can insert formatted paragraph to personalize the document. The html text paragraph are stored in database in html format.

The thing i need is to be able to insert formatted html paragraph into this raddocument already generated.
My problem is to evaluate all the html text (with differents tags inside it, span, table, tr etc). I use the HtmlFormatProvider that works perfectly but it produce a new raddocument. So i tried to convert the htmlformatprovider document into a DocumentFragment, but i have to use fragment.EnumerateChildrenOfType(Of object) and explicitly specify the object type (what i wouldn't do).
What's the best approach to insert html text into an existing raddocument ?

Thanks for your help, hoping that my question is clear.

Here's my sample code : 

Dim document As New RadDocument
Dim section As New Section
 
Dim p9 As New Paragraph
Dim presta1 As New RadDocument
Dim msgHtml = New Html.HtmlFormatProvider
presta1 = msgHtml.Import("<SPAN><STRONG>Table content :</STRONG></SPAN><TABLE STYLE='border:1px solid black'><TR><TD>Marque</TD><TD>Type</TD><TD>N° série</TD><TD>Fluide</TD></TR><TR><TD>-</TD><TD>-</TD><TD>-</TD><TD>-</TD></TR><TR><TD>-</TD><TD>-</TD><TD>-</TD><TD>-</TD></TR></TABLE>")
 
Dim fragment = New DocumentFragment(presta1)
section.Blocks.Add(fragment.EnumerateChildrenOfType(Of Table).ToList.First) 'its working but only with Table tag
 
'Saut de ligne
section.Blocks.Add(New Paragraph)
 
document.Sections.Add(section)
return document

Vipul
Top achievements
Rank 1
 answered on 23 Nov 2017
4 answers
62 views

The following sample code creates a RadRibbonBar\RibbonTab\RadRibbonBarGroup\RadSplitButtonElement UI structure.

Clicking on the radSplitButtonElement1 button causes the click handler (radSplitButtonElement1_Click) to be called twice.

Tested in R3 2017. This is not how it worked in Q1 2013, where the handler was called once.

Is this a bug or an intended change in behavior?

using System;
using System.Diagnostics;
using Telerik.WinControls.UI;
 
namespace wf7
{
    public partial class RadForm1 : RadForm
    {
        public RadForm1()
        {
            InitializeComponent();
 
            RadMenuItem mni1 = new RadMenuItem("item1", 1);
            this.radSplitButtonElement1.Items.Add(mni1);
            this.radSplitButtonElement1.DefaultItem = mni1;
            mni1.Click += radSplitButtonElement1_Click;
 
            RadMenuItem mni2 = new RadMenuItem("item2", 2);
            this.radSplitButtonElement1.Items.Add(mni2);
            mni2.Click += radSplitButtonElement1_Click;
        }
 
        private void radSplitButtonElement1_Click(object sender, EventArgs e)
        {
            Debug.Print("invoked menu item");
        }
    }
    partial class RadForm1
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;
 
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }
 
        #region Windows Form Designer generated code
 
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.radRibbonBar1 = new Telerik.WinControls.UI.RadRibbonBar();
            this.ribbonTab1 = new Telerik.WinControls.UI.RibbonTab();
            this.radRibbonFormBehavior1 = new Telerik.WinControls.UI.RadRibbonFormBehavior();
            this.radRibbonBarGroup1 = new Telerik.WinControls.UI.RadRibbonBarGroup();
            this.radSplitButtonElement1 = new Telerik.WinControls.UI.RadSplitButtonElement();
            ((System.ComponentModel.ISupportInitialize)(this.radRibbonBar1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
            this.SuspendLayout();
            //
            // radRibbonBar1
            //
            this.radRibbonBar1.CommandTabs.AddRange(new Telerik.WinControls.RadItem[] {
            this.ribbonTab1});
            //
            //
            //
            this.radRibbonBar1.ExitButton.Text = "Exit";
            this.radRibbonBar1.Location = new System.Drawing.Point(0, 0);
            this.radRibbonBar1.Name = "radRibbonBar1";
            //
            //
            //
            this.radRibbonBar1.OptionsButton.Text = "Options";
            this.radRibbonBar1.Size = new System.Drawing.Size(292, 162);
            this.radRibbonBar1.TabIndex = 0;
            this.radRibbonBar1.Text = "radRibbonBar1";
            //
            // ribbonTab1
            //
            this.ribbonTab1.IsSelected = true;
            this.ribbonTab1.Items.AddRange(new Telerik.WinControls.RadItem[] {
            this.radRibbonBarGroup1});
            this.ribbonTab1.Name = "ribbonTab1";
            this.ribbonTab1.Text = "tab1";
            this.ribbonTab1.UseMnemonic = false;
            //
            // radRibbonFormBehavior1
            //
            this.radRibbonFormBehavior1.Form = this;
            //
            // radRibbonBarGroup1
            //
            this.radRibbonBarGroup1.Items.AddRange(new Telerik.WinControls.RadItem[] {
            this.radSplitButtonElement1});
            this.radRibbonBarGroup1.Name = "radRibbonBarGroup1";
            this.radRibbonBarGroup1.Text = "radRibbonBarGroup1";
            //
            // radSplitButtonElement1
            //
            this.radSplitButtonElement1.ArrowButtonMinSize = new System.Drawing.Size(12, 12);
            this.radSplitButtonElement1.DefaultItem = null;
            this.radSplitButtonElement1.DropDownDirection = Telerik.WinControls.UI.RadDirection.Down;
            this.radSplitButtonElement1.ExpandArrowButton = false;
            this.radSplitButtonElement1.Name = "radSplitButtonElement1";
            this.radSplitButtonElement1.Text = "radSplitButtonElement1";
            this.radSplitButtonElement1.Click += new System.EventHandler(this.radSplitButtonElement1_Click);
            //
            // RadForm1
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(292, 270);
            this.Controls.Add(this.radRibbonBar1);
            this.FormBehavior = this.radRibbonFormBehavior1;
            this.IconScaling = Telerik.WinControls.Enumerations.ImageScaling.None;
            this.Name = "RadForm1";
            //
            //
            //
            this.RootElement.ApplyShapeToControl = true;
            this.Text = "radRibbonBar1";
            ((System.ComponentModel.ISupportInitialize)(this.radRibbonBar1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();
 
        }
 
        #endregion
 
        private RadRibbonBar radRibbonBar1;
        private RadRibbonFormBehavior radRibbonFormBehavior1;
        private RibbonTab ribbonTab1;
        private RadRibbonBarGroup radRibbonBarGroup1;
        private RadSplitButtonElement radSplitButtonElement1;
    }
}

 

ddd

Alex
Top achievements
Rank 1
 answered on 22 Nov 2017
17 answers
293 views

Hi, I am using version 17.2.502.0 in which I have encountered a problem with the radlistview control in its views (iconview, listview, detailsview), in my case I am using it with iconview; the problem is specifically that sometimes does not select the item when you click and you have to press up to 4 times to select an item this asu prevents the itemmouseclick event from performing correctly.

I hope your support, thank you.

note: I'm using the google translator, apologies from the case.

 

Private Sub CargarArtistas(ByVal lw As RadListView)
        Try
            lw.ItemSize = New Size(180, 180)
            lw.AllowArbitraryItemHeight = True
            lw.ItemSpacing = 3
            lw.EnableKineticScrolling = True
            lw.ListViewElement.ViewElement.ViewElement.Margin = New Padding(3, 3, 3, 3)
            lw.ListViewElement.ViewElement.Orientation = Orientation.Horizontal
            'lw.ListViewElement.DrawFill = False
 
            Me.Listar_VideoTableAdapter.Fill(Me.DsArtistas.Listar_Video, Genero_Predeterminado, "VIDEO")
            lw.DataSource = Me.ListarVideoBindingSource
 
            lw.DisplayMember = "Artista"
            'lw.EnableSorting = True
            'Dim sort As New SortDescriptor("Artista", ListSortDirection.Ascending)
            'lw.SortDescriptors.Add(sort)
        Catch ex As Exception
            MsgBox(ex.Message, MsgBoxStyle.Critical, MsgboxTitle)
        End Try
    End Sub
    Private Sub Frm_Testeo_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Try
            CargarArtistas(lwVideo)
            ThemeResolutionService.LoadPackageFile(Application.StartupPath & "\Themes\CSI_THEME_LW.tssp")
            lwVideo.ThemeName = "CSI_THEME_LW"
        Catch ex As Exception
            MsgBox(ex.Message, MsgBoxStyle.Critical, MsgboxTitle)
        End Try
    End Sub
    Private Sub lwVideo_ItemDataBound(sender As Object, e As ListViewItemEventArgs) Handles lwVideo.ItemDataBound
        Try
            Dim rowView As DataRowView = TryCast(e.Item.DataBoundItem, DataRowView)
            Dim icon As Image
            icon = Image.FromFile(rowView.Row("Foto"))
            e.Item.Image = icon.GetThumbnailImage(180, 180, Nothing, IntPtr.Zero)
        Catch ex As Exception
            MsgBox(ex.Message, MsgBoxStyle.Critical)
        End Try
    End Sub
    Private Sub Show_FormArtistas(ByVal lw As RadListView)
        Try
            Codigo_Genero_Seleccionado = TryCast(lw.SelectedItem.Item("CodGenero").ToString, String)
            Genero_Seleccionado = TryCast(lw.SelectedItem.Item("Genero").ToString, String)
            Artista_Seleccionado = TryCast(lw.SelectedItem.Item("Artista").ToString, String)
            Foto_Seleccionado = TryCast(lw.SelectedItem.Item("Foto").ToString, String)
            Formato_Seleccionado = TryCast(lw.SelectedItem.Item("Tipo").ToString, String)
 
            Formulario = "Artistas"
 
            Dim oFrm_Gray As New Frm_Gray
            oFrm_Gray.BackColor = Color.FromArgb(BackColor_GUI)
            oFrm_Gray.Opacity = 0.5
            oFrm_Gray.ShowDialog()
 
        Catch ex As Exception
            MsgBox(ex.Message, MsgBoxStyle.Critical, MsgboxTitle)
        End Try
    End Sub
    Private Sub lwVideo_ItemMouseClick(sender As Object, e As ListViewItemEventArgs) Handles lwVideo.ItemMouseClick
        Try
            Show_FormArtistas(lwVideo)
        Catch ex As Exception
            MsgBox(ex.Message, MsgBoxStyle.Critical, MsgboxTitle)
        End Try
    End Sub
    Private Sub lwVideo_VisualItemCreating(sender As Object, e As ListViewVisualItemCreatingEventArgs) Handles lwVideo.VisualItemCreating
        Try
            e.VisualItem = New CustomVisualItem
        Catch ex As Exception
            MsgBox(ex.Message, MsgBoxStyle.Critical, MsgboxTitle)
        End Try
    End Sub
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 22 Nov 2017
4 answers
684 views
Hello
I want to export data from multiple RadGridView to a single Excel file with multiple sheet. What I tried now it can export only 1 gridview to 1 file, if I try to export to same file, it was overwritten.

I did a search and found that it can't be done during last year. not sure what is the current status now.

http://www.telerik.com/community/forums/winforms/gridview/export-to-excel-with-gridview.aspx


Could anyone provide me an example please?

Best Regards,
Smith
Hristo
Telerik team
 answered on 22 Nov 2017
4 answers
363 views

I have a gantt view that I want to populate with data, but when i set it to the day range the the major timeline grid sizing seems to scale to the size of the container rather than to the secondary time line grid (see attached picture). The gantt view items are properly scaled to the major grid, but the secondary timeline markings are wrong. Is there a setting that i can use to make the major timeline grid marks stretch over all the available secondary timeline markings?

This is running on windows 10, telerik ui for winforms 2016 R3.

To replicate the issue create a new project with a gantview and use the following code in the load function.

        RadGanttView1.GanttViewElement.GraphicalViewElement.TimelineRange = Telerik.WinControls.UI.TimeRange.Day
        RadGanttView1.GanttViewElement.GraphicalViewElement.TimelineStart = Today
        RadGanttView1.GanttViewElement.GraphicalViewElement.TimelineEnd = Today.AddHours(24)
        Dim tasks As New DataTable("Tasks")
        tasks.Columns.Add("Id", GetType(Integer))
        tasks.Columns.Add("ParentId", GetType(Integer))
        tasks.Columns.Add("Title", GetType(String))
        tasks.Columns.Add("Start", GetType(DateTime))
        tasks.Columns.Add("End", GetType(DateTime))
        tasks.Columns.Add("Progress", GetType(Decimal))
        Dim links As New DataTable("Links")
        links.Columns.Add("StartId", GetType(Integer))
        links.Columns.Add("EndId", GetType(Integer))
        links.Columns.Add("LinkType", GetType(Integer))
        Dim data As New DataSet()
        data.Tables.Add(tasks)
        data.Tables.Add(links)
        tasks.Rows.Add(1, 0, "Summary task title", Today.AddHours(11), Today.AddHours(12), 30D)
        tasks.Rows.Add(2, 1, "First child task title", Today.AddHours(11), Today.AddHours(11.5), 10)
        tasks.Rows.Add(3, 1, "Second child task title", Today.AddHours(11.5), Today.AddHours(12), 20D)
        tasks.Rows.Add(4, 1, "Milestone", Today.AddHours(12), Today.AddHours(12), 0D)
        links.Rows.Add(2, 3, 1)
        links.Rows.Add(3, 4, 1)
        Me.RadGanttView1.GanttViewElement.TaskDataMember = "Tasks"
        Me.RadGanttView1.GanttViewElement.ChildMember = "Id"
        Me.RadGanttView1.GanttViewElement.ParentMember = "ParentId"
        Me.RadGanttView1.GanttViewElement.TitleMember = "Title"
        Me.RadGanttView1.GanttViewElement.StartMember = "Start"
        Me.RadGanttView1.GanttViewElement.EndMember = "End"
        Me.RadGanttView1.GanttViewElement.ProgressMember = "Progress"
        Me.RadGanttView1.GanttViewElement.LinkDataMember = "Links"
        Me.RadGanttView1.GanttViewElement.LinkStartMember = "StartId"
        Me.RadGanttView1.GanttViewElement.LinkEndMember = "EndId"
        Me.RadGanttView1.GanttViewElement.LinkTypeMember = "LinkType"
        Me.RadGanttView1.GanttViewElement.DataSource = data
        Me.RadGanttView1.Columns.Add("Start")
        Me.RadGanttView1.Columns.Add("End")

 

Hristo
Telerik team
 answered on 22 Nov 2017
3 answers
85 views
Hello, I am a user using telerik winforms.
I am gratefully using radmap.
But I can not solve this problem, so I leave a post.

I am doing research to simulate drifting objects in the ocean.
But since a drifting object can not pass through the ground, I need a way to know if the specific coordinates are in the ground or in the sea.
It seems difficult to solve this method using 'Elevation'.

to sum it up,
Whether there is a way to know whether a specific point is the sea or the land.

Thank you.
Hristo
Telerik team
 answered on 22 Nov 2017
4 answers
765 views
Hi,
In my application I use RadPropertyGrid and I create set of properties for it in my code using RadPropertyStore.

Before I started to use RadPropertyGrid all properties were displayed in group-boxes with different controls like text-box, drop-down and button. It was a mess.
One of the properties should contain path to some local directory. And in old implementation it was displayed by text box and browse button that was opening FolderBrowserDialog 
.
As you might already imagine, my question is how can I insert FolderBrowserDialog to RadPropertyGrid?
What I have managed to do is below:
    public partial class SettingsManager : UserControl
    {
        public SettingsManager()
        {
            InitializeComponent();
            _propertyStore = CreateProperties();
            radPropertyGrid1.SelectedObject = _propertyStore;
            radPropertyGrid1.PropertySort = PropertySort.CategorizedAlphabetical;
        }
        private RadPropertyStore _propertyStore;
        private PropertyStoreItem _defaultSaveDirectory;
 
        private RadPropertyStore CreateProperties()
        {
            var result = new RadPropertyStore();
            _defaultSaveDirectory = new PropertyStoreItem(typeof(string),
                                                        "DefaultSaveFolder",
                                                        Properties.Settings.Default.DefaultSaveFolderPath,
                                                        "Default directory for saving snapshot and configuration files.",
                                                        "Save Snapshot/Configuration",
                                                        false);
            _defaultSaveDirectory.PropertyChanged += OnDefaultSaveDirectoryChanged;
            result.Add(_defaultSaveDirectory);
            return result;
        }
 
        void OnDefaultSaveDirectoryChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            var folderDialog = new FolderBrowserDialog {
                                                           Description = Resources.DefaultLocationDialogHelp,
                                                           ShowNewFolderButton = true
                                                       };
 
            if (DialogResult.OK == folderDialog.ShowDialog())
            {
                _defaultSaveDirectory.PropertyChanged -= OnDefaultSaveDirectoryChanged;
                _defaultSaveDirectory.Value = folderDialog.SelectedPath;
                _defaultSaveDirectory.PropertyChanged += OnDefaultSaveDirectoryChanged;
                Properties.Settings.Default.DefaultSaveFolderPath = folderDialog.SelectedPath;
            }
        }
}

But I have two problems with this implementation:
1) FolderBrowserDialog opens on initialization
2) There is no such a thing like Click event for PropertyStoreItem, so user have to really change the property value in order to FolderBrowserDialog to appear

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 21 Nov 2017
8 answers
392 views
I have a telerik GridView contains ComboBoxcolumn, the filtering type when i search inside the Combobox Column is 'StartWith'. and I want to change it to 'Contains'. How could i do it?
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 21 Nov 2017
1 answer
257 views

Hi sir/Madam,

I am a programmer evaluating the raddock

Created the form and add raddock control.

I hv created one text box in right side tool window.

I hv a radform as a document in the dock container.

I need to access the tool window text box and pass the value to the text box from the

document form.

I am unable to access the text box control which is resided in the tool window of raddock.

Please help me for the above.

Regards

Hristo
Telerik team
 answered on 21 Nov 2017
1 answer
200 views

It's really not that complicated to manually remove "mask" characters from a string but I was curious if this control already has this ability built in?

Here's an example:

assume ctrl = RadMaskedEditBox

ctrl.Mask = "00000-9999"

ctrl.Text = "_____-____"

ctrl.MaskType = Standard

 

If the user gets to this input box and types in "12345" and I check ctrl.Value I get this: "12345-____" when what I really want is "12345"

If I'm missing something, please advise otherwise, i'll just grunt my way through it :)

Thanks everyone!!!

-Curtis

 

 

Dimitar
Telerik team
 answered on 21 Nov 2017
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?