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

How to enable users to design PivotGridControl format conditions at runtime

$
0
0

This example demonstrates how to customize conditions at runtime. It uses the same approach as the one utilized in the How to enable users to design GridView format conditions at runtime sample, but adapted for the PivotGridControl. There are two additional buttons in PivotGridControl's context menu. They are used to create simple format conditions and conditions with expressions.


How to add an embedded DataNavigator to GridControl via an attached behavior

$
0
0

This example demonstrates how to implement WinForms DataNavigator in WPF via Behavior. For this, it's necessary to re-define the x:Key="{dxgt:TableViewThemeKey ResourceKey=ScrollViewerTemplate}" control template and create the DataNavigator behavior that loads a re-defined template at the moment of attaching.

If you are using themes, you need to re-define a control template for your theme and add it's name to the key - x:Key="{dxgt:TableViewThemeKey ResourceKey=ScrollViewerTemplate, ThemeName=DXStyle}"

Question Comments

Added By: Corentin Fougeray at: 8/28/2014 6:09:13 AM    

Hello,

I've been using this solution for our new project. It is satisfying as a workaround but not for production : what about the other themes you provide ? I don't know their innards (and I don't want to), so what about their templates for this ?

I've tested with DeepBlue for instance (replacing DXStyle by DeepBlue in Dictionary.xaml) and it doesn't work (no navigator displayed). With Office2010Blue it works but the First/Last buttons aren't coherent (not the same glyph, maybe a problem of this theme).

And what about the position of this embedded navigator ? It is above the total summary panel which is a very awkward place ! Not mentioning that your workaround doesn't display anything in design-mode which is not very convenient...

Anyway, you should provide an embedded navigator with your WPF grid (as you did with de WinForms one which is very satisfying and heavily used in our other projects), not a messy workaround which requires the developers to customize your component's innards in order to get such a basic feature !

Added By: Alexander Rus (DevExpress Support) at: 8/28/2014 9:01:32 AM    

Hello Corentin,
To process your recent post more efficiently, I created a separate ticket on your behalf: T145168: Different themes support in E4347. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Thanks,
Alexander

A master-detail grid with editing capabilities with XPO data

$
0
0

This example demonstrates the ASPxGridView and eXpress Persistent Objects collaboration in a Master-Detail scenario.

Question Comments

Added By: Paul.Astramowicz@thyssenkrupp.com Paul.Astramowicz@thyssenkrupp.com at: 8/28/2014 7:14:46 AM    

Will this ASPxGridView setup work with the latest Version of Dev Express?  Version=14.1.5.0

Added By: Larry (DevExpress Support) at: 8/28/2014 10:41:20 AM    Hello,

Yes, this example works correctly in version 14.1.5. 

How to merge cells in the GridControl

$
0
0

This example demonstrates how to achieve the merged cells effect in the GridControl. The main idea consists of stretching the top merged cell and showing it over other merged cells. For this purpose, the Panel.ZIndex and Margin properties are used.

Please take special note that this example doesn't support editing cells. This example is designed for the DeepBlue theme and may need to be modified if you wish to use it in other themes.

Question Comments

Added By: AKN at: 8/28/2014 9:42:57 AM    

Hi, Can you please give me sample code to merge cells across the row instead of column?

Added By: Alexander Rus (DevExpress Support) at: 8/28/2014 12:29:00 PM    

Hello,
To process your recent post more efficiently, I created a separate ticket on your behalf: T145231: Merge cells in different columns. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Thanks,
Alexander

How to align a RibbonPageGroup to the right side of a page?

$
0
0

This example demonstrates how to create a custom RibbonControl that displays a group with the "AlignRight" tag assigned at the right side.

Updated:

The example was slightly modified to dispose of a gap which occurs after merging (see  Support correct RibbonPageGroups alignment with no gap on ribbon merging).
To enable correct operation, a RibbonPanelComplexLayoutCalculator descendant was created, and the UpdatePanelLayout method was overridden in it.

Question Comments

Added By: Andri at: 9/9/2013 2:02:47 PM    

Hi do you have a fix for this if there are more than one group on the right side ?

Added By: Jan Macháček at: 8/29/2014 2:16:41 AM    

thank you so much for this code :)
really helped me a lot

