Class EditableList
A System.Windows.Forms.UserControl that provides you an editable System.Windows.Forms.ListBox with a System.Windows.Forms.TextBox and System.Windows.Forms.Button on the current row.
Inheritance
Namespace: Syncfusion.Windows.Forms.Tools
Assembly: Syncfusion.Shared.Base.dll
Syntax
public class EditableList : UserControl, IThemeProvider, IVisualStyle
Remarks
During design-time (and in code) you can access the list box, text box and button components of this control using the System.Windows.Forms.ListBox, System.Windows.Forms.TextBox and Button properties. You can add certain items to the list and set some properties on the textbox and button.
The ButtonClick event is thrown when the user clicks the button and ItemChanging event is thrown when the user completes editing an item.
Constructors
EditableList()
Creates a new instance of the EditableList control.
Declaration
public EditableList()
Properties
AccessibilityEnabled
Gets or sets a value indicating whether the control should enable its Accessibility support.
Declaration
public bool AccessibilityEnabled { get; set; }
Property Value
Type |
---|
System.Boolean |
BaseThemeName
Gets or sets the BaseTheme name of the theme
Declaration
public string BaseThemeName { get; set; }
Property Value
Type |
---|
System.String |
BeforeTouchSize
Gets/Sets Control size before touch enabled
Declaration
public Size BeforeTouchSize { get; set; }
Property Value
Type |
---|
System.Drawing.Size |
Button
Returns the System.Windows.Forms.Button associated with this control.
Declaration
public Button Button { get; }
Property Value
Type |
---|
System.Windows.Forms.Button |
Remarks
Represents the button drawn at the right of the current row.
CanApplyTheme
Gets or sets a value indicating whether a SkinManager theme style has been applied to the control.
Declaration
public bool CanApplyTheme { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is true. |
CanOverrideStyle
Gets or sets a value indicating whether control elements styles can be overridden by theme style settings.
Declaration
public bool CanOverrideStyle { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | Default value is false. |
Remarks
By default, the control's element styles will not be overridden by theme style settings if the style is set in sample level. If this property is enabled, element style will be overridden by theme style settings event if it is set in sample level. This property should be enabled or disabled before calling the ThemeName property of the control.
Editing
Indicates whether the current row is being edited.
Declaration
public bool Editing { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True to indicate its being edited; False otherwise. |
EnableTouchMode
Gets or sets value to enable or disable the Touchmode to the controls.
Declaration
public bool EnableTouchMode { get; set; }
Property Value
Type |
---|
System.Boolean |
Remarks
Scale factor will be updated automatically if scalefactor is equal to 1
IsVisualStyleEnabled
Gets a value indicating whether the visual style based theme is applied to the control and also indicates whether the theme files are referred from external assemblies or not.
Declaration
public bool IsVisualStyleEnabled { get; }
Property Value
Type | Description |
---|---|
System.Boolean | Return true, if the visual style based theme is applied to the control. Otherwise returns false. |
ListBox
Returns the System.Windows.Forms.ListBox associated with this control.
Declaration
public ListBox ListBox { get; }
Property Value
Type |
---|
System.Windows.Forms.ListBox |
Remarks
To access the list box to add items to it.
ListBoxTextAlignment
Gets or sets the list box text alignment.
Declaration
public TextAlignment ListBoxTextAlignment { get; set; }
Property Value
Type |
---|
TextAlignment |
Office2016ColorScheme
Gets or Sets the colorschemes for the EditableList.
Declaration
public ScrollBarOffice2016ColorScheme Office2016ColorScheme { get; set; }
Property Value
Type |
---|
ScrollBarOffice2016ColorScheme |
ScrollMetroColorTable
Declaration
public MetroColorTable ScrollMetroColorTable { get; set; }
Property Value
Type |
---|
MetroColorTable |
Style
Represents the property to set the Style.
Declaration
public Appearance Style { get; set; }
Property Value
Type |
---|
Appearance |
TextBox
Returns the System.Windows.Forms.TextBox associated with this control.
Declaration
public TextBoxExt TextBox { get; }
Property Value
Type |
---|
TextBoxExt |
Remarks
Represents the textbox used in the editable current row.
ThemeName
Gets or sets the theme name of the EditableList control.
Declaration
public string ThemeName { get; set; }
Property Value
Type |
---|
System.String |
ThemeStyle
Gets or sets the EditableListVisualStyle value used to customize the appearance of the EditableList.
Declaration
public EditableListVisualStyle ThemeStyle { get; set; }
Property Value
Type |
---|
EditableListVisualStyle |
Remarks
This ThemeStyle settings will be applied only when the VisualStyleBased theme has been applied to the control.
WantButton
Indicates whether you want the button to be shown to the right while editing.
Declaration
public bool WantButton { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True if button should be shown; False otherwise. Default is True. |
Methods
ApplyScaleToControl(Single)
Scale the control based on the scale factor passed in the argument.
Declaration
public void ApplyScaleToControl(float scaleFactor)
Parameters
Type | Name | Description |
---|---|---|
System.Single | scaleFactor | value to scale the factor based upon. |
CreateAccessibilityInstance()
Declaration
protected override AccessibleObject CreateAccessibilityInstance()
Returns
Type |
---|
System.Windows.Forms.AccessibleObject |
Dispose(Boolean)
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
EndEditing(Boolean)
Called just after a row comes out of editing mode.
Declaration
protected virtual void EndEditing(bool save)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | save |
GetActiveThemeName()
Gets the active theme name of the CheckBoxAdv control.
Declaration
public string GetActiveThemeName()
Returns
Type | Description |
---|---|
System.String | Returns the active theme name. |
OnBeforeListItemEdit(CancelEventArgs)
Raises the BeforeListItemEdit event.
Declaration
protected virtual bool OnBeforeListItemEdit(CancelEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.ComponentModel.CancelEventArgs | e | An System.EventArgs that contains the event data. |
Returns
Type |
---|
System.Boolean |
Remarks
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The OnBeforeListItemEdit method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Note to Inheritors: When overriding OnBeforeListItemEdit in a derived class, be sure to call the base class's OnBeforeListItemEdit method so that registered delegates receive the event.
OnButtonClick(EventArgs)
Raises the ButtonClick event.
Declaration
protected virtual void OnButtonClick(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | An EventArgs that contains the event data. |
Remarks
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The OnButtonClick method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Note to Inheritors: When overriding OnButtonClick in a derived class, be sure to call the base class's OnButtonClick method so that registered delegates receive the event.
OnFontChanged(EventArgs)
Declaration
protected override void OnFontChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnItemChanging(ListBoxTextChangingEventArgs)
Raises the ItemChanging event.
Declaration
protected virtual void OnItemChanging(ListBoxTextChangingEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
ListBoxTextChangingEventArgs | e | A ListBoxTextChangingEventArgs that contains the event data. |
Remarks
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The OnItemChanging method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Note to Inheritors: When overriding OnItemChanging in a derived class, be sure to call the base class's OnItemChanging method so that registered delegates receive the event.
OnListItemDraw(ListItemDrawEventArgs)
Declaration
protected virtual void OnListItemDraw(ListItemDrawEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
ListItemDrawEventArgs | e |
OnParentChanged(EventArgs)
Declaration
protected override void OnParentChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnSizeChanged(EventArgs)
Declaration
protected override void OnSizeChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
ProcessCmdKey(ref Message, Keys)
Declaration
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.Message | msg | |
System.Windows.Forms.Keys | keyData |
Returns
Type |
---|
System.Boolean |
RaiseBeforeListItemEdit()
Declaration
protected bool RaiseBeforeListItemEdit()
Returns
Type |
---|
System.Boolean |
ResetTextAlignment()
Resets the TextAlignment property to the default value.
Declaration
public void ResetTextAlignment()
ShouldSerializeListBoxTextAlignment()
Indicates, whether ListBoxTextAlignment property value should be serialized.
Declaration
public bool ShouldSerializeListBoxTextAlignment()
Returns
Type |
---|
System.Boolean |
StartEditing()
Called just before a row goes into editing mode.
Declaration
protected virtual void StartEditing()
Events
BeforeListItemEdit
Raised before a list item is edited.
Declaration
public event CancelEventHandler BeforeListItemEdit
Event Type
Type |
---|
System.ComponentModel.CancelEventHandler |
ButtonClick
Fired when the user clicks on the button.
Declaration
public event EventHandler ButtonClick
Event Type
Type |
---|
System.EventHandler |
ItemChanging
Fired when the user completes editing a row.
Declaration
public event ListBoxTextChangingEventHandler ItemChanging
Event Type
Type |
---|
ListBoxTextChangingEventHandler |
ListItemDraw
Raised when a list item is to be drawn.
Declaration
public event ListItemDrawEventHandler ListItemDraw
Event Type
Type |
---|
ListItemDrawEventHandler |
ThemeNameChanged
Occurs when theme name of the EditableList has changed.
Declaration
public event ThemeChangedEventHandler ThemeNameChanged
Event Type
Type |
---|
ThemeChangedEventHandler |
Explicit Interface Implementations
IVisualStyle.VisualTheme
Declaration
string IVisualStyle.VisualTheme { get; set; }
Returns
Type |
---|
System.String |
IThemeProvider.ControlName
Gets the name of the control.
Declaration
string IThemeProvider.ControlName { get; }
Returns
Type |
---|
System.String |