Telerik Forums
UI for WinForms Forum
2 answers
156 views
I'm extending a rad element for custom behavior (specifically, I'm making a multi-select drop down where the textbox acts as a search input).  I'm trying to add a custom property, IsHighlighted to RadListBoxItem.  I have a custom XML style sheet for my control which is being loaded and works, except that it doesn't highlight as expected.

Here are the modifications I've made:
  • I've created a MultiSelectComboBoxElement that extends RadComboBoxElement.  I define a public static RadProperty IsHighlightedProperty in this class.  It's static constructor registers my theme (XML) from storage (this was based on the default combobox theme) and registers the property as follows: 
IsHighlightedProperty = RadProperty.Register("IsHighlighted"typeof(bool), typeof(RadListBoxItem), new RadElementPropertyMetadata(false, ElementPropertyOptions.AffectsDisplay)); 
  Notice, I'm trying to add the rad property to RadListBoxItem in the MultiSelectComboBoxElement static constructor.

  • My theme (XML) defines some visual settings for RadListBoxItems with selector condtions that use my new property.  Here's one example:
<XmlPropertySettingGroup> 
  <PropertySettings> 
    <XmlPropertySetting Property="Telerik.WinControls.Primitives.FillPrimitive.GradientStyle" Value="Linear" /> 
    <XmlPropertySetting Property="Telerik.WinControls.Primitives.FillPrimitive.NumberOfColors" Value="4" /> 
    <XmlPropertySetting Property="Telerik.WinControls.Primitives.FillPrimitive.GradientAngle" Value="90" /> 
    <XmlPropertySetting Property="Telerik.WinControls.Primitives.FillPrimitive.GradientPercentage" Value="0.5015975" /> 
    <XmlPropertySetting Property="Telerik.WinControls.Primitives.FillPrimitive.GradientPercentage2" Value="0.5623003" /> 
    <XmlPropertySetting Property="Telerik.WinControls.RadElement.Visibility" Value="Visible" /> 
    <XmlAnimatedPropertySetting EndValue="White" Property="Telerik.WinControls.VisualElement.BackColor" Value="" />
    <XmlAnimatedPropertySetting EndValue="255, 235, 173" Property="Telerik.WinControls.Primitives.FillPrimitive.BackColor2" Value="" />
    <XmlAnimatedPropertySetting EndValue="255, 215, 106" Property="Telerik.WinControls.Primitives.FillPrimitive.BackColor3" Value="" /> 
              <XmlAnimatedPropertySetting EndValue="255, 213, 156" Property="Telerik.WinControls.Primitives.FillPrimitive.BackColor4" Value="" /> 
  </PropertySettings> 
  <Selectors> 
    <XmlClassSelector ElementClass="ListBoxItemSelectionFill" AutoUnapply="False"
      <Condition xsi:type="XmlSimpleCondition" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        <Setting Property="Telerik.WinControls.UI.RadListBoxItem.IsHighlighted" Value="True" /> 
      </Condition> 
    </XmlClassSelector> 
  </Selectors> 
 </XmlPropertySettingGroup> 

I set the IsHighlighted value in code using item.SetValue(IsHighlightedProperty, true). This seems to work because subsequent calls to item.GetValue(IsHighlightedProperty) return true. I know telerik is using my theme as I see other visual changes and it does not throw any exceptions about not being able to find the IsHighlighted property, but the control style never changes at runtime (the item's background doesn't change).  Any help would be greatly appreciated.
Nick
Telerik team
 answered on 03 Apr 2009
1 answer
238 views
Can a RadTextBoxElement be data bound?

The following code successfully binds a RadTextBox to a data field:

        class MyObject 
        { 
            public double Number { getset; } 
            public string Title { getset; } 
        } 
 
        public Form1() 
        { 
            MyObject myObject = new MyObject() { Number = 5, Title = "Hello" }; 
            RadTextBox textBox = new RadTextBox(); 
            textBox.DataBindings.Add(new Binding("Text", myObject, "Title")); 
            Controls.Add(textBox); 
        } 

However, the following code fails to bind a RadTextBoxElement to the same data field:

        class MyObject 
        { 
            public double Number { getset; } 
            public string Title { getset; } 
        } 
 
        public Form1() 
        { 
            MyObject myObject = new MyObject() { Number = 5, Title = "Hello" }; 
            RadTextBoxElement textBox = new RadTextBoxElement() { MinSize = new Size(200, 0) }; 
            textBox.DataBindings.Add(new Binding("Text", myObject, "Title")); 
 
            RadPanel elementsContainer = new RadPanel(); 
            elementsContainer.PanelElement.Children.Add(textBox); 
            Controls.Add(elementsContainer); 
        } 

Is databinding supported on a RadTextBoxElement?  If so, am I doing it wrong?

Thanks,
Michael Hewitt
Precision Software Design, LLC
Victor
Telerik team
 answered on 03 Apr 2009
1 answer
328 views
Hello -

I'm trying to cause a RadTextBoxElement to automatically size to its text, similar to the way a TextPrimitive automatically sizes to its text.  Here is the code snippet:

        public Form1() 
        { 
            StackLayoutPanel panel = new StackLayoutPanel(); 
            panel.Orientation = Orientation.Horizontal; 
            panel.AutoSize = true
            panel.Children.Add(new TextPrimitive() { Text = "Color:" }); 
            panel.Children.Add(new RadTextBoxElement() { Text = "Purple" }); 
            RadPanel elementsContainer = new RadPanel(); 
            elementsContainer.ThemeName = "Desert"
            elementsContainer.PanelElement.Children.Add(panel); 
            Controls.Add(elementsContainer); 
        } 
 
 