How to: Use WinUIMessageBoxService

$
0
0
This example demonstrates how to use WinUIMessageBoxService

How to display a custom field value in a custom appointment template

$
0
0

This example illustrates how to display a custom appointment field value (see How to: Create a Custom Field for an Appointment) in the appointment rectangle. We override the appointment template for this purpose in the following manner:

[XAML]
<DataTemplatex:Key="{dxscht:SchedulerViewThemeKey ResourceKey=VerticalAppointmentContentTemplate}"><GridSnapsToDevicePixels="True"HorizontalAlignment="Stretch"VerticalAlignment="Stretch"Background="Transparent"> ... <TextBlockText="{Binding CustomViewInfo.Price, StringFormat={}{0:C2}}"Foreground="Red"TextTrimming="CharacterEllipsis"/> ... </Grid></DataTemplate>

To pass a custom field value via the CustomViewInfo, handle the SchedulerControl.AppointmentViewInfoCustomizing Event as follows:

[C#]
privatevoidschedulerControl1_AppointmentViewInfoCustomizing(objectsender,AppointmentViewInfoCustomizingEventArgse){CustomAppointmentDatacad=newCustomAppointmentData();objectprice=e.ViewInfo.Appointment.CustomFields["cfPrice"];if(price!=null&&price!=DBNull.Value)cad.Price=Convert.ToDecimal(price);e.ViewInfo.CustomViewInfo=cad;}

The CustomAppointmentData class is defined as follows:

[C#]
publicclassCustomAppointmentData:DependencyObject{publicstaticreadonlyDependencyPropertyPriceProperty=DependencyProperty.Register("Price",typeof(decimal),typeof(CustomAppointmentData),newPropertyMetadata(0m));publicdecimalPrice{get{return(decimal)GetValue(PriceProperty);}set{SetValue(PriceProperty,value);}}}

Note that this approach is also used in the "Appointment Customization" demo module (see Demos in Installation). In addition, the HorizontalAppointmentContentTemplate in this demo is customized. It affects the appointment appearance in views other than Day and Work Week.

Here is a screenshot that illustrates a sample application in action:

See Also:

How to display custom tooltips for appointments, resource headers and date headers

Question Comments

Added By: Cliff Knasinski at: 8/29/2014 8:48:47 AM    

How do you bind a custom Field that is a list type?

I am trying to bind a list of LINQ records from a data table to a Custom field like below.  The second line is trying to set the ItemsSource to a list box in a Custom Appointment Form.

<dxsch:SchedulerCustomFieldMapping Member="Appointment.EmpAppHours" Name="EmpAppHours"/>

<ListBox Name="lbEmpHours" Grid.Row="6" Margin="1,1,0,8" MaxHeight="100" Height="Auto" Grid.Column="1" ItemsSource="{Binding CustomFields[EmpAppHours]}" DisplayMemberPath="Caption" MinHeight="22"/>

How to: Use DialogService

$
0
0
This example demonstrates how you can use the DialogService

How to export an XtraReport document to DOC, DOCX and ODT file formats

$
0
0

While there is no built-in capability to export documents created by XtraReport to *.doc, *.docx or *.odt file formats, you can accomplish this task by means of the RichEditDocumentServer .

The attached sample illustrates how to add custom bar items to the File Export drop down menu and export a report to these file formats using the RichEditDocumentServer.

Question Comments

Added By: Craig la Buscagne 1 at: 2/22/2013 10:50:04 AM    

Do you perchance have an example of this in VB.NET ?

Thanks

Added By: Anastasius at: 2/25/2013 5:42:00 AM    

If i use the RichEditDocumentServer, i lose all PageHeaders. Because you export it als html (only "one" page header) and import it again.

If i export it as rtf, and import it in your RichEditDocumentServer i lose all formats and text "positions" (Formating).

Any idea how i can export and import the XtraReport an also the nessesary Page headers?

Added By: Amrit Singh 1 at: 10/21/2013 11:45:19 AM    

Hi --

Is there an answer for Anastasius's question because I've just boarded the boat he is in. According to the logic you've mentioned below in your solution, You're first exporting the report to html and then saving it as doc or docx which generates the data correctly but I get only one table for all the sections in a report. I want different headers(tables) so I could later modify(add/delete columns and rows in separate tables in separate sections) them per my needs . That was the whole requirement behind needing a report export to doc and docx. Please suggest a solution and also please let me know when DevExpress is coming up with an integrated export to Doc and export to Docx features? In which release? Because that would eliminate lots of code in my application.

Thanks Much
Amrit Singh

Added By: Fabien GUILLEBERT at: 10/30/2013 8:33:15 AM    

Hello,
This works for ShowPreviewDialog but how the ShowRibbonPreview for RibbonControl in an MDI window?

Thank you for your help.

Added By: Anders Wang at: 8/22/2014 7:22:08 PM    

For simple Report, It is ok. But the problem for report have many tables, after use this way the layout are not acceptable.  We see many persons here posted this kind of request for many years. We all know that doc is MS private format. It is difficult to do that. But for docx, it is open standard and published by ms in 2006, they have open sdk. There're also many opensource ooxml library. Is it possible to implement docx first? Many other reporting tools,eg, fastreport,activereport,txcontrol,aspose,ssrs already have this functionality. Could you please take this into account? Thanks a lot for your great help.

Added By: Ingvar (DevExpress Support) at: 8/25/2014 2:09:14 AM    Hi Anders,

As you know, we are keeping to the WYSIWYG concept, which cannot be properly achieved using OpenXML definition in certain circumstances. We do understand that this is a "must have" export format, but I cannot give you any promises right now.

I want to thank you for your feedback. We greatly appreciate it.Added By: Anders Wang at: 8/29/2014 8:15:21 PM    

Hi,
I think not all the certain circumstances  you said will be a problem for all of users of this product. So, Please just go ahead first. Of course, you are keeping to WYSIWYG concept, But not all of us need it, i also see you said WYSIWYG concept for a long time. But it is not the one what we needed at current and there 're also many places need to be improved before its popular and been accepted. Currently, no any WYSIWYG product can meet my company's requirement for reporting in the market. All of  our complex testing/inspection report is generated by pure code. Because the format is so complex. I see this feature were requested so many years by users here. Why you guys can ignore it year by year. Each time the answer is no immediate plan or estimated time to implement it. We all really appreciate your carefully consideration about the voices of us.

Thanks a lot for your great help.

ASPxGridView - How to show the number of selected rows in the Pager bar

$
0
0

This example demonstrates how to show the number of selected rows in the Pager bar. It is necessary to create a custom PagerBar template for this purpose. This template will contain ASPxLabel that allows showing the number of selected rows and a standard pager created via the ASPxGridViewTemplateReplacement control:

[ASPx]
<PagerBar><table><tr><td><dx:ASPxGridViewTemplateReplacementrunat="server"ReplacementType="Pager"/></td><td><dx:ASPxLabelID="labelInfo"runat="server"Text=""ClientInstanceName="labelInfo"></dx:ASPxLabel></td></tr></table></PagerBar>

We can get the grid's selected row count via the client-side ASPxClientGridView.GetSelectedRowCount method and then set it to ASPxLabel using the label's SetText method:

[JScript]
function ShowRowsCount(){ labelInfo.SetText('Selected rows count: ' + gridView.GetSelectedRowCount());}
Question Comments

Added By: Patrick Saunders at: 8/30/2014 9:14:10 PM    

From here:
http://stackoverflow.com/questions/7808230/devexpress-how-do-get-an-instance-of-a-control-client-side-and-access-its-clien

Make sure to set the clientInstanceName, this caught me out for a while, you will get Javascript referrence errors.

How to show the ASPxLoadingPanel while the content is loading inside the ASPxPopupControl

$
0
0

If a content of the ASPxPopupControl is loaded slowly, you can show a loading panel reflecting this process.

Question Comments

Added By: alberto.piazza at: 6/21/2013 2:22:48 AM    

Interesting.
I noticed that however, if the popup is moved the loading panel doesn't follow it.
I wonder if this approach could be implemented directly in the popupcontrol in future versions.

Added By: girish tangella at: 8/31/2014 9:47:14 PM    

Hello,

I have tried this method in my code. I have a grid with many hyperlinks. When I click on the hyperlink, a popup should be visible with loading. It works well for the first time when I click on hyperlink. But when i click on the hyperlink for the second time, loading does not stop all. Can you please provide me the solution for this issue.

Added By: Mike (DevExpress Support) at: 8/31/2014 9:52:14 PM    

Hello Girish,

To process your recent post more efficiently, I created a separate ticket on your behalf: T145875: E1945 - ASPxPopupControl - LoadingPanel is not hidden on second shown. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

How to open an external Page in a Splitter Pane

$
0
0

This example is an illustration of the KA18732: How to open external Page / View in a Splitter Pane KB Article. Refer to the Article for an explanation.
It demonstrates how to open an external Page in a Splitter Pane using navigation extensions.


Set the pane's ContentUrl property to "about:blank". This will render the pane as an iframe.

In addition, set the pane's ContentUrlIFrameName property. This will be the target to open links from the navigation extensions items. Thus, any item's Target property should be equal to the pane's ContentUrlIFrameName property.


pane.ContentUrl = "about:blank";

pane.ContentUrlIFrameName = "NavigationIframe";


Different approaches can be used to set the Target property:
- Item level;

- Extension level;

- Datasource level.

How to update a master grid and all its detail grids operating in Batch Edit mode simultaneously

$
0
0

It's necessary to perform the following steps to accomplish this task:


1) Hide built-in command buttons using the CommandButtonInitialize event and create custom ones;
2) Handle the client-side DetailRowCollapsing , DetailRowExpanding events to track what detail grids are currently expanded; 
3) Use the master grid's custom callback (the client-side PerformCallback method) to update all grids simultaneously on the server side;
4) Use the BatchEditConfirmShowing event to avoid losing changes in detail grids on an external callback;
5) Handle the server-side CustomCallback event to get all detail grids using the FindDetailRowTemplateControl method and update them using the UpdateEdit method.

