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

How to prompt when the user is about to exit a WinForms application

$
0
0

Scenario
A confirmation message appears when the main application window is being closed by a user to avoid accidental closure of the whole application and losing all opened screens:


Implementation
To use this solution in your project, simply copy the ...\WinSolution.Module.Win\PromptClosingLastMainWindowController.xx file into your WinForms module project.

See Also:
ExitController - prompt when the user is about to exit the application


How to add a custom title to a map vector element

How to customize a web request for a map provider

$
0
0

This example shows how you can implement a custom proxy to make a request to the Bing Maps provider for obtaining map tiles from it.

How to customize the appearance of a map shape element

$
0
0

This example shows how to customize the visual representation of a map shape element (MapRectangle).


How to customize the appearance of a map shape element

$
0
0

This example shows how to customize the visual representation of a map's shape element (MapRectangle).

ASPxGridView - How to display only filtered values in CheckedList HeaderFilter when a filter is applied to a column

$
0
0

According to ASPxGridView design, when the CheckedList HeaderFilter is displayed for a column with a filter applied, it displays all possible column values in the CheckedList. This example illustrates how to overcome this behavior and always display only filtered values in the CheckedList.

In this example the ASPxGridView.HeaderFilterFillItems event handler is used to get all available unique column values by iterating through all ASPxGridView rows and removing unnecessary items from the e.Values collection.

Note that this approach would not work if the server-mode binding is used. In this case, get all available unique column values directly from your database server.

How to: Create a Banded View

$
0
0

This example demonstrates the Banded View.

How to show tooltips for map shapes

$
0
0

This example illustrates how to display tooltips for shapes loaded from Shapefiles (Countries.dbf, Countries.shp).

Note that a tooltip displays information (a country name, population) for each map shape from Shapefiles.


How to show tooltips for map shapes

$
0
0

This example illustrates how to display tooltips for shapes loaded from Shapefiles (Countries.dbf, Countries.shp).

Note that a tooltip displays information (a country name, population) for each map shape from Shapefiles.

How to use automatic date-time scale modes of an axis

$
0
0

This example demonstrates how to use date-time scale modes of an axis (both manual and automatic).

ASPxEditors - How to show a validation image tooltip immediately

$
0
0

The Error tooltip is a standard html title attribute. So, we cannot reduce the delay when displaying it. However, we can use a custom tooltip via the ASPxPopupControl.

ASPxComboBox - How to implement cascaded combo boxes when using a large data source

$
0
0

This example demonstrates how to implement cascaded combo boxes scenario when a child ASPxComboBox operates in a Dynamic List Population mode

1) Enable a "child" ASPxComboBox "Dynamic List Population" mode by setting the EnableCallbackMode property to "true"
2) Implement both the ASPxComboBox.OnItemRequestedByValue event and the ASPxComboBox.OnItemsRequestedByFilterCondition events of the "child" ASPxComboBox;
3) Handle the client-side ASPxClientComboBox.SelectedIndexChanged event of the "parent" ASPxComboBox;
4) Perform a custom callback of the "child" ASPxComboBox via the client-side ASPxClientComboBox.PerformCallback method to update the underlying "child" data.

ASPxButton - How to implement a custom layout when EnableDefaultAppearance is disabled

$
0
0

This example demonstrates how to disable EnableDefaultAppearance of ASPxButton and define a custom style for it.


- Set the ASPxButton.EnableDefaultAppearance property to "false" to completely define a button style either via css or appropriate style properties;
- Define a custom css class or set style properties for the button;


Css:

[CSS]
.customButton{background-color:Red;cursor:pointer;font-weight:bold;border:3pxsolid#b3b4c3;border-right:3pxsolid#090e61;border-bottom:3pxsolid#090e61;}

[ASPx]
<dx:ASPxButtonEnableDefaultAppearance="false"CssClass="customButton"...> ...</dx:ASPxButton>

Properties:

[ASPx]
<dx:ASPxButtonEnableDefaultAppearance="false"Cursor="pointer"Width="160"Height="30"...> ...</dx:ASPxButton>

- Define (if needed) custom css classes or properties for PressedStyle, DisabledStyle, HoverStyle, and CheckedStyle to create different styles for each state;
- Define (if needed) the FocusRectBorder properties.

[CSS]
.customButtonPressed{background-color:#AA0000;}
[ASPx]
<dx:ASPxButton...EnableDefaultAppearance="false"CssClass="customButton"...><PressedStyleCssClass="customButtonPressed"></PressedStyle><HoverStyleBackColor="#FF4040"></HoverStyle> ... <FocusRectBorderBorderWidth="1"BorderStyle="Dotted"BorderColor="White"/></dx:ASPxButton>


ASPxGridLookup - How to change the displayed text when all rows are selected

$
0
0

This example illustrates how to display a custom text inside ASPxGridLookup when all rows are selected.


To implement this scenario, perform the following steps:


Handle the ASPxGridLookup.ValueChanged event to pass some flag to the client side based on the lookup selection:


[JScript]
protected void gridLookup_ValueChanged(object sender, EventArgs e){ ASPxGridLookup gl = sender as ASPxGridLookup;if(gl.GridView.Selection.Count == gl.GridView.VisibleRowCount) gl.GridView.JSProperties["cp_selected"] = true;}

Then handle the client-side EndCallback event and set a custom text if our flag has the "true" value (i.e. all rows are selected):


[JScript]
function OnEndCallback(s, e){if(s.GetGridView().cp_selected){ s.GetInputElement().value = "(Select All)";delete(s.GetGridView().cp_selected);}}

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());}

How to: Manage documents via WindowedDocumentUIService and TabbedDocumentUIService

$
0
0

The WindowedDocumentUIService provides methods to create and show documents as windows.
The TabbedDocumentUIService provides methods to create and show documents as tabs.
The CurrentWindowService provides methods to close a window.

This example demonstrates how to use the above services in a view model.

How to: Create Custom Summary

$
0
0

The following example demonstrates how to use custom summaries to count the total number of empty cells in a certain grid column.

ASPxGridView - How to show different popup menu items based on the group row level

$
0
0

This example illustrates how to show different popup menu items based on the group row level.

 ASPxGridView does not allow determining the clicked row level on the client side. Thus, it is necessary to perform a callback to determine the row level on the server side and return the result to the client.

How to: Bind the Grid to ICollectionView

$
0
0

The example shows how to bind the Grid Control to the ICollectionView.
Use buttons to select an item in the collection. A checkbox specifies whether the grid's currently selected item is synchronized with the collection.

How to Create a TextEdit That Displays a Custom Button

$
0
0

This example shows how to create a simple TextEdit that displays a text field and a button that clears the entered text.

Viewing all 7205 articles
Browse latest View live


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