The TextPrimitive properly sizes to its text ("Color:"), but the RadTextBoxElement fails to size to its text ("Purple").  If I set AutoSize = true on the RadTextBoxElement, nothing changes.  If I also set the AutoSizeMode to WrapAroundChildren, still no change.  Can you advise me on how to make this work?

Thanks,
Michael Hewitt
Precision Software Design, LLC
Mike
Telerik team
 answered on 03 Apr 2009
1 answer
160 views
I have a simple form with three docked windows. The first is on the bottom, taking half the screen, then two equal size panels on the top. When I hide the left top panel, then the right top panel, then unhide them (in either order), the left top panel is only about 25 pixels wide (probably your default minsize), and the right panel takes up the rest of the top half of the screen. Shouldn't unhide restore the panel to it's original size? I don't want to set the minsize to half the screen because my users might want to make it smaller. I have tried responding to the resize event, but then the contents of the DockPanels get unsysnced with the DockPanel size, although they are set up to fill the DockPanels. I've tried setting PreferredDockSize in the form load, that does not seem to help.
Julian Benkov
Telerik team
 answered on 03 Apr 2009
0 answers
141 views
Hello all,

I have recently raised a support issue and telerik is saying that I am the only one that has ever experienced this problem.  While I admit that my case is a little rare, I find it impossible to believe that I am the only one.  So...

I have a telerik grid and it is very small in height (157).  This grid also contains a child grid for associated information.  The problem is that the grid will not scroll down far enough to show all the data from the rows.  This is especially true if you expand a row to show the child data or if you show the grouping panel.

So I ask, am I truly the only person out there who has seen this problem?  If not, then how did others work around this?
lkeel
Top achievements
Rank 1
 asked on 03 Apr 2009
1 answer
274 views
Hi,
How can i  make collapsible splitter in windows application.I need the control should be collapsible.Please help me in this case.And send me the sample project for working collapsible splitter in windows applications.

Thanks in advance,
Santhose Kumar.
Mike
Telerik team
 answered on 03 Apr 2009
0 answers
86 views

 Please ignore this post , I had it answered in another post.

Kenneth Jackson
Top achievements
Rank 1
 asked on 03 Apr 2009
2 answers
132 views
Hey guys,

I'm trying to acheive the following Grid View Definition:

        +--------------+--------------+--------------+-----   
        |              |    Height    |     Width    |    Etc...   
header: + Product Name +-------+------+-------+------+------   
        |              | Value | Unit | Value | Unit |   
        +--------------+-------+------+-------+------+--------    
  row:  | Monitor      |  30   |  cm  |  1.2  |   m  |    
        +--------------+-------+------+-------+------+--------   
 
 

Width and Height are easy enough using ColumnGroupsViewDefinition. However, I can't for the life of me get the Product Name column to sit as described above. The best I can do is something like the definition below:

        +--------------+--------------+--------------+-----   
        |              |    Height    |     Width    |    Etc...   
header: +--------------+-------+------+-------+------+------   
        | Product Name | Value | Unit | Value | Unit |   
        +--------------+-------+------+-------+------+--------    
  row:  | Monitor      |  30   |  cm  |  1.2  |   m  |    
        +--------------+-------+------+-------+------+--------   
 
 

... Which is a slightly different kettle of fish. I'm hoping I've missed something obvious.
Cameron Hart
Top achievements
Rank 1
 answered on 02 Apr 2009
1 answer
152 views
Is it possible to double click on a node in the tree view without expanding it? I would only like it to be expanded when I click on the + sign.

Regars, Jill-Connie Lorentsen
Victor
Telerik team
 answered on 02 Apr 2009
5 answers
1.5K+ views
Hello -

It is my understanding that Windows has a hard limit of 32767 pixels with respect to the size of a control.  WPF gets around this by not using Windows controls, but the Telerik WinForms controls are all based on System.Windows.Control.  Please correct me if I'm wrong, but I believe this means that none of the Telerik WinForms controls can exceed this maximum size.  Thus, even though Telerik has a very elaborate architecture that immitates WPF on WinForms, if I use that archecture to deeply nest a significant number of controls, grids, etc inside layers of panels, I will eventually hit that hard limit in Windows, correct?  Is there a way around this limit using Telerik WinForms?  I realize that I can get around it by using WPF, but that has a whole different set of problems that I'm trying to avoid.  It would be ideal if we could use Telerik WinForms controls to do the job.  I also realize that the nested tables in Telerik's RadGridView gets around this problem by nesting scrollbars, but the nature of my information won't lend itself to nested scrollbars.

What I desire is a single smooth scrolling pane with a deep hierarchy of nested panels and controls like WPF, but the volume of information that I intend to put into that pane will easily exceed the maximum control height of 32767 (imagine a long Word Document with one scrollbar composed of nested panels/controls/grids/etc).  Is there a recommended solution on Telerik WinForms?

Thanks,
Michael Hewitt
Precision Software Design, LLC
Mike
Telerik team
 answered on 02 Apr 2009
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
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
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?