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

How to set tab stops so that each tab is of certain characters width

$
0
0

This example illustrates how you can set monospaced font as the document default font and use the MeasureSingleLineString method to calculate the width of a string composed of four characters. This value is used to specify tab stops in a new document.



How to display detail data within a popup window

$
0
0

This example contains a Customers grid with a hyperlink column. When a hyperlink is clicked, a popup window is opened to display detail data - orders - of a given customer. Orders is a separate web page, which is embedded into the ASPxPopupControl via the client-side SetContentUrl method.

See Also:
How to show ASPxPopupControl by clicking the ASPxHyperLink in the GridViewDataColumns' DataItemTemplate
How to show detail information in a separate ASPxGridView
How to display master-detail tables in two grids on separate tabs of a PageControl
How to show the ASPxPopupControl
How to show detail information in a separate ASPxGridView
How to display detail data within a popup window using ContentUrl (MVC)
How to display detail data within a popup window (MVC)
E5202: How to display detail data within a popup window using ASPxPopupControl content elements

Example Comments

Added By: Jijo V M at: 7/16/2013 11:10:42 PM    

Hi,
I implemented what you described here. But unfortunately I'm gettingthe following error.
Microsoft JScript runtime error: The value of the property 'ShowDetailPopup' is null or undefined, not a Function object.
DevExpress version 12.2..11.

How to load an external Window/UserControl into a DocumentPanel

$
0
0

You can define a Window, Page or UserControl in external XAML files and then, with DXDocking, load their contents into DocumentPanel objects.

This example demonstrates how to load an external Window and UserControl into DocumentPanels.

In the example three approaches are demonstrated:

1) The contents of MyWindow.xaml is loaded into a DocumentPanel at design time (in XAML) via the DocumentPanel.Content property. The Content property accepts a Uri object, which must refer to a XAML file defining a Window, Page or UserControl.


[XAML]
dxdo:DocumentPanelx:Name="docPanel2"Caption="Panel2"Content="{dxdo:RelativeUriUriString=CustomWindows\\MyWindow.xaml}"

2) The DocumentPanel.Content property is set with a Uri object at runtime:


[C#]
docPanel1.Content=newUri(@"CustomWindows\MyWindow1.xaml",UriKind.Relative);

3) The DockLayoutManager.DockController.AddDocumentPanel method creates a new DocumentPanel object and loads the contents of an external XAML file into the created panel.


