Telerik Forums
UI for WinForms Forum
1 answer
163 views

Hi -

I want to create a custom editor that has just a textbox and a button.  The button will launch a form that allows me to select an object of type Product.  When I click OK on the form, I want to display the Name property of the object (in the text box in the grid, as read only), but I want the VALUE to be a different property, in this case ID.

My object looks like:

class Product

{

   string Name;

   Guid ID;

}

How can this be achieved?

 

Thanks in advance!

Dimitar
Telerik team
 answered on 20 Aug 2019
2 answers
184 views

Hi,

I've managed to work out most property types but I'm struggling how to have a property in Time format.

I.e. is there a time editor like RadTimePicker within the propertygrid to enter a specified time?

Thanks.

Matt
Top achievements
Rank 2
 answered on 16 Jul 2019
5 answers
151 views
I need an PropertyGridDropDownListEditor with icons.
How can I do that?
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 31 May 2019
4 answers
230 views
Is there a way to get and set the splitter position?
Steve
Top achievements
Rank 1
 answered on 09 May 2019
1 answer
94 views

we have the following property:

private Size _picSize = new Size(1272, 787);

public Size PicSize
{
     get => _picSize;
     set => value;

}

if in the radpropertygrid for this property to remove the height and semicolon, press <enter>, an error occurs:

System.ArgumentException: Не удается разобрать текст "1000". Ожидаемый формат текста: "Width,Height".
в System.Drawing.SizeConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
в Telerik.WinControls.UI.PropertyGridItem.ConvertValue(Object value, Object& convertedValue)
в Telerik.WinControls.UI.PropertyGridItem.set_Value(Object value)
в Telerik.WinControls.UI.PropertyGridTableElement.EndEditCore(Boolean commitChanges)
в Telerik.WinControls.UI.PropertyGridTextBoxEditor.OnLostFocus()

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 22 Mar 2019
4 answers
1.0K+ views

Hello,

I'm trying to show and hide groups and single items of a PropertyGrid depending on the answers inside the same propertyGrid.

I've seen that a good place to set the visibility of the group is in when the grid is created, in this function:

private void RadPropertyGridOnCreateItemElement(object sender, CreatePropertyGridItemElementEventArgs e)
        {
            if (e.Item is PropertyGridGroupItem groupItem)
            {
                var myItem = (MyItem)groupItem.Group.GroupItem.GridItems[0].Value;
                   groupItem.Visible = myItem.EnableGroup;
            }
            if (e.Item is PropertyGridItem item)
            {
                var myItem = (MyItem)item.Value;
                item.Visible = myItem.EnableItem;
            }
        }

 

However, I'm not able to change the visibility at a second time, since this function is not called again later.

If I try to change the visibility of the VisualItem in OnItemFormatting, the items are hidden, but the spaces are not recalculated and the design is messed up.

Also, if I try to change the visibility of an item at the end of OnEdited, OnItemFormatting goes on loop.

 

Any hint? :)

Thanks!

Hristo
Telerik team
 answered on 20 Feb 2019
3 answers
143 views

I have the following

class LookupItem

{

     public Guid Id {get;set;}

     public string Description {get;set;}

}

class SomeOtherClass

{

  public int Key {get;set;}

  public Guid LookupItemId {get;set;}

  public string SomeProperty {get;set;}

}

 

Now.

The LookupItem class will be a part of a collection (or lookup list) e.g. List<LookupItem>

The SomeOtherClass is the selectedObject of the propertygrid

I have looked through the samples such as https://docs.telerik.com/devtools/winforms/knowledge-base/propertygrid-dropdown-editor

and whilst I can get the combobox or RadMultiColumnComboBox to display when editing, I need to be able to show the description value of the selected lookupitem in the propertygrid item. Currently its displaying the LookupItem.Id which is a Guid.

 

Any ideas? The simplest will suffice

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 01 Feb 2019
1 answer
93 views

if you completely delete the contents in the editor and press the <Enter> key, then int.MinValue is returned.

Why? In this case, you must return either null or 0 or do nothing.

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 31 Oct 2018
5 answers
197 views

I override the BaseInputEditor with a trackbar editor (using code from Telerik website).

But when I change the position of the trackbar, the PropertyValueChanged event does not occur (radPropertyGrid)

What am I doing wrong?

Dimitar
Telerik team
 answered on 04 Oct 2018
0 answers
63 views

Hi,

 

I need a PropertyGridSpinEditor with a small difference, it must always show 2 digit. Example: "00", "03", "14"..

You can see in the image, i have achieved only when the edition has ended with this code.

Private Sub PropertyGridParams_ItemFormatting(sender As Object, e As UI.PropertyGridItemFormattingEventArgs) Handles PropertyGridParams.ItemFormatting
       
     If (e.Item.Name = NameOf(PROPNAME)) Then
         DirectCast(e.VisualElement, PropertyGridItemElement).ValueElement.Text = PROP.ToString("00")
      End If
End Sub

 

I try it, but doesnt work.

Public Class NumericUpDownEditor
    Inherits PropertyGridSpinEditor
 
 
    Public Overrides Sub OnValueChanged()
 
        If (Me.Value.ToString.Length < 2 AndAlso IsNumeric(Me.Value)) Then
 
            Me.Value = Integer.Parse(Me.Value.ToString()).ToString("00")
        Else
            MyBase.OnValueChanged()
        End If
 
    End Sub
 
 
End Class

 

Is there any way to achieve that?

 

Thank you!

MaiK
Top achievements
Rank 1
Iron
 asked on 17 Sep 2018
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
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
+128 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?