Sometimes, it is necessary to extend our built-in Actions to be able to use a custom control for a specific task. For example, add two DateTime
editors to accept a data range instead of creating two separate ParametrizedActions
.
Implementation Details
Inherit the ProcessActionContainerHolderController and override the OnCreateCustomMenuActionItem
method and return a custom TemplatedMenuActionItem
, that defines the Action's control. See the MyProcessActionContainerHolderController.xx class code for additional details.
Files to Review
- MyProcessActionContainerHolderController.cs (VB: MyProcessActionContainerHolderController.vb)
- ParametrizedRangeActionMenuActionItem.cs (VB: ParametrizedRangeActionMenuActionItem.vb)
More Examples
- How to create a custom action type with a custom control (BarCheckItem), associated with it (WinForms)
- XAF Blazor - Implement a custom Action type (ASP.NET Core Blazor Server)
Does this example address your development requirements/objectives?
(you will be redirected to DevExpress.com to submit your response)
Example Code
Solution28.Module.Web/Controllers/MyProcessActionContainerHolderController.cs(vb)
C#using System;
using System.Collections.Generic;
using System.Linq;
using DevExpress.ExpressApp.Actions;
using DevExpress.ExpressApp.Web.SystemModule;
using DevExpress.ExpressApp.Web.Templates.ActionContainers;
using DevExpress.ExpressApp.Web.Templates.ActionContainers.Menu;
namespace Solution28.Module.Web.Controllers {
public class MyProcessActionContainerHolderController : ProcessActionContainerHolderController {
protected override MenuActionItemBase OnCreateCustomMenuActionItem(ActionBase action) {
if(action.Id == "FilterRange") {
return new ParametrizedRangeActionMenuActionItem((ParametrizedAction)action);
}
return null;
}
}
}
Visual BasicImports System
Imports System.Collections.Generic
Imports System.Linq
Imports DevExpress.ExpressApp.Actions
Imports DevExpress.ExpressApp.Web.SystemModule
Imports DevExpress.ExpressApp.Web.Templates.ActionContainers
Imports DevExpress.ExpressApp.Web.Templates.ActionContainers.Menu
Namespace Solution28.Module.Web.Controllers
Public Class MyProcessActionContainerHolderController
Inherits ProcessActionContainerHolderController
Protected Overrides Function OnCreateCustomMenuActionItem(ByVal action As ActionBase) As MenuActionItemBase
If action.Id = "FilterRange" Then
Return New ParametrizedRangeActionMenuActionItem(CType(action, ParametrizedAction))
End If
Return Nothing
End Function
End Class
End Namespace
Solution28.Module.Web/ParametrizedRangeActionMenuActionItem.cs(vb)
C#using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.UI;
using System.Web.UI.WebControls;
using DevExpress.Web;
using DevExpress.ExpressApp.Web;
using DevExpress.ExpressApp.Actions;
using DevExpress.ExpressApp.Utils;
using DevExpress.ExpressApp.Web.SystemModule;
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Web.Templates.ActionContainers.Menu;
using DevExpress.ExpressApp.Model;
using DevExpress.ExpressApp.Web.Templates;
using Solution28.Module.Web;
using DevExpress.ExpressApp.Templates;
namespace Solution28.Module.Web {
public struct Range<T> {
public T From;
public T To;
public override bool Equals(object obj) {
if (obj is Range<T>) {
return Equals(((Range<T>)obj).From, From) && Equals(((Range<T>)obj).To, To);
}
return false;
}
public override int GetHashCode() {
return From.GetHashCode() ^ To.GetHashCode();
}
}
}
namespace DevExpress.ExpressApp.Web.Templates.ActionContainers {
public class ParametrizedRangeActionMenuActionItem : TemplatedMenuActionItem {
private ActionContainerOrientation _orientation;
private bool isExecuted = false;
private int executionLockCount;
private string clientClickHandler;
private void UpdateEditorValue() {
executionLockCount++;
try {
if (Control != null) {
Control.Value = ((ParametrizedAction)Action).Value;
}
} finally {
executionLockCount--;
}
}
private void action_CurrentValueChanged(object sender, EventArgs e) {
UpdateEditorValue();
}
private void ExecuteWithCurrentValue() {
if (executionLockCount == 0 && !isExecuted) {
isExecuted = true;
((ParametrizedAction)Action).DoExecute(Control.Value);
}
}
protected override void SetImage(ImageInfo imageInfo) {
if (Control != null) {
Control.SetImage(imageInfo, Action.ShortCaption);
}
}
protected override void SetCaption(string caption) {
if (Control != null) {
Control.Caption = caption;
if (Control.Button.Image.IsEmpty) {
Control.Button.Text = Action.ShortCaption;
}
Control.SetNullValuePrompt(Action.NullValuePrompt);
}
}
protected override void SetPaintStyle(ActionItemPaintStyle paintStyle) {
base.SetPaintStyle(paintStyle);
if (Control != null) {
Control.CaptionVisible = !Equals(paintStyle, ActionItemPaintStyle.Image);
}
}
protected override void SetEnabled(bool enabled) {
if (Control != null) {
Control.ClientEnabled = enabled;
}
}
protected override void SetToolTip(string toolTip) {
if (Control != null) {
Control.ToolTip = toolTip;
}
}
protected override void SetConfirmationMessage(string message) { }
protected override Control CreateControlCore() {
isExecuted = false;
ParametrizedActionDateRangeControl result = new ParametrizedActionDateRangeControl(Orientation);
result.ID = WebIdHelper.GetCorrectedActionId(Action);
result.Value = ((ParametrizedAction)Action).Value;
result.SetNullValuePrompt(Action.NullValuePrompt);
result.Button.AutoPostBack = false;
result.Button.ClientSideEvents.Click = clientClickHandler;
return result;
}
public ParametrizedRangeActionMenuActionItem(ParametrizedAction action)
: base(action) {
action.ValueChanged += action_CurrentValueChanged;
}
public override void Dispose() {
if (Action != null) {
Action.ValueChanged -= action_CurrentValueChanged;
}
base.Dispose();
}
public override void ProcessAction() {
ExecuteWithCurrentValue();
}
public override void SetClientClickHandler(XafCallbackManager callbackManager, string controlID) {
string clientScript = callbackManager.GetScript(controlID, string.Format("'{0}'", MenuItem.IndexPath), Action.GetFormattedConfirmationMessage(), IsPostBackRequired);
clientClickHandler = string.Format("function(s, e) {{ {0}e.processOnServer = false;}}", clientScript);
if (Control != null) {
Control.Button.ClientSideEvents.Click = clientClickHandler;
}
}
public new ParametrizedActionDateRangeControl Control {
get { return (ParametrizedActionDateRangeControl)base.Control; }
}
public new ParametrizedAction Action {
get { return (ParametrizedAction)base.Action; }
}
public ActionContainerOrientation Orientation {
get { return _orientation; }
set { _orientation = value; }
}
public override string GetClientUpdateScript(string clientItemInnerState, string menuItemName, string indexPath, XafCallbackManager callbackManager, string actionContainerUniqueID) {
return "";
}
public override string InnerState {
get { return ""; }
}
}
public class ParametrizedActionDateRangeControl : WebControl, INamingContainer, IDisposableExt {
private ASPxDateEdit calendarFrom;
private ASPxDateEdit calendarTo;
private ASPxButton _button;
private ASPxLabel label;
private TableCell labelCell;
private bool isPrerendered;
private Boolean _isDisposed;
private bool _clientEnabled = true;
private void button_Click(object sender, EventArgs e) {
OnClick();
}
private void UpdateEnabled() {
if (Button != null) {
Button.ClientEnabled = ClientEnabled;
}
if (calendarFrom != null) {
calendarFrom.ClientEnabled = ClientEnabled;
}
if (calendarTo != null) {
calendarTo.ClientEnabled = ClientEnabled;
}
}
protected string GetForceButtonClickScript() {
return string.Format("function(s, e) {{ {0}(e, '{1}'); }}", RenderHelper.GetForceButtonClickFunctionName(), _button.ClientID);
}
protected virtual string GetClientControlClassName() {
return "ParametrizedActionClientControl";
}
protected override void OnPreRender(EventArgs e) {
isPrerendered = true;
base.OnPreRender(e);
}
protected override void Render(HtmlTextWriter writer) {
if (!isPrerendered) {
OnPreRender(EventArgs.Empty);
}
base.Render(writer);
DevExpress.Web.Internal.RenderUtils.WriteScriptHtml(writer, string.Format(@"window.{0} = new {1}('{2}');", ClientID, GetClientControlClassName(), ClientID));
}
protected virtual void OnClick() {
if (Click != null) {
Click(this, new EventArgs());
}
}
public void SetConfirmationMessage(string message) {
ConfirmationsHelper.SetConfirmationScript(Button, message);
}
public void SetImage(ImageInfo imageInfo, string buttonText) {
if (!imageInfo.IsEmpty) {
ASPxImageHelper.SetImageProperties(Button.Image, imageInfo);
Button.Text = "";
CssClass = "ParametrizedActionWithImage";
}
else {
ASPxImageHelper.ClearImageProperties(Button.Image);
Button.Text = buttonText;
CssClass = "ParametrizedAction";
}
}
public ParametrizedActionDateRangeControl() : this(ActionContainerOrientation.Horizontal) { }
public ParametrizedActionDateRangeControl(ActionContainerOrientation orientation) {
_button = RenderHelper.CreateASPxButton();
_button.AutoPostBack = false;
_button.Click += button_Click;
_button.EnableClientSideAPI = true;
_button.ID = "B";
Control editor = CreateEditorBody();
editor.ID = "Ed";
label = RenderHelper.CreateASPxLabel();
label.ID = "L";
label.Wrap = DevExpress.Utils.DefaultBoolean.False;
Table table = RenderHelper.CreateTable();
table.CssClass = "ParametrizedActionControl";
table.ID = "T";
labelCell = new TableCell();
TableCell editorCell = new TableCell();
TableCell buttonCell = new TableCell();
FillTemplateTable(orientation, table, labelCell, editorCell, buttonCell);
labelCell.Controls.Add(label);
labelCell.CssClass = "ControlCaption";
editorCell.Controls.Add(editor);
editorCell.CssClass = "Label";
buttonCell.Controls.Add(_button);
buttonCell.CssClass = "Editor";
Controls.Add(table);
}
private Control CreateEditorBody() {
calendarFrom = RenderHelper.CreateASPxDateEdit();
calendarFrom.ID = "EdF";
calendarTo = RenderHelper.CreateASPxDateEdit();
calendarTo.ID = "EdT";
Table table = RenderHelper.CreateTable();
TableRow trow = new TableRow();
TableCell tcell1 = new TableCell();
tcell1.Controls.Add(calendarFrom);
trow.Cells.Add(tcell1);
TableCell tcell2 = new TableCell();
tcell2.Controls.Add(calendarTo);
trow.Cells.Add(tcell2);
table.Rows.Add(trow);
return table;
}
protected Table FillTemplateTable(ActionContainerOrientation orientation, Table table, TableCell labelCell,
TableCell editorCell, TableCell buttonCell) {
if (Equals(orientation, ActionContainerOrientation.Horizontal)) {
return FillHTemplateTable(table, labelCell, editorCell, buttonCell);
} else {
return FillVTemplateTable(table, labelCell, editorCell, buttonCell);
}
}
protected virtual Table FillHTemplateTable(Table table, TableCell labelCell, TableCell editorCell, TableCell buttonCell) {
table.Rows.Add(new TableRow());
table.Rows[0].Cells.Add(labelCell);
table.Rows[0].Cells.Add(editorCell);
table.Rows[0].Cells.Add(buttonCell);
return table;
}
protected virtual Table FillVTemplateTable(Table table, TableCell labelCell, TableCell editorCell, TableCell buttonCell) {
table.Rows.Add(new TableRow());
table.Rows[0].Cells.Add(labelCell);
table.Rows.Add(new TableRow());
table.Rows[1].Cells.Add(editorCell);
table.Rows[1].Cells.Add(buttonCell);
return table;
}
public void SetNullValuePrompt(string nullValuePrompt) {
calendarFrom.NullText = nullValuePrompt;
calendarTo.NullText = nullValuePrompt;
}
public override void Dispose() {
if (_button != null) {
_button.Click -= button_Click;
}
base.Dispose();
_button = null;
_isDisposed = true;
}
public bool ClientEnabled {
get {
return _clientEnabled;
}
set {
_clientEnabled = value;
UpdateEnabled();
}
}
public override string ToolTip {
get { return Button.ToolTip; }
set { Button.ToolTip = value; }
}
public ASPxButton Button {
get {
return _button;
}
}
public string Caption {
get { return label.Text; }
set {
label.Text = value;
CaptionVisible = !String.IsNullOrEmpty(value);
}
}
public bool CaptionVisible {
get { return labelCell.Visible; }
set { labelCell.Visible = value; }
}
public virtual object Value {
get {
return new Range<DateTime>() { From = calendarFrom.Date, To = calendarTo.Date };
}
set {
if (value is Range<DateTime>) {
calendarFrom.Date = ((Range<DateTime>)value).From;
calendarTo.Date = ((Range<DateTime>)value).To;
}
}
}
public event EventHandler Click;
#region IDisposableExt Members
public bool IsDisposed {
get { return _isDisposed; }
}
#endregion
}
}
Visual BasicImports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports DevExpress.Web
Imports DevExpress.ExpressApp.Web
Imports DevExpress.ExpressApp.Actions
Imports DevExpress.ExpressApp.Utils
Imports DevExpress.ExpressApp.Web.SystemModule
Imports DevExpress.ExpressApp
Imports DevExpress.ExpressApp.Web.Templates.ActionContainers.Menu
Imports DevExpress.ExpressApp.Model
Imports DevExpress.ExpressApp.Web.Templates
Imports Solution28.Module.Web
Imports DevExpress.ExpressApp.Templates
Namespace Solution28.Module.Web
Public Structure Range(Of T)
Public [From] As T
Public [To] As T
Public Overrides Function Equals(ByVal obj As Object) As Boolean
If TypeOf obj Is Range(Of T) Then
Return Equals(DirectCast(obj, Range(Of T)).From, [From]) AndAlso Equals(DirectCast(obj, Range(Of T)).To, [To])
End If
Return False
End Function
Public Overrides Function GetHashCode() As Integer
Return [From].GetHashCode() Xor [To].GetHashCode()
End Function
End Structure
End Namespace
Namespace DevExpress.ExpressApp.Web.Templates.ActionContainers
Public Class ParametrizedRangeActionMenuActionItem
Inherits TemplatedMenuActionItem
Private _orientation As ActionContainerOrientation
Private isExecuted As Boolean = False
Private executionLockCount As Integer
Private clientClickHandler As String
Private Sub UpdateEditorValue()
executionLockCount += 1
Try
If Control IsNot Nothing Then
Control.Value = CType(Action, ParametrizedAction).Value
End If
Finally
executionLockCount -= 1
End Try
End Sub
Private Sub action_CurrentValueChanged(ByVal sender As Object, ByVal e As EventArgs)
UpdateEditorValue()
End Sub
Private Sub ExecuteWithCurrentValue()
If executionLockCount = 0 AndAlso (Not isExecuted) Then
isExecuted = True
CType(Action, ParametrizedAction).DoExecute(Control.Value)
End If
End Sub
Protected Overrides Sub SetImage(ByVal imageInfo As ImageInfo)
If Control IsNot Nothing Then
Control.SetImage(imageInfo, Action.ShortCaption)
End If
End Sub
Protected Overrides Sub SetCaption(ByVal caption As String)
If Control IsNot Nothing Then
Control.Caption = caption
If Control.Button.Image.IsEmpty Then
Control.Button.Text = Action.ShortCaption
End If
Control.SetNullValuePrompt(Action.NullValuePrompt)
End If
End Sub
Protected Overrides Sub SetPaintStyle(ByVal paintStyle As ActionItemPaintStyle)
MyBase.SetPaintStyle(paintStyle)
If Control IsNot Nothing Then
Control.CaptionVisible = Not Equals(paintStyle, ActionItemPaintStyle.Image)
End If
End Sub
Protected Overrides Sub SetEnabled(ByVal enabled As Boolean)
If Control IsNot Nothing Then
Control.ClientEnabled = enabled
End If
End Sub
Protected Overrides Sub SetToolTip(ByVal toolTip As String)
If Control IsNot Nothing Then
Control.ToolTip = toolTip
End If
End Sub
Protected Overrides Sub SetConfirmationMessage(ByVal message As String)
End Sub
Protected Overrides Function CreateControlCore() As Control
isExecuted = False
Dim result As New ParametrizedActionDateRangeControl(Orientation)
result.ID = WebIdHelper.GetCorrectedActionId(Action)
result.Value = CType(Action, ParametrizedAction).Value
result.SetNullValuePrompt(Action.NullValuePrompt)
result.Button.AutoPostBack = False
result.Button.ClientSideEvents.Click = clientClickHandler
Return result
End Function
Public Sub New(ByVal action As ParametrizedAction)
MyBase.New(action)
AddHandler action.ValueChanged, AddressOf action_CurrentValueChanged
End Sub
Public Overrides Sub Dispose()
If Action IsNot Nothing Then
RemoveHandler Action.ValueChanged, AddressOf action_CurrentValueChanged
End If
MyBase.Dispose()
End Sub
Public Overrides Sub ProcessAction()
ExecuteWithCurrentValue()
End Sub
Public Overrides Sub SetClientClickHandler(ByVal callbackManager As XafCallbackManager, ByVal controlID As String)
Dim clientScript As String = callbackManager.GetScript(controlID, String.Format("'{0}'", MenuItem.IndexPath), Action.GetFormattedConfirmationMessage(), IsPostBackRequired)
clientClickHandler = String.Format("function(s, e) {{ {0}e.processOnServer = false;}}", clientScript)
If Control IsNot Nothing Then
Control.Button.ClientSideEvents.Click = clientClickHandler
End If
End Sub
Public Shadows ReadOnly Property Control() As ParametrizedActionDateRangeControl
Get
Return CType(MyBase.Control, ParametrizedActionDateRangeControl)
End Get
End Property
Public Shadows ReadOnly Property Action() As ParametrizedAction
Get
Return CType(MyBase.Action, ParametrizedAction)
End Get
End Property
Public Property Orientation() As ActionContainerOrientation
Get
Return _orientation
End Get
Set(ByVal value As ActionContainerOrientation)
_orientation = value
End Set
End Property
Public Overrides Function GetClientUpdateScript(ByVal clientItemInnerState As String, ByVal menuItemName As String, ByVal indexPath As String, ByVal callbackManager As XafCallbackManager, ByVal actionContainerUniqueID As String) As String
Return ""
End Function
Public Overrides ReadOnly Property InnerState() As String
Get
Return ""
End Get
End Property
End Class
Public Class ParametrizedActionDateRangeControl
Inherits WebControl
Implements INamingContainer, IDisposableExt
Private calendarFrom As ASPxDateEdit
Private calendarTo As ASPxDateEdit
Private _button As ASPxButton
Private label As ASPxLabel
Private labelCell As TableCell
Private isPrerendered As Boolean
Private _isDisposed As Boolean
Private _clientEnabled As Boolean = True
Private Sub button_Click(ByVal sender As Object, ByVal e As EventArgs)
OnClick()
End Sub
Private Sub UpdateEnabled()
If Button IsNot Nothing Then
Button.ClientEnabled = ClientEnabled
End If
If calendarFrom IsNot Nothing Then
calendarFrom.ClientEnabled = ClientEnabled
End If
If calendarTo IsNot Nothing Then
calendarTo.ClientEnabled = ClientEnabled
End If
End Sub
Protected Function GetForceButtonClickScript() As String
Return String.Format("function(s, e) {{ {0}(e, '{1}'); }}", RenderHelper.GetForceButtonClickFunctionName(), _button.ClientID)
End Function
Protected Overridable Function GetClientControlClassName() As String
Return "ParametrizedActionClientControl"
End Function
Protected Overrides Sub OnPreRender(ByVal e As EventArgs)
isPrerendered = True
MyBase.OnPreRender(e)
End Sub
Protected Overrides Sub Render(ByVal writer As HtmlTextWriter)
If Not isPrerendered Then
OnPreRender(EventArgs.Empty)
End If
MyBase.Render(writer)
DevExpress.Web.Internal.RenderUtils.WriteScriptHtml(writer, String.Format("window.{0} = new {1}('{2}');", ClientID, GetClientControlClassName(), ClientID))
End Sub
Protected Overridable Sub OnClick()
RaiseEvent Click(Me, New EventArgs())
End Sub
Public Sub SetConfirmationMessage(ByVal message As String)
ConfirmationsHelper.SetConfirmationScript(Button, message)
End Sub
Public Sub SetImage(ByVal imageInfo As ImageInfo, ByVal buttonText As String)
If Not imageInfo.IsEmpty Then
ASPxImageHelper.SetImageProperties(Button.Image, imageInfo)
Button.Text = ""
CssClass = "ParametrizedActionWithImage"
Else
ASPxImageHelper.ClearImageProperties(Button.Image)
Button.Text = buttonText
CssClass = "ParametrizedAction"
End If
End Sub
Public Sub New()
Me.New(ActionContainerOrientation.Horizontal)
End Sub
Public Sub New(ByVal orientation As ActionContainerOrientation)
_button = RenderHelper.CreateASPxButton()
_button.AutoPostBack = False
AddHandler _button.Click, AddressOf button_Click
_button.EnableClientSideAPI = True
_button.ID = "B"
Dim editor As Control = CreateEditorBody()
editor.ID = "Ed"
label = RenderHelper.CreateASPxLabel()
label.ID = "L"
label.Wrap = DevExpress.Utils.DefaultBoolean.False
Dim table As Table = RenderHelper.CreateTable()
table.CssClass = "ParametrizedActionControl"
table.ID = "T"
labelCell = New TableCell()
Dim editorCell As New TableCell()
Dim buttonCell As New TableCell()
FillTemplateTable(orientation, table, labelCell, editorCell, buttonCell)
labelCell.Controls.Add(label)
labelCell.CssClass = "ControlCaption"
editorCell.Controls.Add(editor)
editorCell.CssClass = "Label"
buttonCell.Controls.Add(_button)
buttonCell.CssClass = "Editor"
Controls.Add(table)
End Sub
Private Function CreateEditorBody() As Control
calendarFrom = RenderHelper.CreateASPxDateEdit()
calendarFrom.ID = "EdF"
calendarTo = RenderHelper.CreateASPxDateEdit()
calendarTo.ID = "EdT"
Dim table As Table = RenderHelper.CreateTable()
Dim trow As New TableRow()
Dim tcell1 As New TableCell()
tcell1.Controls.Add(calendarFrom)
trow.Cells.Add(tcell1)
Dim tcell2 As New TableCell()
tcell2.Controls.Add(calendarTo)
trow.Cells.Add(tcell2)
table.Rows.Add(trow)
Return table
End Function
Protected Function FillTemplateTable(ByVal orientation As ActionContainerOrientation, ByVal table As Table, ByVal labelCell As TableCell, ByVal editorCell As TableCell, ByVal buttonCell As TableCell) As Table
If Equals(orientation, ActionContainerOrientation.Horizontal) Then
Return FillHTemplateTable(table, labelCell, editorCell, buttonCell)
Else
Return FillVTemplateTable(table, labelCell, editorCell, buttonCell)
End If
End Function
Protected Overridable Function FillHTemplateTable(ByVal table As Table, ByVal labelCell As TableCell, ByVal editorCell As TableCell, ByVal buttonCell As TableCell) As Table
table.Rows.Add(New TableRow())
table.Rows(0).Cells.Add(labelCell)
table.Rows(0).Cells.Add(editorCell)
table.Rows(0).Cells.Add(buttonCell)
Return table
End Function
Protected Overridable Function FillVTemplateTable(ByVal table As Table, ByVal labelCell As TableCell, ByVal editorCell As TableCell, ByVal buttonCell As TableCell) As Table
table.Rows.Add(New TableRow())
table.Rows(0).Cells.Add(labelCell)
table.Rows.Add(New TableRow())
table.Rows(1).Cells.Add(editorCell)
table.Rows(1).Cells.Add(buttonCell)
Return table
End Function
Public Sub SetNullValuePrompt(ByVal nullValuePrompt As String)
calendarFrom.NullText = nullValuePrompt
calendarTo.NullText = nullValuePrompt
End Sub
Public Overrides Sub Dispose()
If _button IsNot Nothing Then
RemoveHandler _button.Click, AddressOf button_Click
End If
MyBase.Dispose()
_button = Nothing
_isDisposed = True
End Sub
Public Property ClientEnabled() As Boolean
Get
Return _clientEnabled
End Get
Set(ByVal value As Boolean)
_clientEnabled = value
UpdateEnabled()
End Set
End Property
Public Overrides Property ToolTip() As String
Get
Return Button.ToolTip
End Get
Set(ByVal value As String)
Button.ToolTip = value
End Set
End Property
Public ReadOnly Property Button() As ASPxButton
Get
Return _button
End Get
End Property
Public Property Caption() As String
Get
Return label.Text
End Get
Set(ByVal value As String)
label.Text = value
CaptionVisible = Not String.IsNullOrEmpty(value)
End Set
End Property
Public Property CaptionVisible() As Boolean
Get
Return labelCell.Visible
End Get
Set(ByVal value As Boolean)
labelCell.Visible = value
End Set
End Property
Public Overridable Property Value() As Object
Get
Return New Range(Of Date)() With {.From = calendarFrom.Date, .To = calendarTo.Date}
End Get
Set(ByVal value As Object)
If TypeOf value Is Range(Of Date) Then
calendarFrom.Date = DirectCast(value, Range(Of Date)).From
calendarTo.Date = DirectCast(value, Range(Of Date)).To
End If
End Set
End Property
Public Event Click As EventHandler
#Region "IDisposableExt Members"
Public ReadOnly Property IsDisposed() As Boolean Implements IDisposableExt.IsDisposed
Get
Return _isDisposed
End Get
End Property
#End Region
End Class
End Namespace