[C#]
panel1=dockLayoutManager1.DockController.AddDocumentPanel(documentGroup1,newUri(@"CustomWindows\UserControl1.xaml",UriKind.Relative));panel1.Caption="Document "+(ctr++).ToString();

In the example, the XAML file defines a UserControl object. The loaded UserControl is accessed via the DocumentPanel's Control property and then a method on the UserControl is invoked.


[C#]
//...(panel1.ControlasUserControl1).SetDataContext(imageInfo);

You can see this in action by clicking the "Set DataContext for UserControl" button in the example.

Example Comments

Added By: Sudha Raman at: 10/22/2013 9:21:47 AM    

Hi,

 I am following the same approach in my project. My question is how to close the Usercontrol from Button click event of it.(not using the 'X' on right corner- usercontrol unloaded event).

Thanks
Sudha.

Added By: Alex Zeller (DevExpress) at: 10/23/2013 1:00:47 AM    

Hi,
If you have a button within a UserControl displayed within a DocumentPanel, you can use the Button.Click event to close the current DocumentPanel:
private void button1_Click(object sender, RoutedEventArgs e) {
    DockLayoutManager dm = DockLayoutManager.GetDockLayoutManager(this);
    dm.DockController.Close(dm.ActiveDockItem);
}
Thanks, Alex.

Added By: Cotza Andrea at: 11/20/2013 1:56:14 AM    

Hi,

 I've a windows (MDI) with buttons (save, new ecc.) and document panel with loaded windows at runtime. I need to send commands from child windows to MDI window (enable/disable buttons). How can I do?

Thanks, Andrea.

How to filter the GridView across all columns and highlight the matched text

$
0
0

This example demonstrates how to show only those rows in the GridView whose cells contain a specified text. Matched text is highlighted using the MultiColorDrawString method.

How to show buttons with image in a TreeList's node or GridControl's cell

How to customize a dashboard layout

$
0
0

The following example demonstrates how to customize a dashboard layout in code.


In this example, the DashboardViewer loads an existing dashboard with the predefined layout form an XML file. The dashboard contains three dashboard items that are placed horizontally side-by-side.

The following steps are performed to create a new layout:

- Three layout items are created to display the existing dashboard items. The weight parameter specifies the layout item size.

- A new layout group is created to display the Grid and Chart dashboard items. The orientation parameter specifies the orientation of layout items within this group.

- A root layout group is created. This group contains the previously created group and the layout item displaying the Range Filter dashboard item.

- The root layout group is assigned to the Dashboard.LayoutRoot property.

How to display custom scale with different working time and cell duration for different week days

$
0
0

This example demonstrates how to create a custom scale that meets the following requirements:

1. Working days: visible time from 7AM till 9PM, time cell duration is 12 minutes;

2. Saturday: visible time from 9AM till 8PM, time cell duration is 20 minutes;

3. Sunday: visible time from 12AM till 3PM, time cell duration is 30 minutes.

This approach is based on overriding the Floor, GetNextDate and HasNextDate methods in a custom TimeScaleFixedInterval descendant.

How to create a fixed reference to an existing document range (the Fixed Range feature)


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.

How to Create a TransitionControl

$
0
0

This example shows how to use a TransitionControl.

Unit Conversion Library code samples

$
0
0

This example illustrates how to use the Unit Conversion Library to create a QuantityValue object that represents a pressure value, assign a value measured in millimeters of mercury and gets the same value measured in hectopascals.

How to load images into grid asynchronously without using an unbound column

$
0
0

Starting with version 13.2.8, our controls contain the BackgroundImageLoader class that can be used to load Images asynchronously.

How to handle the Click event for the carousel item

$
0
0

Specify our own template for the ItemsControl.ItemTemplate property and handle the PreviewMouseDown event for the control in the ItemTemplate. In the PreviewMouseDown event handler, to make sure that the user clicks an active item, compare the DataContext property of the ActiveItem and sender; if they equal each other, the active item is clicked.

How to export a custom control from GridControl

$
0
0

This example shows how to export a custom control from GridControl.

How to show parent nodes during filtering when at least one child nodes meets an applied filter

$
0
0

By default, if a child node meets filter criteria but the parent node doesn't, the parent node is hidden. To change this behavior, it is necessary to handle the CustomNodeFilter event and implement filtering logic manually. To check whether or not a node meets filter criteria, use the ExpressionEvaluator.Fit method.

In addition, if the HierarchicalDataTemplate mode is used, the TreeListView creates child nodes only when you expand a parent node for the first time. So, the required step in this scenario is to expand all nodes to forcibly create them.


How to generate bands based on a collection in GridControl

$
0
0

To generate bands from a collection, the BandsSource property was created. Bind this property to a collection of simple objects and specify the BandTemplate property that is used to visualize a band from an object. In a similar manner, you can use the ColumnsSource and ColumnTemplate properties to create columns in a band.

XtraGrid - How to use the RealTimeSource

$
0
0

This simple example illustrates how to use RealTimeSource with a grid.

How to change the column header background in Silverlight

$
0
0

To change the background of GridControl columns, it is necessary to override the GridColumnHeader's template. Please refer to the How to modify DX themes in Silverlight article to learn more about modifying theme resources in Silverlight.

How to: Populate DXListView with Data from Datasource (Final Code)

$
0
0

This example shows how to populate a DXListView control with data from a data source.

A tutorial giving you step-by-step instructions to recreate this example can be found in the documentation.


How to: Create a Tabbed View and populate it with items from a bound collection

$
0
0

This example creates a Tabbed View and populates it with items from a bound collection. The headers and contents of items are visualized using two DataTemplates. An item's contents are rendered as a set of editors arranged with the help of the LayoutControl.

Viewing all 7205 articles
Browse latest View live


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