Telerik Forums
UI for WinForms Forum
9 answers
1.0K+ views
Hi All,

I have a strange issue which I'm hoping someone knows how to fix...

I have a winforms custom control that uses the RadScheduler and RadCalender controls. I originally had a couple of the Office 2010 themes added to the project and these have been removed as the built in colors work just fine. As far as I can see I have removed all references to these themes.
My project copies the Telerik DLLs locally as the clients will not have the Telerik controls instaleld on them.

However, I have built my control in release mode in VS 2010 and copied all the files to a test client machine, and when my control comes to load, I get the following error, and the the application closes:

"The type initializer for 'Telerik.Controls.ThemeResolutionService' threw an exception"

I am doing a tiny bit of custom coloring on the calendar control, but nothing involving styles or themes. Only when I reset the control do I do anything that might call this. This section of code is shown below...

Can anyone tell me how I get around this, or have any suggestions as to what I could do to try to fix it? I've already searched for why this could be happening, but can't seem to find anything I haven't already tried.
private void Calendar_ElementRender(object sender, RenderElementEventArgs e)
{
    if (Calendar.SpecialDays.Contains(e.Day, new MyComparer()))
    {
        e.Element.NumberOfColors = 1;
        e.Element.BackColor = Color.Orange;
        e.Element.BorderColor = Color.DarkBlue;
    }
    else
    {
        e.Element.ResetValue(LightVisualElement.NumberOfColorsProperty, ValueResetFlags.Local);
        e.Element.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local);
        e.Element.ResetValue(LightVisualElement.BorderColorProperty, ValueResetFlags.Local);
    }
}

Thanks,
Karl

Stefan
Telerik team
 answered on 07 Dec 2012
5 answers
95 views
Hi all,
When I use a comboboxColumn, it opens when I hit the F4. The DateTimeColumn doesn't, but I think it should follow the same behavior as a regular combo. This is hard to explain to a user...

Regards,
Martin
Plamen
Telerik team
 answered on 07 Dec 2012
3 answers
156 views
I'm sure I'm missing something simple here, but how do I control the shape and color of the scrollbars in the RadScrollablePanel? I cannot seem to access the scroll bars to style them the way I would like. The example in the top left corner of this page is exactly what I am looking for:

http://www.telerik.com/help/winforms/panels-and-labels-radscrollablepanel-overview.html

Thanks,

G
Anton
Telerik team
 answered on 07 Dec 2012
2 answers
118 views
For a particular textbox cell I'd like to catch the F4 key to open a popup window with a selection list. This, in itself, works fine. But I need the contents of the cell. So I get the cell value like this:
            Dim ThisRow As GridViewRowInfo = grdPositionen.MasterView.CurrentRow
            Dim Filter As String = ""
            If ThisRow.Cells(1).Value IsNot Nothing Then
                Filter = ThisRow.Cells(1).Value.ToString.Trim
                ....
But for some strange reason I don't get the actual contents of the cell, but the original contents instead. In other words; when the user just typed something else there, it's not in the Value property. How do I get the actual contents of the cell?

Martin
Top achievements
Rank 1
 answered on 07 Dec 2012
6 answers
186 views
I used code from example and got error when trying to add a new appointment.

Thank for you help...

Unable to cast object of type 'System.Guid' to type 'System.IConvertible'.Couldn't store <5303d57e-81d4-4399-9b50-cbade2462a09> in ID Column.  Expected type is Int32.
Ivan Todorov
Telerik team
 answered on 07 Dec 2012
6 answers
513 views
I want to do something similar (I think) to this:
http://www.telerik.com/help/winforms/listview-custom-items.html 

What I want to do is this: I have a RadListView control with 4 columns in a ViewType of DetailsView. The first 3 columns will just display some text in each cell/row, but the 4th cell in each row I want to have a "Remove" button to remove it from the list. So what I need to be able to do is:

Create a Button element to serve as the value for the 4th cell in each row

and

Be able to define and handle the click event for that button (will need some way to identify the row that the button was clicked for as well)

The code I have right now (created based on the example) just displays the button in the first column and none of the text for the first 3 columns seems to get created/inserted.

