Telerik Forums
UI for WinForms Forum
1 answer
170 views
UPDATE: I fixed this by loading the html string directly instead of first converting to a byte array.

So this:
    string text = File.ReadAllText(@"c:\temp\RichText.txt");
    Byte[] convertedText = Encoding.ASCII.GetBytes(text);
    RadDocument document = _htmlFormatProvider.Import(convertedText);

became this:
    string text = File.ReadAllText(@"c:\temp\RichText.txt");
    RadDocument document = _htmlFormatProvider.Import(text);





When I save and reload using an HtmlFormatProvider I get strange results with Tab characters.

Here is an example where the original text is "a<tab>b<tab>c".

The first time it is saved it looks like this. The tabs have been replaced with two "&nbsp;":
<style type="text/css">
.p_CC664AAA { margin: 0px 0px 12px 0px;text-align: left;text-indent: 0pt;padding: 0px 0px 0px 0px; } 
.s_6BF1D20F { font-family: 'Calibri';font-style: normal;font-size: 16px;color: #000000; } 
</style><p class="p_CC664AAA"><span class="s_6BF1D20F">a&nbsp; &nbsp; b&nbsp; &nbsp; c</span></p>

After reloading and saving again it looks like this. The two "&nbsp;" have been replaced with whitespace:
<style type="text/css">
.p_384D933F { margin: 0px 0px 0px 0px;text-align: left;text-indent: 0pt;padding: 0px 0px 0px 0px; } 
.s_6BF1D20F { font-family: 'Calibri';font-style: normal;font-size: 16px;color: #000000; } 
</style><p class="p_384D933F"><span class="s_6BF1D20F">a    b    c</span></p>

After reloading and saving again it looks like this. The whitespaces have been replaced with question marks:
<style type="text/css">
.p_384D933F { margin: 0px 0px 0px 0px;text-align: left;text-indent: 0pt;padding: 0px 0px 0px 0px; } 
.s_6BF1D20F { font-family: 'Calibri';font-style: normal;font-size: 16px;color: #000000; } 
</style><p class="p_384D933F"><span class="s_6BF1D20F">a? ? b? ? c</span></p>

Here is the sample code I am using for this test: 
public Form1()
{
    InitHtmlFormatProvider();
    InitializeComponent();
}
 
private static HtmlFormatProvider _htmlFormatProvider;
 
private static void InitHtmlFormatProvider()
{
    _htmlFormatProvider = new HtmlFormatProvider();
    var htmlExportSettings = new HtmlExportSettings();
    htmlExportSettings.DocumentExportLevel = DocumentExportLevel.Fragment;
    _htmlFormatProvider.ExportSettings = htmlExportSettings;
}
 
private void commandBarButtonLoad_Click(object sender, EventArgs e)
{
    string text = File.ReadAllText(@"c:\temp\RichText.txt");
    Byte[] convertedText = Encoding.ASCII.GetBytes(text);
    RadDocument document = _htmlFormatProvider.Import(convertedText);
    radRichTextBox1.Document = document;
}
 
private void commandBarButtonSave_Click(object sender, EventArgs e)
{
    string html = _htmlFormatProvider.Export(radRichTextBox1.Document);
    File.WriteAllText(@"c:\temp\RichText.txt", html);           
}


Svett
Telerik team
 answered on 09 Jan 2013
1 answer
128 views
Hi,
I am playing around with your controls to see if it meets our needs.
Right now I cannot seems to drag and drop from external source into the scheduler in TimeLineView.
On this line :
Dim table As DayViewAppointmentsTable = (TryCast(Me.RadScheduler1.SchedulerElement.ViewElement, SchedulerDayViewElement)).DataAreaElement.Table 
the code stops and I got the error
Object Reference is not set to an instance of object
Right now I am following the drag and drop sample.
This is one aspect really important but futhermore I would like to know if it is possible to have this scenario with your control in timeline view

We got let say 3 Team which are our main ressources. In the schedule with got appointment. I want to drag and drop those appointement from external source (which seems possible). What is tricky is that I also want to drag and drop employee on the Team (ressouces line) to add them on this team (or maybe on the appointment)
Is it possible with the RadScheduler Control ?

Thanks
Ivan Todorov
Telerik team
 answered on 09 Jan 2013
2 answers
373 views
I have an issue with RadControls for WinForms Q3 2012 where calling Rows.Add with an instance of a type inheriting from GridViewRowInfo causes the value in a GridViewCheckBoxColumn to display True/False instead of a check box. The following illustrates the issue:

using Telerik.WinControls.UI;
 
namespace TestApp {
    partial class MainForm : RadForm {
        public MainForm() {
            InitializeComponent();
            ItemGrid.Rows.Add(new CustomRowInfo(ItemGrid, "Item #1", true));
            ItemGrid.Rows.Add(new CustomRowInfo(ItemGrid, "Item #2", false));
        }
 
        private class CustomRowInfo : GridViewRowInfo {
            public CustomRowInfo(RadGridView owner, string text, bool enabled)
                : base(owner.MasterView) {
                Cells[0].Value = text;
                Cells[1].Value = enabled;
            }
 
            public string Text {
                get { return Cells[0].Value.ToString(); }
                set { Cells[0].Value = value; }
            }
 
            public bool Enabled {
                get { return (bool) Cells[1].Value; }
                set { Cells[1].Value = value; }
            }
        }
    }
}


What am I doing wrong?
Thanks.
Tom
Top achievements
Rank 1
 answered on 09 Jan 2013
3 answers
95 views
If you group data with property builder, you cannot ungroup it with same procedure - you have to go to group descriptors on delete it from there.
Stefan
Telerik team
 answered on 09 Jan 2013
1 answer
342 views
I have developed a custom theme for WinForms (2012.3.1211.40) and am very happy with it.

However, I have one small requirement for a background color change (RadButton) on hover. I would hate to copy the theme (and manage 2 different themes) for this small request.

I found "ButtonElement" and "RootElement" properties on the RadButton. How do I modify values (lets say, a background color) for different states, particularly, the hover state?

Thanks in advance!
Anton
Telerik team
 answered on 09 Jan 2013
1 answer
171 views
I have a property of type string[].  If you open the String Collection Editor the items are in the correct order, but when you expand the collection in the PropertyGrid the items appear to be in a random order (instead of being displayed as 0..n).

I am using RadControls for WinForms Q2 2012 SP1.
Ivan Petrov
Telerik team
 answered on 09 Jan 2013
2 answers
341 views
on my rad wizard pages there are dynamically generated radiobuttons.
is it possible to navigate those buttons with the arrow keys and use the enter key to go to the next page?
By default the focus is on the 'Next' button when entering a page, is this changeble?

Evidor
Top achievements
Rank 1
 answered on 08 Jan 2013
1 answer
459 views
Hello Team

I have a requirement where i have radgridview which is having 5 predefined columns , i need to upload data into these fields from excel

i have used the following code to populate the columns from excel, but they are adding next to the predefined columns, i need to map the grid columns to excel columns, how can i achieve this




excel



i need to populate the above values  (with out headertext ) from excel  into the corresponding columns of grid,





from the above code i am adding auto generate columns to grid, but i want these data to be populated in the corresponding columns  any help????
Julian Benkov
Telerik team
 answered on 08 Jan 2013
1 answer
210 views
UPDATE: I solved this problem. It was caused by referencing a local Telerik dll in my project while at the same time having a different Telerik version installed. I'm assuming the Control was getting a mismatch between the local dll and one from the GAC.

I'm using an HtmlFormatProvider to store and retrieve text as HTML. I implemented the Cut, Copy, Paste controls by implementing a click handler on the toolbar button and calling the corresponding method on my private RadRichTextbox. When the Cut method is called it throws this exception:

Cannot cast the underlying exported value of type 'Telerik.WinControls.RichTextBox.FileFormats.Html.HtmlFormatProvider (ContractName="Telerik.WinControls.RichTextBox.FormatProviders.IDocumentFormatProvider")' to type 'Telerik.WinControls.RichTextBox.FormatProviders.IDocumentFormatProvider'.

Any suggestion would be much appreciated.
Svett
Telerik team
 answered on 08 Jan 2013
1 answer
164 views
Hi,

I derived some windows from the ToolWindow class and added some special controls on it (i.e. Treeview).
Now I want to add the windows to the RadDock and then only load the layout.
How can I do this?

Regards
Marco

Julian Benkov
Telerik team
 answered on 08 Jan 2013
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
PdfViewer and PdfViewerNavigator
CommandBar
ListControl
Carousel
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
VirtualGrid
Toolstrip (obsolete as of Q3 2010)
Label
AutoCompleteBox
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
SplitContainer
Documentation
Map
DesktopAlert
CheckedDropDownList
ProgressBar
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
Wizard
CollapsiblePanel
LayoutControl
ShapedForm
SyntaxEditor
TextBoxControl
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
WaitingBar
GroupBox
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
FileDialogs
ColorDialog
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
NavigationView
BindingNavigator
RibbonForm
Styling
Barcode
PopupEditor
TaskBoard
Callout
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
BreadCrumb
ButtonTextBox
FontDropDownList
BarcodeView
Overlay
Security
LocalizationProvider
Dictionary
TreeMap
StepProgressBar
SplashScreen
Flyout
Separator
SparkLine
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
SpeechToTextButton
SmartPasteButton
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?