Telerik Forums
UI for WinForms Forum
8 answers
130 views

I'm writing a custom editor which have to contains 2 drowdown controls: the second dropdown must be filled on values loaded from DB based on value selected in first dropdown. I need to let user add new values for both dropdowns.

I tried two ways but with no success.

First way: I created a custom editor containing 2 DrowDownListEditorElements and I tried to override EndEdit() method of each object to create new items if needed, but it seems that each EndEdit was never invoked and I cannot intercept  when user pass from one dropdown to other, or when exit from the editor.

 

Second way: I created a custom editor containing a user control containing two RadDropDownList controls and I used the Leave event of each dropDown to obtain excepted behaviour, but all I obtained is that EndEdit() of editor was first called before other event of child/nested controls.(for example if user press TAB when focused on second dropdown, editor EndEdit is fired before the drowdown Leave event handler, so new values aren't created yet and Editor value has not been set.

What's the correct way to manage events in complex grid cell custom editors?

Thnaks.

 

 

Alessio Bulleri
Top achievements
Rank 1
 answered on 30 Jan 2017
3 answers
303 views

Dear Telerik,

I am using winworms PivotGrid and PivotFeildList.

In the PivotFieldlist I want to have more aggregate functions like upper quartile and lower quartile.

Plese let me know if it is possible to make a custom function.

Thanks,

Nishan.

Hristo
Telerik team
 answered on 26 Jan 2017
1 answer
199 views

I am running into a memory issue when trying to perform a mail merge. I need to do two things:
1. Generate individual PDF files to be stored on a file share
2. generate a single PDF so it could be sent to a printer as a single job.

I am noticing, that after my large PDF file is generated, the memory usage remains very large. When I re-run the process, it starts climbing up, but then falls back down to an acceptable level during the generation of single document, only to climb back up during the final single PDF. I am pasting my code below. For some odd reason my random data isn't actually making it into the files, but since that's not my problem at this moment, I am not concerned about it.

using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Telerik.WinForms.Documents.FormatProviders.OpenXml.Docx;
using Telerik.WinForms.Documents.FormatProviders.Pdf;
using Telerik.WinForms.Documents.Model;
 
namespace MailMergeMemoryBenchmark
{
    public partial class RadForm1 : Telerik.WinControls.UI.RadForm
    {
        List<DummyItem> dataSource;
        public RadForm1()
        {
            //get the rest of the string at http://pastebin.com/i6PZiJ1c
            byte[] template = Convert.FromBase64String(@"UEsDBBQ...[TRUNCATED]");
            dataSource = new List<DummyItem>();
            for (int i = 0; i < 1000; i++)
            {
                dataSource.Add(DummyItem.GetRandom());
            }
            InitializeComponent();
            var provider = new DocxFormatProvider();
            radRichTextEditor1.Document = provider.Import(template);
            radRichTextEditor1.ScaleFactor = new Telerik.WinForms.Documents.Model.SizeF(.4f, .4f);
            radRichTextEditor1.ChangeAllFieldsDisplayMode(FieldDisplayMode.Code);
            radRichTextEditor1.Document.ShowMergeFieldsHighlight = true;
            radRichTextEditor1.Document.MailMergeDataSource.ItemsSource = dataSource;
        }
 
        private async void btnPerformMailMerge_Click(object sender, EventArgs e)
        {
            btnPerformMailMerge.Enabled = false;
            var progress = new Progress<string>(value => UpdateProgress(value));
            await Go(progress);
            btnPerformMailMerge.Enabled = true;
        }
 
        private void UpdateProgress(string value)
        {
            radLabel1.Text = value + Environment.NewLine;
        }
 
        private Task<bool> Go(IProgress<string> progress)
        {
            return Task.Run(() =>
            {
                var pdfProvider = new PdfFormatProvider();
 
                PdfExportSettings pdfExportSettings = new PdfExportSettings()
                {
                    ContentsCompressionMode = PdfContentsCompressionMode.Automatic,
                    ContentsDeflaterCompressionLevel = 9,
                    FloatingUIContainersExportMode = PdfInlineUIContainersExportMode.Image,
                    ImagesCompressionMode = PdfImagesCompressionMode.Automatic,
                    ImagesDeflaterCompressionLevel = 9,
                    InlineUIContainersExportMode = PdfInlineUIContainersExportMode.Image,
                };
                pdfProvider.ExportSettings = pdfExportSettings;
                byte[] letterBytes;
                radRichTextEditor1.Document.MailMergeDataSource.MoveToFirst();
                int i = 0;
                do
                {
                    using (var document = radRichTextEditor1.Document.MailMergeCurrentRecord())
                    {
                        letterBytes = pdfProvider.Export(document);
                        File.WriteAllBytes($"{i}-{DateTime.Now.Ticks}.pdf", letterBytes);
                    }
                    letterBytes = null;
                    progress.Report($"Merged {i + 1} out of {dataSource.Count()}");
                    i++;
                } while (radRichTextEditor1.Document.MailMergeDataSource.MoveToNext());
                progress.Report($"Starting large PDF creation");
                using (var document = radRichTextEditor1.MailMerge(true))
                {
                    letterBytes = pdfProvider.Export(document);
                    File.WriteAllBytes($"ALL RECORDS-{DateTime.Now.Ticks}.pdf", letterBytes);
                }
                progress.Report($"Done with large PDF creation");
                letterBytes = null;
                pdfProvider = null;
                pdfExportSettings = null;
                GC.Collect();
                return true;
            });
        }
 
 
    }
 
    internal class DummyItem
    {
        public string ContactName;
        public string CompanyName;
        public string Address;
        public static DummyItem GetRandom()
        {
            return new DummyItem()
            {
                ContactName = RandomStringGenerator.RandomString(20, 40),
                CompanyName = RandomStringGenerator.RandomString(20, 40),
                Address = RandomStringGenerator.RandomString(100, 200)
            };
        }
    }
 
    internal static class RandomStringGenerator
    {
        private const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ";
        private static Random random = new Random();
        public static string RandomString(int minLength, int maxLength)
        {
            var length = random.Next(minLength, maxLength);
            return new string(Enumerable.Repeat(chars, length)
              .Select(s => s[random.Next(s.Length)]).ToArray());
        }
    }
}
Hristo
Telerik team
 answered on 26 Jan 2017
3 answers
118 views

I'm working with radrichtexteditor and I'm trying to insert section breaks, the problems is that I need the next section to star on the same page, I don't have this option, as I only have NextPage,EvenPage and OddPage. Please let me know if there's a way to accomplish this.

My versions
UI for WinForms is 2015.2.728
radrichtexteditor is v4.0.30319

Thank you.

 

Hristo
Telerik team
 answered on 26 Jan 2017
8 answers
287 views

I am using a RadTreeView and the DragDropService to Drag/Drop of nodes into the same tree at different levels.  The data on the Tree is bound to an object.  Everything is working except, I can't get the tree on my form to show when the dragdrop has completed so I can update the underline table when changes are made. None of the events are firing,   DragDrop, DragEnded, etc.  What am I missing.

If this has already been discussed, can someone just point me to the thread. I search, but didn't see this anywhere.

TIA.

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 25 Jan 2017
0 answers
146 views

Hi,

I am creating RadDock at runtime and adding tool windows to it. But, I am not able to set backcolor for remaining space.

Please refer attached image & suggest a workaround.

 

Thanks,

Harshal.

harshal
Top achievements
Rank 1
 asked on 25 Jan 2017
4 answers
202 views
Hello!

I have a database with two separate tables for different kinds of appointments; one for calls and tasks, and another for actual meetings.

I want these all to be shown in the same RadScheduler, but as far as I can tell, it only takes one data source with one set of AppointmentMappingInfo (the two tables have some column names that differ).  How can I bind data from both tables into the same RadScheduler?

Thank you!
Christopher
Top achievements
Rank 1
 answered on 24 Jan 2017
2 answers
269 views

I don't know if I missed a property or if I'll need to use the KeyDown/KeyPress events, but is there an easy or preferred way that I can turn off the feature that allows the right and left arrow keys to navigate through the pages of a RadPageView?

 

I have an application where I have the tab strip hidden and am programmatically controlling the page navigation.

 

Thanks.

Larry
Top achievements
Rank 1
 answered on 24 Jan 2017
1 answer
184 views
Column reorder is enable in RadGridView. want to track the column order.
 
say I have three column Id, and . order is 1 2 and3. so my DB will have values like 1,2,3.
If I swap and name, require as 1,3,2.

Please Suggest.
Dimitar
Telerik team
 answered on 24 Jan 2017
5 answers
186 views

Hello Team,

 

Please see the attached screen.Could you please guide me how to implement the custom treeview

 

 

Dimitar
Telerik team
 answered on 24 Jan 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)
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
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?