Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all 7205 articles
Browse latest View live

SpellChecker - An example of use

$
0
0

This example illustrates how to load multiple Dictionaries to check spelling of a multi-language text in a simple text box control. Also, you will see how to setup a Custom Dictionary so that the end-user can add custom words to it. All actions are performed in code-behind to better illustrate SpellChecker basics.

Question Comments

Added By: Muhammad _ 1 at: 4/8/2016 4:45:04 AM    yes but did i need to add or download any dictionary as given below you pointing to any path
"\..\..\Dictionaries\es_ES\es_ES.aff";
Added By: Yulia (DevExpress Support) at: 4/8/2016 5:59:54 AM    

Hello Muhammad,

Dictionaries used in this Code Example are copied within the sample project, so you can find dictionary files in the corresponding folder.


How to change a report displayed in the DocumentViewer extension dynamically

$
0
0

This example demonstrates how you can dynamically change a report displayed by the DocumentViewer extension.

A callback is used to switch reports. So, the DocumentViewer extension is placed into the CallbackPanel extension. After the ComboBox selection is changed, a callback is sent to the CallbackPanel extension to update the DocumentViewer.

Question Comments

Added By: Réal Chartarnd at: 4/8/2016 6:47:41 AM    There's a bug in your example, if you add a dummy ribbon toolbar to DocumentViewerevery time we export to PDF is the first report that is exported, regardlessthe report that is displayed. if you have a solution, I am really interested 

@Html.DevExpress().Ribbon(settingsRb =>{ settingsRb.Name = "RibbonTest"; settingsRb.Tabs.AddRange(DocumentViewerExtension.DefaultRibbonTabs);}).GetHtml();
@Html.DevExpress().DocumentViewer(settings => {    settings.Name = "DocumentViewer";    settings.CallbackRouteValues = new {        Controller = "Home",        Action = "DocumentViewerPartial",        ReportName = Model.ReportName    };    settings.ExportRouteValues = new {        Controller = "Home",        Action = "DocumentViewerExport",        ReportName = Model.ReportName    };    settings.Report = Model.CreateReport();
    settings.ToolbarMode = DocumentViewerToolbarMode.ExternalRibbon;    settings.AssociatedRibbonName = "RibbonTest";}).GetHtml()

ASPxGridView - How to implement custom date validation in Batch Edit mode

$
0
0

This example illustrates how to implement custom date validation in Batch Edit mode: 
1) The ASPxClientGridView.BatchEditRowValidating event is used to check values on the client.
2) The ASPxGridView.RowValidating event is used to check values on the server.
3) The GridViewBatchEditSettings.AllowValidationOnEndEdit property allows switching validation modes on the client side.  

If the variation between the HireDate and BirthDate columns is less than 18, inputted data is invalid and data update is not allowed.

Question Comments