public class ListViewItemButton : SimpleListViewVisualItem
    {
        private RadButtonElement buttonElement;
        private LightVisualElement contentElement;
        private StackLayoutPanel stackLayout;
 
        protected override void CreateChildElements()
        {
            base.CreateChildElements();
 
            this.stackLayout = new StackLayoutPanel();
            this.stackLayout.Orientation = Orientation.Horizontal;
            this.stackLayout.EqualChildrenWidth = true;
 
            this.contentElement = new LightVisualElement();
            this.contentElement.StretchHorizontally = true;
            this.contentElement.MinSize = new Size(60, 0);
 
            this.stackLayout.Children.Add(this.contentElement);
 
            this.buttonElement = new RadButtonElement();
            this.buttonElement.Text = "Remove ";
            this.stackLayout.Children.Add(this.buttonElement);
 
            this.Children.Add(this.stackLayout);
 
        }
 
        protected override void SynchronizeProperties()
        {
            base.SynchronizeProperties();
 
            this.Text = "";
            this.buttonElement.Text = "Remove ";
        }
 
        protected override Type ThemeEffectiveType
        {
            get
            {
                return typeof(SimpleListViewVisualItem);
            }
        }
    }
}

and my handler...

private void HandleRadListViewVisualItemCreating(object sender, ListViewVisualItemCreatingEventArgs e)
        {
                    e.VisualItem = new ListViewItemButton();
        }

I don't know how to tell it to only make the VisualItem be the button for the 4th column, not all of them.

Thanks,
--Jason
Ivan Todorov
Telerik team
 answered on 07 Dec 2012
2 answers
94 views
Hi 
i update code from to Q2 2011 in old version when i use RadGrirdView and i type in Filter Text 
to get me certain rows as in my attachment ,when use the following code it not get me the result row 

DataRowView m_dgrvCurrent;
 
m_dgrvCurrent = (DataRowView) (radGridViewCountries.DataSource as BindingSource).Current;

Please tell me how i can get the Filter rows not seletedrow 
this code run before fine but here get me a first row in all data not viewed on Grid 

Thank you 
Mahmoud Salem
Plamen
Telerik team
 answered on 07 Dec 2012
2 answers
211 views
Hello,

how can I change the background color of a radRichTextBox? I tried to change the BackColor in the Properties section but this didn't affect the result. In Addition I tried to implement it to the code like this: 

this.RichTextBox1.RichTextBoxElement.BackColor = System.Drawing.Color.Gray;
Markus
Top achievements
Rank 1
 answered on 07 Dec 2012
1 answer
105 views
Hello can we expect a new version of visual style builder for winforms? if so what would be the ETA?

Thank you
Stefan
Telerik team
 answered on 06 Dec 2012
3 answers
131 views
Hello,

I try to create a relation between the MasterTemplate and a ChildTemplate.

The DataSources for the templates have to be filled manually, due they come from different sources (REST and .Net-Remoting).

After fill in the data, I create a relation between them

var relation = new GridViewRelation(_StockGridView.MasterTemplate);
relation.ChildTemplate = _PartsTemplate;
relation.RelationName = "PartToArticleCode";
relation.ParentColumnNames.Add("ID");
relation.ChildColumnNames.Add("ArticleCodeID");
this._StockGridView.Relations.Add(relation);

Unfortunatly... this does not work (anymore!). It worked the first time I created the form etc., but after I've added a control to a container to the form (not to the grid), the gridview refuses to show the hierarchy anymore.

Maybe someone got a clue... I haven't :(

Regards,
Steffen
Plamen
Telerik team
 answered on 06 Dec 2012
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
Documentation
SplitContainer
Map
DesktopAlert
CheckedDropDownList
ProgressBar
TrackBar
MessageBox
Rotator
SpinEditor
CheckedListBox
StatusStrip
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
CollapsiblePanel
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
Styling
Barcode
PopupEditor
RibbonForm
TaskBoard
Callout
NavigationView
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
BreadCrumb
ButtonTextBox
FontDropDownList
BarcodeView
Security
LocalizationProvider
Dictionary
SplashScreen
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?