The attached example illustrates how to implement all these steps. 

How to emulate an editable GridLookUpEdit with PopupContainerEdit

$
0
0

This example illustrates how to implement an analog of GridLookUpEdit that allows editing of GridControl data. The following approach is used: create a PopupContainerEdit, assign a panel to PopupContainerControl by setting the PopupContainerEdit.Properties.PopupControl property and then add GridControl to it. For synchronizing PopupContainerEdit's value and display text with the state of controls residing within the popup window the PopupContainerEdit.QueryResultValue and PopupContainerEdit.QueryDisplayText events were used.

Question Comments

Added By: Thomas Ferdinand at: 4/2/2014 7:40:08 AM    

Hi,
there is a problem: If you edit a value (fruit) and click outside the grid, the popup is corectly closed but the edited value is not applied.
Any ideas how to fix this?

Best regards, Tom

Added By: Andrew Ser (DevExpress Support) at: 9/2/2014 12:51:24 AM    Hi,
Please post the edited value via the GridView.PostEditor method in the popupContainerEdit1_QueryResultValue event handler:
[C#]
voidpopupContainerEdit1_QueryResultValue(objectsender,DevExpress.XtraEditors.Controls.QueryResultValueEventArgse){gridView1.PostEditor();e.Value=gridView1.GetFocusedRowCellValue("Fruit");}
Feel free to contact us if you have any questions.

How to save and restore layouts of floating documents residing within DocumentsHost

$
0
0

When you set the BaseView.FloatingDocumentContainer property to DocumentsHost, floating documents are hosted within a container to which other documents can be docked. Thus, this floating container contains its own DocumentManager. As a result, if you wish to save layouts of floating documents residing within such a floating container, you need to access their own DocumentManagers. You can do this in the BaseView.RegisterDocumentsHostWindow event handler. Finally, obtain a corresponding View via the DocumentManager.View property, and use its BaseView.SaveLayoutToXml and BaseView.RestoreLayoutFromXml or BaseView.SaveLayoutToStream and BaseView.RestoreLayoutFromStream methods. 

This example illustrates how to collect all the Views associated with floating containers, and save and restore their layouts. In short, we create a list of Views where we add a new View in the BaseView.RegisterDocumentsHostWindow event handler. We also delete a View after its floating container is destroyed in the BaseView.UnregisterDocumentsHostWindow event handler. 


Lesson 6 - Multi-level navigation in MVPVM applications

How to round corners for a skinned XtraForm/RibbonForm

$
0
0

Use the DevExpress.Utils.Drawing.Helpers.NativeMethods.CreateRoundRegion method. The only difference between the XtraForm that
uses this method and the RibbonForm is that these forms use different skin images. See RibbonForm skin elements whose corners
are rounded. However, the XtraForm skin borders are square. It's impossible to create absolutely correct rounded corners for
the XtraForm without creating a custom skin.

Question Comments

Added By: Rodney Brim at: 8/28/2012 8:43:08 AM    

Thanks for your help. One thing I didn't see, is how to go about creating a shadow with the form, I need to add a shadow at the bottom and right sides of the form.
Thanks for sharing that as well.

Rodney

Added By: Jens Abromeit 1 at: 9/25/2012 11:03:19 PM    

Compiling this examples with v2012 vol 1.7 leads to an error that the method GetDefaultFormRegion cannot be overwritten because it does not exist in FormPainter. Is this method removed or replaced by some other mechanism in v2012 vol 1.7?

Added By: John (DevExpress Support) at: 9/28/2012 4:47:52 AM    

We have changed the Form painting mechanism with version 12.1.7, so, the GetDefaultFormRegion method does not exit in FormPainter now. However, we will add it back with the next release.

How to embed a barcode into a document

$
0
0

This sample shows how to embed a barcode into a document using a custom field {BRCODE}

Notes:
This example is intended for early adopters.

Starting from DXperience v2012.1 you are advised to use our new product - SnapTM by DevExpress. Snap enables you to include a bar code or a chart in your document. Please review the How to: Create a Report with a Chart document for more information.

Question Comments

Added By: Anders Wang at: 9/3/2014 1:59:46 AM    

Hi,
Cannot compile.

Error 13 The type or namespace name 'RichEditImage' could not be found (are you missing a using directive or an assembly reference?) D:\Downloads\E20025_CS\RichEdit_BarCode_CS\Extensions\Chart\ChartImage.cs 158 16 BizPad

In addition, This example is intended for early adopters. for now,  how to insert barcode by code at runtime?

Added By: Ted (DevExpress Support) at: 9/3/2014 2:27:10 AM    

Hello,

To process your recent post more efficiently, I created a separate ticket on your behalf: T146861: The E20025 example cannot be compiled. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

GridView - How to track ClientLayout with a separate ListBox

$
0
0
This example illustrates how to track and apply ClientLayout using a separate ListBox.
The main implementation details are:
- Handle the GridViewSettings.CustomJSProperties event and store the currently applied client layout via the MVCxGridView.SaveClientLayout method;
- Handle the client-side ASPxClientGridView Init and EndCallback events, and store the currently applied client layout using a separate ListBox;
- Handle the client-side ASPxClientListBox.SelectedIndexChanged event and perform a custom GridView callback via the client-side MVCxClientGridView.PerformCallback method. Pass the selected client layout as a parameter;
- Handle the custom GridView callback via a separate Action method, retrieve the client layout to be applied, and store this value with ViewData;
- Handle the GridViewSettings.BeforeGetCallbackResult event and check if any client layout should be applied. If so, apply it via MVCxGridView.LoadClientLayout.

WebForms Version:
How to save/load the ASPxGridView's ClientLayout Data and choose them from the ASPxListBox

How to customize the New Report Wizard (introduced in the 2014 vol.1 release) in the End-User Designer

$
0
0

This sample illustrates how to customize the wizard in the End-User Designer.

Viewing all 7205 articles
Browse latest View live


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