DXTabControl can be used with different views. In this example, it's demonstrated how to use TabControlScrollView. In the scroll view, tab headers are displayed in a single line. When headers don't fit into the Tab Header Panel, scroll buttons are displayed.
In TabControlScrollView, tab headers can be displayed horizontally and vertically. To control this, use the TabControlScrollView.HeaderOrientation property.
How To: Enable Scrolling for Tab Headers in DXTabControl Using ScrollView
How To: Show Tab Headers in DXTabControl in Multiple Lines Using MultiLineView
DXTabControl supports multiple views. In this example, TabControlMultiLineView is used to display tabs in multiple lines when tab headers don't fit into the Tab Header Panel.
TabControlMultiLineView has all functionality available in TabControlViewBase and has two additional options to control behavior of tab headers:
-FixedHeaders - when this option is enabled, tab headers are not reordered when a tab is selected
-HeaderAutoFill - gets or sets whether tab headers are automatically stretched when there is empty space in the Tab Header Panel
How To: Implement Browser-style Tab Behavior in DXTabControl Using StretchView
One of DXTabControl's supported views is TabControlStretchView. This view automatically stretches tab headers to all available space in the Tab Header Panel and allows dragging tabs in the browser-style manner. To control the dragging behavior, use the DragDropMode property. In addition to this functionality, TabControlStretchView allows pinning tabs to the right or left side of the Tab Header Panel. To pin a tab, use the TabControlStretchView.PinMode attached property.
How To: Integrate DXTabControl Tabs Into a Window Header
DXTabControl can be integrated into a window. When this feature is enabled, TabControl tabs are displayed next to the window title.
To activate this functionality, replace the standard Window with DXTabbedWindow.
ASPxGridView - How to filter data by using the Header Filter when a cell contains text separated with a comma
This example illustrates how to customize the Header Filter to allow filtering text separated with a comma in the grid column.
How To: Use One Common Element in All DXTabControl's Tabs
How To: Add or Close Tabs Using Special Buttons in DXTabControl
DXTabControl provides built-in functionality for hiding and adding tabs. This example demonstrates how to add or delete when they are generated from a collection.
To show corresponding buttons, use the HideButtonShowMode and NewButtonShowMode properties. To remove an item from the source collection when a tab is closed, use the CloseCommand. To create a new tab when the add button is clicked, use NewTabCommand. These commands are automatically executed by TabControl when corresponding actions are performed.
Please refer to the following article for more details: Adding and Removing Tab Items.
How to initialize appointment images and display text using the custom field values
Starting with version 15.2, we split layout calculation operations into several threads to improve the typical performance of a Scheduling application. Correspondingly, in a common scenario, the InitAppointmentImages event (as well as InitAppointmentDisplayText) can be raised from another thread than the one where the SchedulerControl instance was created. Accessing the SchedulerControl (SchedulerStorage) instance directly in the InitAppointmentImages event when the OptionsBehavior.UseAsyncMode property is true can result in "cross-thread" exceptions.
Correspondingly, to avoid the "cross-thread" issues in a scenario when the OptionsBehavior.UseAsyncMode property is true, you need to avoid direct accessing the SchedulerControl or SchedulerStorage instance in the mentioned event handlers.
To implement it, we recommend storing all the required information to calculate custom appointment images and the display text as custom appointment fields, to operate only with the current appointment instance without accessing an underlying source object.
This example demonstrates how it can be achieved.
How To: Generate Tabs in DXTabControl from a Collection
The following example demonstrates how to bind a TabControl to data.
When the ItemsSource property is set, DXTabControl automatically generates tabs based on collection items. Most commonly, the following properties are used in this scenario :
-ItemTemplate - template applied to tab content
-ItemContainerStyle - style applied to tabs represented by the DXTabItem elements
-ItemHeaderTemplate - template applied to tab headers
How to manage users (register a new user, restore a password, etc.) from the logon form in ASP.NET
Scenario
This example contains a reusable Security.Extensions module that provides a possible solution for the following scenarios:
Security - provide the capability to register a new user from the logon form
Security.Authentication - provide a "Forgot Password" feature
Steps to implement
In order to use this module in your project, do the following:
1. Download and include the Security.Extensions module project into your XAF solution (as per MSDN) and rebuild it;
2. Invoke the Module Designer for your platform-agnostic module and drag and drop the SecurityExtensionsModule from the Toolbox;
3. Add the following code into your platform-agnostic module class:
[C#]staticYourPlatformAgnosticModuleName(){SecurityExtensionsModule.CreateSecuritySystemUser=Updater.CreateUser;}
where 'Updater.CreateUser' is your custom method that matches the following definition:
[C#]publicdelegateIAuthenticationStandardUserCreateSecuritySystemUser(IObjectSpaceobjectSpace,stringuserName,stringemail,stringpassword,boolisAdministrator);
IMPORTANT NOTE
This module is currently ASP.NET only.
Question Comments
Added By: Daniele Bonetti at: 8/27/2012 3:14:19 PM
downloaded and run the demo but i receive "Object reference not set to an instance of an object" error
xaf 12.1.5
It can't be run. Object reference not set to an instance of an object" error
Added By: Santiago Moscoso at: 11/12/2012 3:39:21 PMOn windows needs to invoke "EnsureShowViewStrategy" method from application, it's protected so you must use reflection.
On web I have problems with the action buttons not refreshing properly, must presh F5 to update buttons. (I'm working on 11.2.11)
Added By: Evgeniy Meyke at: 11/26/2012 4:59:41 AMDennis, any chance to have this checked out soon?
//Dennis: TODO
//A possible issue in the framework - Controllers from ShowViewParameters are not added to the current Frame on the Web.
//e.ShowViewParameters.Controllers.Add(CreateDialogController());
quick question before i begin integrating this: referring to the comment above " Include the module sources into your solution and rebuild it;" .. are you referring to the modules as listed below, or ALL the xaf modules?
Added By: drew.. at: 3/11/2013 10:12:45 AM.. for the benefit of others, this reference to "module" in #1 above, means to drop the entire Security.Extensions folder from the demo into your current solution that you want to update with the basic feature. Then add a reference from your platform-agnostic module (PAM) to the added project, rebuild, THEN go into the module designer for the PAM and drag-n-drop your newly added security module into the required modules section. Then rebuild again.
Added By: drew.. at: 3/11/2013 10:31:40 AMbtw, i am in the process of integrating this with my DC-only based project. Once i have all the conversions done and tested i will likely post the project to help others save time.
Added By: Mario Blatarić at: 3/12/2013 1:59:10 AMWhich parts make this module ASP.NET only? I don't understand what needs to be changed in order to make this work in WinForms as well. Any hints?
Added By: John01 at: 4/16/2013 8:10:38 AMHi
When I run the example and click OK on register user I get the error 'Property 'Email' does not exist within type 'DevExpress.ExpressApp.Security.Strategy.SecuritySystemUser'.' on line user.SetMemberValue("Email", email) in function CreateUser. The email value is 'sam@example.com'. I did upgrade the project to 12.2.7 before running though. Any ideas?
Thanks
Regards
Added By: CArlos segura_1 at: 6/13/2013 1:22:53 PMsomeone has been to implement this?
Added By: Tony Tadros at: 9/5/2013 11:51:37 PMHello Devexpress ,
having problem for some time downloading your examples
was thinking something wrong with my pc but tried some other still the same thing
ICAP Error (icap_error)
An error occurred while performing an ICAP operation: Maximum file size exceeded; File: GetExample; Sub File: ManageUsersOnLogon.Module\BusinessObjects\ReadMe.txt; Vendor: Kaspersky Labs; Engine error code: 0x00000000; Engine version: 8.1.8.79; Pattern version: 130905.225000.10967985; Pattern date: 2013.09.05 22:50:00
There could be a network problem, the ICAP service may be misconfigured, or the ICAP server may have reported an error.
For assistance, contact your network support team.
Added By: Apostolis Bekiaris (DevExpress) at: 9/19/2013 3:35:30 AMImplemented in eXpandFramework 13.1.7.1
http://apobekiaris.blogspot.gr/2013/09/how-to-manage-users-register-new-user.html
I would like to add a capctha code in this registration page.
how can i do? is there an example?
thanks
@Daniele: While we do not have a ready E4037 example modification for this particular scenario, you can find the following ASP.NET documentation and reference tickets helpful:
ASPxCaptcha Overview
How to Validate a Captcha On Logon Screen
ASPxCaptcha in login page
How to: Use Custom Logon Parameters and Authentication
is it possible to customize the logon form in order to obtain the logon button first of two rows with the button "forgot password" and "create a new user"?
Added By: Daniele M at: 9/7/2015 9:04:38 AMis it possible to change label to user name in register user form? I tried with displayname attribute in RegisterUserParameters,cs but it didn't work.
thanks
@Daniele:
Both things are possible. The Security.Extensions module contains the Model.DesignedDiffs.xafml file with model customizations of the AuthenticationStandardLogonParameters_DetailView node. This node determines what your logon form will look like in the UI. You can customize its layout or change captions of items via the Model Editor designer. Should you experience any further customization difficulties here, please submit a separate ticket, and describe what you tried to do and what did not work as expected. Thanks.
I can not integrate the example 3 with https://www.devexpress.com/Support/Center/Example/Details/E2849 to enforce password complexity.
can you help me?
thank you
Hello Daniele,
To process your recent post more efficiently, I created a separate ticket on your behalf: T293660: How to integrate the E4037 and E2849 examples. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.
Hi Dennis & Anatol,
I have used the is example in my project and it works great.
could you please show how to add an image (mylogo.png for example) on the right top corner of the logon page? It is a png image to show company's logo on the logon page.
Added By: Dennis (DevExpress Support) at: 10/12/2015 3:58:10 AM @MohammedFarooq:I am happy to hear of your progress.
>> how to add an image (mylogo.png for example) on the right top corner of the logon page?
Would you please submit a separate ticket and attach a screenshot of the desired UI, because possible solutions will vary a lot based on the exact logo placement?
Added By: MohammedFarooq at: 10/12/2015 8:54:03 AMHi Dennis,
I have created a separate ticket as suggested by you.
https://www.devexpress.com/Support/Center/Question/Details/T299424
Added By: Vishwas Mokashi at: 12/24/2015 3:42:16 AMHello,
I want to implement User Registration in our solution.
<<
Steps to implement
In order to use this module in your project, do the following:
1. Include the module sources into your solution and rebuild it;
>>
What are Module Sources ? Module.cs? LogonActionParameters.cs?, ManageUsersOnLogonController.cs? given in this ticket?
where and how to include it in solution?
Dennis, thanks I know how to include project but where from to down load?. Or I create new Module project and copy paste the code classes given in this ticket?
Added By: Dennis (DevExpress Support) at: 12/24/2015 6:31:24 AM@Vishwas: You can download complete example source code under the Downloads section at the right side of the example webpage. Let me know if you experience any further difficulties here.
Added By: Vishwas Mokashi at: 12/24/2015 6:36:55 AMThanks Dennis, I had done that but problem was I did not have the Sample Runner loaded on my machine and could not extract the files.
Thank you and Merry Christmas!!
Added By: Dennis (DevExpress Support) at: 12/24/2015 7:02:23 AM @Vishwas: Am I correct that you have now installed the Example Runner and could download this example? If so, I am happy to hear of your results.Merry Xmas to you and yours too!Added By: Vishwas Mokashi at: 12/24/2015 7:14:39 AM
Yes Dennis, I have Sample Runner, could download it and use it also. Thanks...
Added By: Dennis (DevExpress Support) at: 12/24/2015 7:33:15 AM @@Vishwas: Great!How To: Cache Views in DXTabControl in Order Not to Recreate Them Each Time a Tab is Selected
When views with heavy elements are displayed in a DXTabControl, it makes sense to cache them so that they are not recreated whenever a tab is opened. This will decrease loading time for cached tabs. DXTabControl supports several cache modes managed by the TabContentCacheMode property:
- CacheAllTabs - all tabs are cached when DXTabControl is shown
- CacheTabsOnSelecting - tabs are cached only after selecting
- None - caching is disabled
Synchronization with MS Outlook - a demonstration example
WARNING: When you run this example, you can delete all data in your MS Outlook calendar. We suggest that you backup your data prior to running the example.
Question Comments
Added By: Alexander Koshmelev at: 11/30/2015 10:19:10 PM
Hello!
Dear devExpress team,
please provide a complete sample of Synchronization with MS Outlook!
Best Regards, Alex
Hello,
To process your recent post more efficiently, I created a separate ticket on your behalf: T318784: Provide a complete sample of synchronization with MS Outlook. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.
When I try this example, all my outlook appointments are deleted. Also if I add an appointment in outlook then synchronise, all my resource items get the appointment. How can I only Synchronise my Appointments, and not delete existing ones.
Added By: Andrey (DevExpress Support) at: 12/24/2015 8:18:44 AMHello,
To process your recent post more efficiently, I created a separate ticket on your behalf: T328346: Outlook appointments are deleted when the T158895 example is used to synchronize the Scheduler control with MS Outlook. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.
ASPxGridView - How to implement a popup Edit Form when the Batch Edit mode is used
This example demonstrates how to implement editing in the popup's Edit Form when the grid's Batch Edit mode is used. The main idea is to create editors for all editable fields of the grid. Then, after filling the fields, all values are set to the grid with the ASPxClientGridView.batchEditApi.SetCellValue method.
ASPxGridView - How to select only a single check box in a row when DataItemTemplate and Batch Editing are used
This example illustrates how to select a single check box when the DataItemTemplate or Batch Editing is used in ASPxGridView.
Batch Editing mode
It is necessary to handle ASPxGridView's CellEditorInitialize event to assign ASPxCheckBox' client-side CheckedChanged event handler to the client grid. So, it is possible to set a check box’ state in the CheckedChanged event handler using batchEditApi. To determine which row cell to update, subscribe to ASPxGridView's client-side BatchEditStartEditing event and get a row index and focused column in this event handler.
DataItemTemplate
Place ASPxCheckBox to the DataItemTemplate of corresponding columns. Handle the ASPxCheckBox.Init event and subscribe to the client-side CheckedChanged event there. Pass the required parameters in the client-side CheckedChanged event handler to get a checked check box and send a callback to ASPxGridView. On this callback, check or uncheck check boxes and save their state to ASPxGridView's data source.
How to open Excel files in GridControl
[UPDATED]
We've introduced a special data source which extracts data from Microsoft Excel workbooks or CSV files in v15.2 - ExcelDataSource Class.
Use the approach described below for prior versions.
This functionality is not supported out-of-the-box. Our GridControl, as well as any standard control, does not directly work with physical files. There are many reasons for this. For example, it is not possible to get notifications when some part of a physical file is changed. Thus, it will be necessary to reload the entire file each time the GridControl's content needs to be refreshed. Also, to save each change made in GridControl, it will be necessary to access this file again. Thus, dealing with physical files directly will be very slow.
That is why, to open an Excel file in GridControl, it is necessary to use an approach that you would use with a standard DataGridView control: populate a DataSet with data from an Excel file and then bind the grid control to this DataSet. To do this, you can use the Microsoft OLE DB Provider for Microsoft Jet. These solutions are described in the following articles:
Microsoft OLE DB Provider for Microsoft Jet
Import Excel File to DataSet - CodeProject
This example demonstrates this approach in action.
GridView - How to switch between different datasources (models) by using ajax callbacks
See Also:
E4063 - How to use the jQuery.ajax function with DevExpress MVC Extensions
T191698 - How to isolate extension settings into separate helper class and share a single partial view to display multiple extensions
How to change an indent between root nodes in TreeList
This example illustrates how to change an indent between root nodes.
How to pass a dashboard parameter to a filter string
The following example demonstrates how to create a new dashboard parameter and pass it to a dashboard item filter string.
In this example, the dashboard data source contains two queries - the SalesPerson query is used for data visualization while the Categories query provides values for the dashboard parameter.
After the dashboard parameter is created, it is passed to a dashboard item's filter strings. So, the dashboard displays data according to the selected values.
DateEdit - How to select multiple dates
This example shows how to create a DateEdit descendant that will allow date unit selection, and multiple dates and periods selection.
See Also:
Forcing DateEdit to select multiple dates and periods
Question Comments
Added By: Torr Wash at: 12/7/2015 11:52:55 PM
Example 15.2.3 absolutely stupid and does not correspond to the functional old version!
How to make DateEdit function as DatePeriodEdit?
You have successfully broke what worked for several years.
As it is now, edit Period or PeriodSet ??
DatePeriodEdit is now impossible to compile because you have cut the necessary classes!
Hello Torr,
We have introduced a calendar control in version 15.2 - CalendarControl. This control has the SelectionMode property.
Now, this calendar is used in DateEdit's popup. Thus, SelectedMode is available in the RepositoryItemDateEdit class. However, there is no way to obtain selection of multiple dates for DateEdit.EditValue at the moment.
If you wish to get or set a selected range, you can use CalendarControl.SelectedRanges. I have modified the example to illustrate it.
Do not hesitate to contact us if you need any further assistance.
Надежда, я переписал DatePeriodEdit, чтобы он работал с новой версией DevExpress. Можете обновить Example :)
public sealed class DatePeriodEdit : DateEdit
{
static DatePeriodEdit() { RepositoryItemDatePeriodEdit.RegisterDatePeriodEdit(); }
public DatePeriodEdit()
{
EditValue = new PeriodsSet();
}
public override object EditValue
{
get
{
var value = base.EditValue as PeriodsSet;
return value ?? new PeriodsSet();
}
set
{
if (value is PeriodsSet)
{
base.EditValue = value;
return;
}
var s = value as string;
if (s != null)
{
base.EditValue = PeriodsSet.Parse(s);
}
}
}
public override string EditorTypeName => RepositoryItemDatePeriodEdit.DatePeriodEditName;
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public new RepositoryItemDatePeriodEdit Properties => base.Properties as RepositoryItemDatePeriodEdit;
protected override void AcceptPopupValue(object val)
{
var calendar = ((PopupDatePeriodEditForm)PopupForm).Calendar;
var periods = new PeriodsSet();
foreach (var range in calendar.SelectedRanges)
{
periods.Periods.Add(new Period(range.StartDate, range.EndDate.AddDays(-1)));
}
EditValue = periods;
}
protected override PopupBaseForm CreatePopupForm() { return new PopupDatePeriodEditForm(this); }
protected override object ExtractParsedValue(ConvertEditValueEventArgs e) { return e.Value; }
}
public class PopupDatePeriodEditForm : PopupDateEditForm
{
public PopupDatePeriodEditForm(DateEdit ownerEdit) : base(ownerEdit)
{
}
public override void ShowPopupForm()
{
base.ShowPopupForm();
SetSelectedRange();
}
protected override void SubscribeCalendarEvents()
{
base.SubscribeCalendarEvents();
Calendar.SelectionChanged += calendar_SelectionChanged;
}
protected override void UnsubscribeCalendarEvents()
{
base.UnsubscribeCalendarEvents();
Calendar.SelectionChanged -= calendar_SelectionChanged;
}
protected override void AssignCalendarProperties()
{
base.AssignCalendarProperties();
Calendar.SelectionMode = CalendarSelectionMode.Multiple;
Calendar.CaseWeekDayAbbreviations = TextCaseMode.SentenceCase;
Calendar.ShowMonthHeaders = false;
Calendar.ShowYearNavigationButtons = DefaultBoolean.True;
Calendar.SyncSelectionWithEditValue = false;
}
private void SetSelectedRange()
{
var value = OwnerEdit.EditValue as PeriodsSet;
if (value != null && value.Periods.Count > 0)
{
Calendar.EditValue = ((Period)value.Periods[value.Periods.Count - 1]).End;
Calendar.SelectedRanges.BeginUpdate();
foreach (Period period in value.Periods)
{
Calendar.SelectedRanges.Add(new DateRange(period.Begin, period.End));
}
Calendar.SelectedRanges.EndUpdate();
}
else
{
Calendar.EditValue = OwnerEdit.DateTime;
}
}
private void calendar_SelectionChanged(object sender, EventArgs e)
{
//TODO Хотелось бы сразу отображать выбранные периоды в OwnerEdit.Text без дерганий событий
}
}
[UserRepositoryItem("RegisterDatePeriodEdit")]
public sealed class RepositoryItemDatePeriodEdit : RepositoryItemDateEdit
{
public const string DatePeriodEditName = nameof(DatePeriodEdit);
char _separatorChar = ',';
static RepositoryItemDatePeriodEdit()
{
RegisterDatePeriodEdit();
}
public RepositoryItemDatePeriodEdit()
{
TextEditStyle = TextEditStyles.DisableTextEditor;
}
public override string EditorTypeName => DatePeriodEditName;
[Description("Gets or sets the character separating periods"), Category(CategoryName.Format), DefaultValue(',')]
public char SeparatorChar
{
get { return _separatorChar; }
set
{
if (SeparatorChar == value) return;
_separatorChar = value;
OnPropertiesChanged();
}
}
[Browsable(false)]
public override MaskProperties Mask => base.Mask;
[Browsable(false)]
public override FormatInfo EditFormat => DisplayFormat;
[Browsable(false)]
public new DefaultBoolean VistaEditTime => base.VistaEditTime;
[Browsable(false)]
public new DefaultBoolean VistaDisplayMode => base.VistaDisplayMode;
[Browsable(false)]
public new string EditMask => base.EditMask;
public static void RegisterDatePeriodEdit()
{
EditorRegistrationInfo.Default.Editors.Add(new EditorClassInfo(DatePeriodEditName,
typeof(DatePeriodEdit), typeof(RepositoryItemDatePeriodEdit),
typeof(DateEditViewInfo), new ButtonEditPainter(), true));
}
public override void Assign(RepositoryItem item)
{
base.Assign(item);
var source = item as RepositoryItemDatePeriodEdit;
if (source != null) _separatorChar = source.SeparatorChar;
}
protected override bool IsNullValue(object editValue)
{
var value = editValue as PeriodsSet;
if (value != null)
return value.Periods.Count == 0;
var s = editValue as string;
if (s == null) return false;
return PeriodsSet.Parse(s)?.Periods.Count == 0;
}
public override string GetDisplayText(FormatInfo format, object editValue)
{
var displayText = string.Empty;
var set = editValue as PeriodsSet;
if (set != null)
displayText = set.ToString(format.FormatString, SeparatorChar);
else
{
var s = editValue as string;
if (s != null)
displayText = PeriodsSet.Parse(s).ToString(format.FormatString, SeparatorChar);
}
var e = new CustomDisplayTextEventArgs(editValue, displayText);
if (format != EditFormat)
RaiseCustomDisplayText(e);
return e.DisplayText;
}
}
Thank you for your cooperation. I think it would be useful for our customers.
How to bind a ButtonEdit buttons to a collection in a view model
This example shows how to create ButtonEdit buttons based on a collection in a view model and define the button appearance using the DataTemplate and DataTemplateSelector classes.