Added By: Irfan Khadrani at: 4/8/2016 8:46:05 AM    Thank you for the reply.
But I face on issue while using BatchEditRowValidating
[C#]
@usingWellsFargo.Framework;@usingWellsFargo.Framework.Enums;@usingWellsFargo.LFM.Domain;@modelWellsFargo.LFM.Models.HFFundHistoryModel@{vargrid=Html.DevExpress().GridView(settings=>{settings.KeyboardSupport=false;settings.SettingsBehavior.EnableRowHotTrack=false;settings.Settings.ShowTitlePanel=true;//Enable right click Export functionalitysettings.SettingsContextMenu.Enabled=true;settings.SettingsContextMenu.RowMenuItemVisibility.DeleteRow=false;settings.SettingsContextMenu.RowMenuItemVisibility.EditRow=false;settings.SettingsContextMenu.RowMenuItemVisibility.NewRow=false;settings.SettingsContextMenu.RowMenuItemVisibility.Refresh=false;settings.FillContextMenuItems=(sender,e)=>{if(e.MenuType==GridViewContextMenuType.Rows){varitem=e.CreateItem("Export List","Export");item.BeginGroup=true;e.Items.Insert(e.Items.IndexOfCommand(GridViewContextMenuCommand.Refresh),item);item.Items.Add("PDF","PDF",null,DevExpressHelper.GetUrl(new{Controller="FundHistory",Action="ExportHF",type="PDF",fundId=ViewData["FundId"],fundTypeId=ViewData["fundTypeId"]}));item.Items.Add("XLSX","XLSX",null,DevExpressHelper.GetUrl(new{Controller="FundHistory",Action="ExportHF",type="XLSX",fundId=ViewData["FundId"],fundTypeId=ViewData["fundTypeId"]}));}};settings.Name="HFHistoriesByFundIdGrid";settings.CallbackRouteValues=new{Controller="FundHistory",Action="HFFinancialHistoryGridPartialView",FundId=ViewData["FundId"]};settings.CustomJSProperties+=(s,e)=>{if(ViewData["jsonExceptions"]!=null){e.Properties["cp_exceptions"]=ViewData["jsonExceptions"];}if(ViewData["jsonExceptionsWarnings"]!=null){e.Properties["cp_warnings"]=ViewData["jsonExceptionsWarnings"];}};settings.HtmlDataCellPrepared=(s,e)=>{if((e.DataColumn.FieldName=="AsOfYr")&&(e.DataColumn.FieldName=="AsOfMonth"))return;if(Convert.ToDecimal(e.CellValue)< 0){e.Cell.ForeColor=System.Drawing.Color.Red;}};settings.InitNewRow=(s,e)=>{e.NewValues["AuditReceived"]=false;e.NewValues["Redemption"]= 0;e.NewValues["Subscription"]= 0;};settings.Width=System.Web.UI.WebControls.Unit.Percentage(100);settings.SettingsEditing.BatchUpdateRouteValues=new{Controller="FundHistory",Action="HFUpdateBatch",fundId=ViewData["FundId"]};settings.SettingsEditing.BatchEditSettings.ShowConfirmOnLosingChanges=false;settings.SettingsPager.Visible=true;settings.SettingsPager.PageSize= 100;settings.SettingsPager.Mode=GridViewPagerMode.ShowPager;settings.SettingsPager.PageSizeItemSettings.Visible=true;settings.SettingsPager.PageSizeItemSettings.Items=newString[]{"100","200","300","500"};settings.Settings.VerticalScrollBarMode=ScrollBarMode.Auto;// If VerticalScrollbarMode is used column/table width need to be explicitly setsettings.Settings.HorizontalScrollBarMode=ScrollBarMode.Auto;settings.Settings.ShowFilterRow=false;settings.Settings.ShowHeaderFilterButton=false;settings.Settings.ShowFilterRowMenu=false;settings.SettingsBehavior.AllowSort=false;settings.SettingsBehavior.ColumnResizeMode=ColumnResizeMode.Control;settings.SettingsBehavior.AllowDragDrop=true;settings.SettingsBehavior.AutoExpandAllGroups=false;settings.KeyFieldName="FundHistoryId";settings.EnablePagingCallbackAnimation=false;settings.SettingsLoadingPanel.Mode=GridViewLoadingPanelMode.Disabled;settings.Styles.AlternatingRow.Enabled=DefaultBoolean.True;settings.Styles.Row.Font.Size= 8;settings.Styles.Header.Font.Size= 9;settings.Styles.EditingErrorRow.Font.Size= 8;settings.SetStatusBarTemplateContent(c=>{@Html.DevExpress().Button(buttonSettings=>{buttonSettings.Name="buttonCancel";buttonSettings.Text="Cancel Changes";buttonSettings.RenderMode=ButtonRenderMode.Button;buttonSettings.Style.Add("float","right");buttonSettings.Style.Add("padding","0px 2px");buttonSettings.ClientSideEvents.Click="HFCancelHistoryBatch";buttonSettings.UseSubmitBehavior=false;buttonSettings.Height= 26;}).GetHtml();@Html.DevExpress().Button(buttonSettings=>{buttonSettings.Name="buttonSave";buttonSettings.Text="Save Changes";buttonSettings.RenderMode=ButtonRenderMode.Button;buttonSettings.Style.Add("float","right");buttonSettings.Style.Add("padding","0px 2px");buttonSettings.ClientSideEvents.Click="HFSaveHistoryBatch";buttonSettings.UseSubmitBehavior=false;buttonSettings.Height= 26;}).GetHtml();});settings.ClientSideEvents.BatchEditStartEditing="HFBatchStartEdit";settings.ClientSideEvents.BatchEditEndEditing="HFBatchEndEdit";settings.ClientSideEvents.Init="HFInitHistory";settings.ClientSideEvents.BeginCallback="HFBeginCallback";settings.ClientSideEvents.EndCallback="HFEndHistoryCallback";settings.SettingsEditing.Mode=GridViewEditingMode.Batch;settings.SettingsEditing.BatchEditSettings.EditMode=GridViewBatchEditMode.Cell;settings.Columns.Add(column=>{column.Name="commandColumn";column.EditFormSettings.Visible=DevExpress.Utils.DefaultBoolean.False;column.Width=Unit.Pixel(50);column.SetDataItemTemplateContent(c=>{Html.DevExpress().HyperLink(settingsLink=>{settingsLink.Name="lnkDelete"+c.VisibleIndex;settingsLink.Properties.Text="Delete";settingsLink.NavigateUrl="javascript:";settingsLink.Properties.ClientSideEvents.Click="function(s, e) {{ HFDeleteByIndex(HFGetVisibleIndex()); }}";}).Render();});});settings.Columns.Add(column=>{column.FieldName="AsOfYr";column.Caption="Year";column.Name="Year";column.ColumnType=MVCxGridViewColumnType.SpinEdit;varspProperties=column.PropertiesEditasSpinEditProperties;spProperties.ShowOutOfRangeWarning=true;spProperties.MinValue= 1900;spProperties.MaxValue=DateTime.Now.Year+ 1;spProperties.Width=Unit.Percentage(100);spProperties.ValidationSettings.RequiredField.IsRequired=true;spProperties.ValidationSettings.CausesValidation=true;column.Width=System.Web.UI.WebControls.Unit.Pixel(80);});settings.Columns.Add(column=>{column.FieldName="AsOfMonth";column.Caption="Month";column.Name="Month";column.ColumnType=MVCxGridViewColumnType.ComboBox;varcomboboxProperties=column.PropertiesEditasComboBoxProperties;comboboxProperties.DataSource=Model.Months;comboboxProperties.TextField="Value";comboboxProperties.ValueField="Key";comboboxProperties.ValueType=typeof(string);comboboxProperties.ValidationSettings.RequiredField.IsRequired=true;comboboxProperties.ValidationSettings.CausesValidation=true;comboboxProperties.IncrementalFilteringMode=IncrementalFilteringMode.Contains;comboboxProperties.Width=Unit.Pixel(80);comboboxProperties.ClientSideEvents.KeyDown="DropDownKeyDown";comboboxProperties.ClientSideEvents.ValueChanged="DropDownValueChanged";column.Settings.SortMode=DevExpress.XtraGrid.ColumnSortMode.DisplayText;column.Width=System.Web.UI.WebControls.Unit.Pixel(100);});settings.Columns.Add(column=>{column.FieldName="AuditReceived";column.Caption="Audit";column.Name="Audit";column.ColumnType=MVCxGridViewColumnType.ComboBox;varcomboboxProperties=column.PropertiesEditasComboBoxProperties;vardatasource=newDictionary<bool,string>();datasource.Add(true,"YES");datasource.Add(false,"NO");comboboxProperties.DataSource=datasource;//comboboxProperties.DataSource = Model.AuditOptions;comboboxProperties.TextField="Value";comboboxProperties.ValueField="Key";comboboxProperties.ValueType=typeof(string);comboboxProperties.ValidationSettings.RequiredField.IsRequired=true;comboboxProperties.ValidationSettings.CausesValidation=true;comboboxProperties.IncrementalFilteringMode=IncrementalFilteringMode.Contains;comboboxProperties.Width=Unit.Pixel(80);comboboxProperties.ClientSideEvents.KeyDown="DropDownKeyDown";comboboxProperties.ClientSideEvents.ValueChanged="DropDownValueChanged";column.Settings.SortMode=DevExpress.XtraGrid.ColumnSortMode.DisplayText;column.Width=System.Web.UI.WebControls.Unit.Pixel(80);});settings.Columns.Add(column=>{column.FieldName="NetAsset";column.Caption="Net Asset ($ millions)";column.Name="Net Asset";column.ColumnType=MVCxGridViewColumnType.SpinEdit;varprop=(SpinEditProperties)column.PropertiesEdit;//prop.ValidationSettings.RequiredField.IsRequired = true;//prop.ValidationSettings.CausesValidation = true;prop.SpinButtons.ShowIncrementButtons=false;prop.DisplayFormatInEditMode=true;prop.DecimalPlaces= 5;prop.MinValue= 0;prop.MaxValue=decimal.MaxValue;column.PropertiesEdit.DisplayFormatString="{0:C1}";column.Width=System.Web.UI.WebControls.Unit.Pixel(100);column.HeaderStyle.Wrap=DefaultBoolean.True;column.HeaderStyle.HorizontalAlign=HorizontalAlign.Center;});settings.Columns.Add(column=>{column.FieldName="Subscription";column.Caption="Subscription ($ millions)";column.Name="Subscription";column.ColumnType=MVCxGridViewColumnType.SpinEdit;column.Width=System.Web.UI.WebControls.Unit.Pixel(100);varprop=(SpinEditProperties)column.PropertiesEdit;prop.DisplayFormatInEditMode=true;prop.SpinButtons.ShowIncrementButtons=false;prop.DecimalPlaces= 5;prop.MinValue= 0;prop.MaxValue=decimal.MaxValue;column.PropertiesEdit.DisplayFormatString="{0:C1}";column.HeaderStyle.Wrap=DefaultBoolean.True;column.HeaderStyle.HorizontalAlign=HorizontalAlign.Center;});settings.Columns.Add(column=>{column.FieldName="Redemption";column.Caption="Redemption ($ millions)";column.Name="Redemption";column.ColumnType=MVCxGridViewColumnType.SpinEdit;varprop=(SpinEditProperties)column.PropertiesEdit;prop.SpinButtons.ShowIncrementButtons=false;prop.DisplayFormatInEditMode=true;prop.DecimalPlaces= 5;prop.MinValue= 0;prop.MaxValue=decimal.MaxValue;column.PropertiesEdit.DisplayFormatString="{0:C1}";column.Width=System.Web.UI.WebControls.Unit.Pixel(100);column.HeaderStyle.Wrap=DefaultBoolean.True;column.HeaderStyle.HorizontalAlign=HorizontalAlign.Center;});settings.Columns.Add(column=>{column.FieldName="NAVPerShare";column.Caption="NAV per Share ($ per share)";column.Name="NAV per Share";column.ColumnType=MVCxGridViewColumnType.SpinEdit;varprop=(SpinEditProperties)column.PropertiesEdit;prop.ValidationSettings.RequiredField.IsRequired=false;prop.ValidationSettings.CausesValidation=false;prop.SpinButtons.ShowIncrementButtons=false;prop.DisplayFormatInEditMode=true;prop.DecimalPlaces= 5;prop.MinValue= 0;prop.MaxValue=decimal.MaxValue;column.PropertiesEdit.DisplayFormatString="{0:C1}";column.Width=System.Web.UI.WebControls.Unit.Pixel(100);column.HeaderStyle.Wrap=DefaultBoolean.True;column.HeaderStyle.HorizontalAlign=HorizontalAlign.Center;});settings.Columns.Add(column=>{column.FieldName="MonthlyReturn";column.Caption="Monthly Return (%)";column.Name="Monthly Return";column.ColumnType=MVCxGridViewColumnType.SpinEdit;varprop=(SpinEditProperties)column.PropertiesEdit;prop.ValidationSettings.RequiredField.IsRequired=true;prop.ValidationSettings.CausesValidation=true;prop.SpinButtons.ShowIncrementButtons=false;prop.DisplayFormatInEditMode=true;prop.DecimalPlaces= 2;column.PropertiesEdit.DisplayFormatString="{0:n2}%";column.Width=System.Web.UI.WebControls.Unit.Pixel(125);});settings.Columns.Add(column=>{column.FieldName="YTD";column.Caption="YTD Return (%)";column.Name="YTD Return";column.ColumnType=MVCxGridViewColumnType.SpinEdit;varprop=(SpinEditProperties)column.PropertiesEdit;prop.ValidationSettings.CausesValidation=true;prop.SpinButtons.ShowIncrementButtons=false;prop.DisplayFormatInEditMode=true;prop.DecimalPlaces= 2;column.PropertiesEdit.DisplayFormatString="{0:n2}%";column.Width=System.Web.UI.WebControls.Unit.Pixel(110);});settings.Columns.Add(column=>{column.FieldName="MonthlyEarning";column.Caption="Monthly P&L ($ millions)";column.Name="Monthly P&L";column.ColumnType=MVCxGridViewColumnType.SpinEdit;varprop=(SpinEditProperties)column.PropertiesEdit;prop.SpinButtons.ShowIncrementButtons=false;prop.DisplayFormatInEditMode=true;prop.DecimalPlaces= 5;column.PropertiesEdit.DisplayFormatString="{0:C1}";column.Width=System.Web.UI.WebControls.Unit.Pixel(110);column.HeaderStyle.Wrap=DefaultBoolean.True;column.HeaderStyle.HorizontalAlign=HorizontalAlign.Center;});settings.Columns.Add(column=>{column.FieldName="YTDEarning";column.Caption="YTD P&L ($ millions)";column.Name="YTD P&L";column.ColumnType=MVCxGridViewColumnType.SpinEdit;varprop=(SpinEditProperties)column.PropertiesEdit;prop.SpinButtons.ShowIncrementButtons=false;prop.DisplayFormatInEditMode=true;prop.DecimalPlaces= 5;column.PropertiesEdit.DisplayFormatString="{0:C1}";column.Width=System.Web.UI.WebControls.Unit.Pixel(110);column.HeaderStyle.Wrap=DefaultBoolean.True;column.HeaderStyle.HorizontalAlign=HorizontalAlign.Center;});varlastNameChecked=string.Empty;NAVLimitItemlimitChecked=newNAVLimitItem();varlimitList=Model.Limits.ToList();for(varindex= 0;index<limitList.Count();index++){varlimit=limitList[index];vareventFrequencyName=((EventFrequencyEnum)limit.eventFrequencyId).ToString();varcalcDurationName=WellsFargo.Framework.StringEnumValue.GetStringValue((CalculationDurationEnum)limit.calculationDurationId);varnetAssetTypeName=WellsFargo.Framework.StringEnumValue.GetStringValue((FundNavTypeEnum)limit.navTypeId);varnavEventTypeName=WellsFargo.Framework.StringEnumValue.GetStringValue((NavEventTypeEnum)limit.navEventTypeId);varcolCaption=string.Format("{0} {1} - {2} {3} (%)",netAssetTypeName,eventFrequencyName,calcDurationName,navEventTypeName);varcol=settings.Columns.Add(limit.limitId.ToString(),colCaption);col.HeaderStyle.Wrap=DefaultBoolean.True;col.HeaderStyle.HorizontalAlign=HorizontalAlign.Center;col.PropertiesEdit.DisplayFormatString="{0:n2}%";col.UnboundType=DevExpress.Data.UnboundColumnType.Decimal;col.CellStyle.BackColor=System.Drawing.Color.Gainsboro;col.EditFormSettings.Visible=DefaultBoolean.False;col.Width=Unit.Pixel(180);}settings.CustomUnboundColumnData=(sender,e)=>{if(!e.Column.FieldName.Equals(lastNameChecked)){lastNameChecked=e.Column.FieldName;limitChecked=limitList.Where(t=>t.limitId.ToString().Equals(e.Column.FieldName)).First();}e.Value=Html.GetLimitPercentageChange(Model.Items,Model.Fund,e.ListSourceRowIndex,limitChecked);};settings.Columns.Add(column=>{column.FieldName="NAVPerShare_HistoryId";column.Width=Unit.Pixel(0);column.Name="hidden";});settings.Columns.Add(column=>{column.FieldName="NetAsset_HistoryId";column.Width=Unit.Pixel(0);column.Name="hidden";});settings.Columns.Add(column=>{column.FieldName="Subscription_HistoryId";column.Width=Unit.Pixel(0);column.Name="hidden";});settings.Columns.Add(column=>{column.FieldName="Redemption_HistoryId";column.Width=Unit.Pixel(0);column.Name="hidden";});settings.Columns.Add(column=>{column.FieldName="MonthlyReturn_HistoryId";column.Width=Unit.Pixel(0);column.Name="hidden";});settings.Columns.Add(column=>{column.FieldName="YTDEarning_HistoryId";column.Width=Unit.Pixel(0);column.Name="hidden";});settings.Columns.Add(column=>{column.FieldName="MonthlyEarning_HistoryId";column.Width=Unit.Pixel(0);column.Name="hidden";});settings.CustomColumnDisplayText=(s,e)=>{if(e.Column.FieldName.Equals("YTDEarning")||e.Column.FieldName.Equals("MonthlyEarning")){System.Globalization.CultureInfoculture=(System.Globalization.CultureInfo)System.Globalization.CultureInfo.CurrentCulture.Clone();culture.NumberFormat.CurrencyNegativePattern= 1;e.DisplayText=string.Format(culture,"{0:C1}",e.Value);}};});if(ViewData["EditError"]!=null){grid.SetEditErrorText((string)ViewData["EditError"]);}}@grid.Bind(Model.Items).GetHtml()<divid="HFchangesDialog"class="confirmChangesDiv"title="Confirm Changes"><fieldset><legend>NewAndEditedValues</legend><divclass="tableContainer"><tableid="newEditedTable"><thead><tr><th>Type</th><th>Year</th><th>Month</th><th>Column</th><th>CurrentValue</th><th>ProposedValue</th></tr></thead><tbody></tbody></table></div></fieldset><fieldsetid="deletedReturnHistories"><legend>DeletedValues</legend><divclass="tableContainer"><tableid="deletedTable"><thead><tr><th>Year</th><th>Month</th><th>Audit</th><th>NetAsset</th><th>Subscription</th><th>Redemption</th><th>NAVperShare</th><th>MonthlyReturn</th><th>YTDReturn</th><th>MonthlyP&L</th><th>YTDP&L</th></tr></thead><tbody></tbody></table></div></fieldset>@{if((FundStatusEnum)Model.Fund.StatusId==FundStatusEnum.Inactive){<p><spanstyle="color:red">NOTE:</span>Exceptionswillnotbeevaluatedbecause@Model.Fund.Nameiscurrentlysetto:INACTIVE</p>}}</div><divid="HFvalidationDialog"class="confirmChangesDiv"title="Duplicated Values"><divclass="tableContainer"><tableid="repeatedTable"><thead><tr><th>Type</th><th>Year</th><th>Month</th></tr></thead><tbody></tbody></table></div></div><divid="HFExceptionsDialog"class="confirmChangesDiv"title="Potential Exceptions"><fieldset><legend>Thefollowingexceptionswillbegenerated</legend><divclass="tableContainer"><tableid="exceptionsTable"><thead><tr><th>Fund</th><th>NavType</th><th>NavEvent</th><th>Frequency</th><th>LimitValue</th><th>BreachValue</th><th>BreachMonth</th><th>BreachYear</th></tr></thead><tbody></tbody></table></div></fieldset></div>

 event. It does not allow me to edit any of my grid cells.
Please find below the code partial view.

How to customize PDF Viewer Ribbon

$
0
0

The following example shows how to customize PDF Viewer Ribbon.

To accomplish this task, it is necessary to override the default PdfViewerControl's RibbonTemplate and add the required bar items to the newly defined RibbonControl.

Updated

Starting with version 14.1.5, you can use actions instead of modifying the template to customize the PdfViewerControl's Ribbon.

Question Comments

Added By: Daniel FS at: 1/15/2015 9:12:39 AM    

Hi,

It seems that in this example you are adding a custom button (MainWindow.xaml.vb):

Private Sub bCustomItem_ItemClick(ByVal sender As Object, ByVal e As DevExpress.Xpf.Bars.ItemClickEventArgs)
           Dim w As New WinUIDialogWindow()
           w.Content = "Hello world!"
           w.ShowDialogWindow(MessageBoxButton.YesNo)
End Sub

But I can't see how it is declared (in MainWindow.xaml it doesn't appear).
How can I add a custom button?
Thanks.

Daniel.

Added By: Andrey Marten (DevExpress Support) at: 1/15/2015 1:09:40 PM    


Hello,

To process your recent post more efficiently, I created a separate ticket on your behalf: T197322: How to add a custom button to the PDF Viewer Ribbon. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Thanks,
Andrey

Added By: Eric A at: 4/8/2016 10:21:55 AM    How can I hide the PdfViewer RibbonControl ApplicationButton and collapse the title bar?

ie Equivalent to this:
[XAML]
<dxr:RibbonControlRibbonStyle="Office2010"ShowApplicationButton="False"RibbonTitleBarVisibility="Collapsed"/>

Added By: Elliot (DevExpress Support) at: 4/8/2016 10:25:51 AM    

Hello,

To process your recent post more efficiently, I created a separate ticket on your behalf: T365839: How can I hide the PdfViewer RibbonControl ApplicationButton and collapse the title bar? . This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

How to create a DiagramShape descendant and serialize its properties

$
0
0
This example demonstrates how to serialize custom data using DiagramControl's serialization mechanism. In the example, the Content property of diagram shapes is loaded from data objects every time the diagram is shown. To associate shapes with data objects, the DatabaseObjectID property is added at the DiagramShape descendant level. To serialize this property along with standard DiagramShape properties, perform the following steps:

Note:
In certain scenarios, it is easier to use the DiagramShape.Tag property to store custom data without creating DiagramShape descendants. In this case, no further steps are needed as the Tag property is serialized by default.

1) Mark your custom property with the XtraSerializableProperty attribute:
[C#]
[Browsable(false),XtraSerializableProperty]publicintDatabaseObjectID{get;set;}
Set the Browsable(false) attribute if you don't want to display your custom property in DiagramControl's property editor.

2) Call the ItemTypeRegistrator.Register method to register your custom shape type for serialization:
[C#]
DiagramControl.ItemTypeRegistrator.Register(typeof(DiagramShapeEx));

Data Source Wizard - How to customize the list of data providers

$
0
0

This example demonstrates how to modify the list of data providers available on the connection parameters configuration page of the Data Source Wizard when customizing the Data Source Wizard by implementing the IWizardCustomizationService interface.

To obtain the list of available data providers from the internal service container, use the IWizardCustomization.Resolve method. You can delete elements from this list to remove undesired data providers, as well as append new elements to add custom data providers. In this example, all default data providers are removed from the list and a custom provider is added.

For a custom data provider, specify the connection parameters strategy. The connection parameters strategy is represented by an object implementing the IConnectionParametersStrategy interface and defines which connection settings are required by a data provider, how user input for these settings is handled on the connection parameters configuration page of the Data Source Wizard, as well as how a data source object is created based on these settings.

For a general code example on how to customize the Data Source Wizard using the IWizardCustomizationService interface, see How to customize the New Report Wizard (introduced in the 2014 vol.1 release) in the End-User Designer.

How to repeat the Detail report band multiple times (a data-bound report)

$
0
0
If your report's data source is empty or not defined, you can specify how many times the Detail band content is printed through the XtraReport.PrintOptions.DetailCountOnEmptyDataSource property.

If a report is data bound, you can limit the number of times the Detail band is printed by using the DetailCount property.

Please note that the DetailCount property is designed to specify the maximum number (i.e., the limit) of times the Detail band is printed. In other words, if a data source contains one record, we cannot print it more than one time by using the DetailCount property.
We need to use the solution illustrated by this example. It demonstrates how to repeat a data source record depending on a value taken from another field. To achieve this, add an unbound DetailReportBand and control the number of copies using its ReportPrintOptions.DetailCountOnEmptyDataSource property.

See also: 
How to print DetailBand a particular amount of times irregardless of the number of records in a report datasource

How to load a dashboard at runtime to an MVC DashboardViewer


How to use the jQuery.ajax function with DevExpress MVC Extensions

$
0
0

This example demonstrates how you can use the jQuery.ajax function to load a GridView on a callback.
Note that this feature has been implemented in the 12.1 version, so it is not available in earlier versions. For older versions, you can use a solution demonstrated in the How to load MVC extensions using the CallbackPanel extension example.

Question Comments

Added By: Eldeniz Kurban at: 4/11/2016 6:04:09 AM    Hi,
This sample is working on chrome but  cannot working on firefox. 
For example, aspxGVCollapseRow function cannot working on firefox

How to dynamically build a persistent class from a DataSet and then bind it to the GridControl

$
0
0

This example is a variation of How to generate persistent classes at runtime based on a dataset with the difference that here we create a custom XPClassInfo class that provides metadata information for a type.
Then, we will use it to bind the GridControl to the XPServerCollectionSource, that is necessary to work in the Server Mode.

Question Comments

Added By: bbirbo at: 4/11/2016 8:21:06 AM    Is there any chance to modify this code so it runs with any sql statement like JOINS etc ?Added By: Andrew L (DevExpress Support) at: 4/12/2016 3:03:33 AM    

Hello,

I've created a separate ticket on your behalf (T366772: It is possible to use the approach described in E1729 so it runs with any sql statement like JOINS). It has been placed in our processing queue and will be answered shortly.

How to provide custom summary values for Total, Grand Total and ordinary cells

$
0
0

This example is made using the ASPxPivotGrid control. This approach can be used with XtraPivotGrid and DXPivotGrid controls. When the CustomSummary event is used to provide custom values for only Total or Grand Total cells, you can use the PivotGridCustomSummaryEventArgs.ColumnField and PivotGridCustomSummaryEventArgs.RowField properties to determine the kind of a processed cell. You can use the following rules to determine that a cell is being processed:

1. If ColumnField or RowField is null, it means that this is a Grand Total cell;
2. If both ColumnField and RowField are last fields in a corresponding area, this means that this is an ordinary cell.
3. In other cases, this is a Total cell.

See Also:
T158425: How to calculate Total cell values based on the low level Сell summary values   

Question Comments

Added By: Eurofins Lancaster Labs at: 10/12/2012 10:16:06 AM    

How can we override the bottom right grand total (total of grand totals)?

Added By: Eurofins Lancaster Labs at: 10/12/2012 11:17:42 AM    

Nevermind, I just had to loop through the items in the drill down data source.

HtmlEditor in ASPxGridView

$
0
0

This example illustrates how to use the ASPxHtmlEditor control in the ASPxGridView EditForm for editing text column data.

The ASPxHtmlEditor is defined within the ASPxGridView EditFormTemplate and bound with the "DescriptionHtml" column via the binding expression (the "Eval" method).
When using the "Eval" expression, it is necessary to capture the modified value/property and post it back to a datasource manually. See the Default.aspx.cs/Default.aspx.vb code behind source.

If you need to achieve the automatic Two-Way data binding functionality, use the "Bind" method instead of the "Eval" one.
In this case, the server-side code for retrieving the editor value (the ASPxHtmlEditor.Html property) and putting it into the e.NewValues dictionary is no longer required (except of cases described in the K18564: How to resolve issues with binding expressions #1 KB Article).

In addition, take a look at the online Two-Way Binding demo. It illustrates how to use different kinds of editors in a similar scenario.

Question Comments

Added By: zia jadoon at: 4/12/2016 4:47:26 AM    Code .aspx and .cs files are missing at this https://www.devexpress.com/Support/Center/CodeCentral/ViewExample.aspx?exampleId=E296 Link.

dxDataGrid - How to fix column headers related to page scrolling

How to use an unbound check box column to select grid rows

$
0
0

From version 13.2, the GridView in the XtraGrid control provides a built-in checkbox column for multiple row selection.
This feature is demonstrated in the example that targets version 13.2. Additional information can be found in the following topic: Multiple Row Selection via Built-In Check Column

If you are using an earlier version of DevExpress controls, see the attached example that targets this earlier version.
This example demonstrates a method to manually create a check column for row selection. The example is similar to the one from the A371 article. The difference is that this example employs the grid's built-in multi-selection and keeps it in sync with the check boxes. All code related to selection is placed into the GridCheckMarksSelection helper class, so it should be easy to port this functionality to your application.
Please note if you use the AppearanceEvenRow and AppearanceOddRow styles, by default they have a higher priority than the RowStyle event used for the selection in this example. To avoid drawing incorrect selected rows, enable the e.HighPriority option. See Also: E1271

Question Comments

Added By: Marco Villasesr at: 2/2/2014 8:31:14 AM    

Could you please attach a sample Project, please? thank you!!

Added By: david ola at: 12/17/2015 5:18:30 AM    

How do you respond to the selection change event? I needed to populate another grid based on the number of rows selected in my gridcontrol. Everything works well until no rows were selected. At that time, the SelectionChange event did not work. The other grid should be cleared when selectionCount become zero in my original gridcontrol, but it still displays the contents as if SelectionCount =1.
Is that a bug?

Added By: Nadezhda (DevExpress Support) at: 12/17/2015 12:43:08 PM    

Hello,

Before I suggest a solution, I need to know which approach you use. Do you utilize the GridCheckMarksSelection helper class or the CheckBoxRowSelect select mode?

I look forward to hearing from you.

How to bind the CheckedCombobBoxEdit to a collection property

$
0
0

The CheckedComboBoxEdit editor can be bound to a property of the string type only. To bind it to a collection properly, declare an auxiliary string property that can be used for binding. In addition, this property will work as a converter. It will convert the collection to a string value and vice versa.


ASPxGridView - How to correct the column layout if column widths are set in percentages and the grid is grouped

$
0
0

This example illustrates the solution for the first issue described at ASPxGridView - Why column layout may become broken after user actions if certain column widths are set in percentages
The main idea is to determine the widest column and delete its setting. As a result, the widest column will fill the space that appears after moving one of the columns to the Group panel. 
For this, we implemented the GridViewColumnHelper class and use ASPxHiddenField to preserve information about column width between requests to the server. 

How to use XtraSpellChecker in XAF

$
0
0

Scenario
This example demonstrates how to incorporate the XtraSpellChecker to XAF applications.

Steps to implement
1. Copy the Spelling.Win project into your solution and build it;

2. Invoke the Application Designer for your executable WinForms project (YourSolutionName.Win) or the Module Designer for your WinForms module project (YourSolutionName.Module.Win) and open the Toolbox (Control+Alt+X);
3. Drag the SpellingWindowsFormsModule item from the Toolbox;
4. Build and run your project.

Important notes
If you are using RichEditControl, check out the Adding Richedit to Sample E736 thread for additional configuration.


UPDATED by Dennis:

Here you can download an improved version of the original example that illustrates another variant of integrating WinForms SpellChecker and ASP.NET WebForms ASPxSpellChecker components in XAF.
My attachment contains three custom XAF extra modules I developed + a small demo project to help you check what is done and how this works. 
Note that this is not a complete solution by any means, but just an example that demonstrates certain integration scenarios to help you implement a spell checking functionality in your end application. There may be issues, so feel free to research, test and modify the source code of these modules to better meet your business needs. I look forward to any feedback on these modules if you find any issues or have further suggestions.

Question Comments

Added By: Louis Z at: 5/15/2014 8:04:47 AM    

1. Copy the Spelling.Win project into your solution and build it;
2. Invoke the Application Designer for your executable project and open the Toolbox (Control+Alt+X);
3. Drag the SpellingWindowsFormsModule item from the Toolbox;
4. Build and run your project.

Added By: Tony Tadros at: 1/15/2015 9:53:11 AM    

Hello Devexpress ,this example is not working anymore ,do you have any update

Added By: Dennis (DevExpress Support) at: 1/16/2015 8:27:34 AM    

Hello,

To process your recent post more efficiently, I created a separate ticket on your behalf: T197752: SpellChecker integration in XAF 14.2. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.



Added By: Luke Kenyon 1 at: 9/24/2015 12:39:10 AM    

Hi, I just downloaded this and applied it to my project after converting the projects to the latest version. I did notice that it has added 2 button items to the menu for spell checking other than that it does the job which has saved me some time thanks.
Cheers Luke

Added By: Dennis (DevExpress Support) at: 9/24/2015 3:16:16 AM    @Luke: Thanks for taking your time to test this solution in your project and share your feedback with us. This module also adds a corresponding button in the toolbar for checking the whole form.Added By: Hein Kramer at: 4/13/2016 1:28:22 AM    Hi, we used the example from Dennis in our XAF project and worked great! Now after upgrading to DX 15.2.9 the following error occures after closing a view.

System.NullReferenceException: De objectverwijzing is niet op een exemplaar van een object ingesteld.   bij DevExpress.XtraSpellChecker.Native.FormFocusSpy.CanCheckControl(Control control)   bij DevExpress.XtraSpellChecker.Native.FormFocusSpy.ProcessContainerControlsRecursive(Control container, IControlVisitor visitor)   bij DevExpress.XtraSpellChecker.Native.FormFocusSpy.OnContainerDisposed(Object sender, EventArgs e)   bij System.EventHandler.Invoke(Object sender, EventArgs e)   bij System.ComponentModel.Component.Dispose(Boolean disposing)   bij System.Windows.Forms.Control.Dispose(Boolean disposing)   bij System.Windows.Forms.Form.Dispose(Boolean disposing)   bij DevExpress.XtraEditors.XtraForm.Dispose(Boolean disposing)   bij DevExpress.ExpressApp.Win.Templates.XtraFormTemplateBase.Dispose(Boolean disposing)   bij System.ComponentModel.Component.Dispose()   bij DevExpress.XtraBars.Docking2010.Views.BaseDocument.ReleaseControl()   bij DevExpress.XtraBars.Docking2010.Views.BaseDocument.OnDispose()   bij DevExpress.XtraBars.Docking2010.Views.Tabbed.Document.OnDispose()   bij DevExpress.XtraBars.Docking2010.Base.BaseComponent.Dispose(Boolean disposing)   bij System.ComponentModel.Component.Dispose()   bij System.ComponentModel.Container.Dispose(Boolean disposing)   bij System.ComponentModel.Container.Dispose()   bij DevExpress.ExpressApp.Win.Templates.MainForm.Dispose(Boolean disposing)   bij System.Windows.Forms.Form.WmClose(Message& m)   bij DevExpress.XtraEditors.XtraForm.WndProc(Message& msg)   bij DevExpress.ExpressApp.Win.Templates.XtraFormTemplateBase.WndProc(Message& msg)   bij System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Now I disabled the Dispose action in ReleaseSpellChecker() to prevent this error.
But this is a work-around and not a solution. 

private void ReleaseSpellChecker() {            if(SpellCheckerComponent is IDisposable) {                ((IDisposable)SpellCheckerComponent).Dispose();                SpellCheckerComponent = null;            }        }
It seems to be that some events changed in the DevExpress.XtraSpellChecker.SpellChecker and the internally used FormSpy infecting the dispose events...

OBSOLETE - GridView - How to implement date range filtering using a custom editor in the AutoFilterRow

$
0
0

UPDATED:

Starting with version v2015 vol 2 (v15.2), this functionality is available out of the box. Simply set the MVCxGridViewColumn.SettingsHeaderFilter.Mode property to DateRangePicker to activate it. Please refer to the ASP.NET Grid View - Data Range Filter, Adaptivity and More (Coming soon in v15.2) blog post and the Date Range Header Filter demo for more information.
If you have version v15.2+ available, consider using the built-in functionality instead of the approach detailed below.


For Older Versions:

This example demonstrates how to implement date range filtering in the GridView extension.
Use the MVCxGridViewColumn.SetFilterTemplateContent  method to create a custom editor and assign a delegate method to the GridViewSettings.ProcessColumnAutoFilter property to process a custom filter expression sent from the client side.

See Also:
E1990: OBSOLETE - Date Range Filtering in the Filter Row

Question Comments

Added By: Gustavo Sainz at: 11/11/2014 11:08:43 AM    

I can't make it to work, as the ProcessColumnAutoFilter does not trigger when settings the grid to use

 settings.CustomBindingRouteValuesCollection.Add(GridViewOperationType.Filtering, new { Controller = "ViewDate", Action = "AdvancedCustomBindingFilteringAction", key = "-1" });

Any idea how to resolve this?

Added By: Vladimir (DevExpress Support) at: 11/11/2014 10:25:08 PM    

Hello,

To process your recent post more efficiently, I created a separate ticket on your behalf: T171947: The ProcessColumnAutoFilter does not trigger. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Added By: Don Krasnick at: 1/21/2016 10:20:56 AM    

I've implemented this technique in our solution and it seems to basically work. The user's current selections are displayed in the EndCallback function via "dde.SetText". However, when the user manually clears out those values I would like the custom filtering to be removed, which is the same behavior for a "normal" field. I'd also like to allow the user to type a date range in their manually ("03/01/2015|04/01/2015") and have the same affect as though those dates were selected via the calendar popup.

How can I get that to happen? I haven't been able to figure out what event(s) should be captured. Having the user manually enter dates isn't critical, but we'd definitely like to be able to have those cleared values reset the filtering for the column.

Note that we haven't yet upgraded to v2015, so we're looking for a v2014 solution, if possible.

Added By: Artem (DevExpress Support) at: 1/22/2016 4:31:27 AM    

Hello Don,

To process your recent post more efficiently, I created a separate ticket on your behalf: T337328: Improve date range filtering example. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Added By: Michael Yasieniuk at: 4/13/2016 12:13:09 AM    Hello 

I am using dll verision v14.1 and I don't see 'SetFilterTemplateContent' in column variable.

I am coding the setting in c# not Razor and want to make this date range filter.

That is the column I am trying to add a template for

GridViewDataColumn newcolumn = settings.Columns.Add(Model.ReportParameters.SelectedCategoryProperties[i].Name);                newcolumn.Settings.FilterMode = ColumnFilterMode.DisplayText;

Any idea why I don't see it ? or is there another way ?
Added By: Artem (DevExpress Support) at: 4/13/2016 1:31:49 AM    

Hello Michael,

Thanks for contacting us. I've created a separate ticket on your behalf (T367211: The SetFilterTemplateContent method isn't available for GridViewDataColumn). It has been placed in our processing queue and will be answered shortly.

How to remove standard bar items and add custom ones to the DocumentViewer toolbar

How to highlight the next or previous search result in the grid

$
0
0

This example demonstrates how to implement a search functionality like in Opera using the ButtonEdit editor.




To use this solution in your application, execute the following steps:

1. Drop the FindHelper component onto the target form.
2. Assign a GridControl to the FindHelper.TargetControl property.
3. Assign a required repository item  to the helper's SearchControl property.




Viewing all 7205 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>