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

WinForms SpreadsheetControl API - Part 2

$
0
0

This example is the second part of the SpreadsheetControl API set of examples that demonstrates how to use the SpreadsheetControl API to programmatically manage spreadsheet documents, without the need for Microsoft Excel to be installed.

This sample introduces API properties and methods used to perform the following operations:

- Insert, delete and modify pictures
- Add a hyperlink to a picture
- Add custom functions to the spreadsheet



How to create and display a BarCode in a web application

$
0
0

This example illustrates how you can use our new Bar Code Library in ASP.NET to generate and display a barcode image on the webpage. The best approach implies creating a custom HTTP Handler that will generate and output an image. Here is a code of this handler:

[C#]
publicclassBarCodeHandler:IHttpHandler{publicvoidProcessRequest(HttpContextcontext){BarCodebarCode=newBarCode();barCode.Symbology=Symbology.QRCode;barCode.CodeText="123";context.Response.ContentType="image/png";barCode.Save(context.Response.OutputStream,ImageFormat.Png);context.Response.End();}publicboolIsReusable{get{returnfalse;}}}

The img tag in the main aspx page is defined as follows:

[ASPx]
<imgsrc="BarCodeHandler.ashx"alt="QRCode"width="200px"height="200px"/>

See Also:

HTTP-handler for image

Example Comments

Added By: ABRAMO ABRAMO at: 6/14/2013 5:12:48 AM    

I get Server Error in '/E4716' Application when I click "Run Online"

Added By: mariah sharp at: 7/31/2013 11:25:17 PM    

have a look at this <a href="http://www.keepautomation.com/products/net_barcode_winforms/">barcode generator for winforms application</a>

Added By: mariah sharp at: 8/8/2013 5:33:13 AM    

does this <a href="http://www.keepautomation.com/products/net_barcode_winforms/">barcode generator in .net winforms </a>have the quality above

Implement a custom drop-down editor with TreeView as PopupContent

$
0
0

Show how to implement a custom ComboBoxEdit with TreeView as a PopupContent and use it inside DXGrid as a custom column.


Update (13.1 version):


We've modified this code example by using the DevExpress control version 13.1. There is no need to create custom classes to resolve this problem.

You can accomplish this task by using the Grid control in the TreeView mode as a popup content template of the LookUpEdit control.

This way is more efficient and clear than the way used in this example for old versions of DevExpress controls.


Here is a snippet of the markup file:

[XAML]
<dxg:LookUpEditName="lookUpEdit"VerticalAlignment="Top"Width="350"Margin="50,37,67,0"DisplayMember="Name"><dxg:LookUpEdit.PopupContentTemplate><ControlTemplate><dxg:GridControlx:Name="PART_GridControl"AutoGenerateColumns="AddNew"><dxg:GridControl.Columns><dxg:GridColumnFieldName="Name"Header="Employee Name"/><dxg:GridColumnFieldName="Position"/><dxg:GridColumnFieldName="Department"/></dxg:GridControl.Columns><dxg:GridControl.View><dxg:TreeListViewName="treeListView1"AutoWidth="True"KeyFieldName="ID"ParentFieldName="ParentID"TreeDerivationMode="Selfreference"/></dxg:GridControl.View></dxg:GridControl></ControlTemplate></dxg:LookUpEdit.PopupContentTemplate></dxg:LookUpEdit>


Example Comments

Added By: Rob Hoglund @ CDW at: 6/12/2013 10:48:00 PM    

This example doesn't work with version 12.1.6.

How to: Create Information Panels

$
0
0

This example shows how you can create information panels. The complete description is available in the How to: Create Information Panels help topic.


Example Comments

Added By: Willem de Vries at: 12/18/2012 1:36:33 AM    

I'd like to see how the current skin can be applied to the panel.

Added By: Konstantin B (DevExpress) at: 12/21/2012 6:10:33 AM    

Hi Willem. You can see it in the FeatureCenter demo ("Frame Templates" | "Info Panels" section).

How to customize the settings of a toolbar item created for an Action.

$
0
0

See the How to: Customize Controls Associated with an Action for more details.

See Also:
E1977

Example Comments

Added By: Mario Blatarić at: 9/17/2013 7:01:09 AM    

Could you provide an example of how to do the same thing on Web? Web version of http://documentation.devexpress.com/#Xaf/CustomDocument3183 documentation article would also be helpful.

Added By: Dennis (DevExpress Support) at: 10/23/2013 7:20:20 AM    

Thanks for your suggestion, Mario. We will consider creating a Web version in the future.

How to manage user settings (reset, merge, import, export, etc.) stored in the database instead of a file system

$
0
0

Refer to the A reusable XAF module for storing model settings in the database (security system type insensitive!) forum thread for more details about this solution.

To use this custom module in your project, do the following:
1. Include the DatabaseUserSettings project into your solution;
2. Rebuild your solution and invoke the Module Designer for the YourSolution.Module project as described in the corresponding documentation;
3. Locate the DatabaseUserSettings component in the Toolbox and drop it on the designer surface as described in the "Add a Custom Module" section.
Check out the Application Solution Components help article for more details on using custom XAF modules.

See also:
Core - Provide an easy way to store administrator and user model differences in a custom store (e.g., in a database)

IMPORTANT NOTES
1.
Be aware of the following issue with this example: User settings may be duplicated/overridden under certain circumstances after merging configurator and user settings applied to the same element
2. This example solution is not yet tested in the middle-tier and SecuredObjectSpaceProvider scenario and most likely, it will have to be modified to support its specifics.

Example Comments

Added By: Pawel Rymarczyk 1 at: 5/20/2012 9:35:40 AM    

Hi,

Not working with DbUpdater 11.2.

Ticket: http://www.devexpress.com/Support/Center/Question/Details/Q400938

Added By: Sandro Welter (Intelligix) at: 7/6/2012 1:14:37 PM    

Hi,

I need this example in 12.1 version. Thanks.

Added By: Robert Fuchs at: 7/11/2012 11:25:44 AM    

> Take special note that it is important to grant write permissions for
> your persistent model differences classes to the anonymous user:

AFAIR the new security system does not need an anonymous user any more?

Added By: Miles at: 7/12/2012 3:44:42 PM    

12.1 version please!

Added By: Frank (DataJunxion) at: 8/11/2012 2:00:41 AM    

12.1 version?

Added By: John Botibol at: 9/12/2012 4:09:39 AM    

Hi Guys, the Issue (Q421353) mentioned above as one to be aware of is marked as private so this is quite tricky!

Added By: Paolo Parente at: 10/31/2012 10:21:27 AM    

Hi, is there a way to download the whole solution, without select every single file?
Thanks,
Paolo

Added By: Paolo Parente at: 11/2/2012 2:13:32 PM    

Ok, i did it.
But now i've a question: i can i deploy the new Model.xafml when a new version of the application has been developed?
Thanks,
Paolo

Added By: Markus Hoevermann at: 11/5/2012 4:03:53 AM    

I have the same problem as Paolo: How to handle the case when a new softare version with another Model.xafml must be distributed? Is there a ay to do this?

Added By: Dennis (DevExpress Support) at: 11/6/2012 3:03:35 PM    

I have answered your question about deploying the new version in http://www.devexpress.com/Support/Center/Issues/ViewIssue.aspx?issueid=Q443198

Added By: Robert Fuchs at: 12/15/2012 1:38:45 PM    

http://www.devexpress.com/issue=Q421353 is still private.
Is it fixed in the 12.2 example?

Added By: Nektarios Patelis at: 12/28/2012 3:09:23 AM    

Iuse linq queries and Custom fields on model.xafml following http://www.devexpress.com/Support/Center/Example/Details/E859. I get exception on project start up: An error with number 1009 has occurred.
Error message: Error occurs while adding the 'FieldName_Linq' custom property ('System.Double' property type) to the 'MyClassName' type: 'Object reference not set to an instance of an object.'

Added By: Dennis (DevExpress Support) at: 1/29/2013 9:43:43 AM    

Guys, please refer to the public http://www.devexpress.com/issue=Q470416 ticket instead of the private Q421353 one.

Added By: Mr292 at: 1/30/2013 8:44:44 PM    

Dennis, Thanks a lot for this. I had implemented something similar before but I have now moved to your code so as to take advantage of any future changes.

I have a few questions though

1. Does the Model.xafml in the Program Folder get hit at all? It does not seem like it from the code, but wanted to be sure.
2. I had implemented a feature where on exit, the configurator would be prompted to store changes. I have modified this to do the same but in my implementation, the user was being prompted twice. This I have noticed is an issue with a lot of functions in XAF but is usually solvable easily. In this instance, what should I check for to disable the consecutive prompt?
3. Lastly, Just so some users are aware I was having issues saving Chart/Pivot Settings as XML in MySQL if I use latin1 in innodb. Not your fault but I had implemented a BLOB save instead to get over that.

Added By: Vitaly Alekseev (Sibintek) at: 3/27/2013 1:44:39 AM    

How can I logon by Configurator user, if domain authentication used?

Added By: Nate Laff at: 4/12/2013 11:09:31 AM    

Implemented this yesterday after using the example of this from a long time ago (admin mode) and overall I like it.

Administrator users in my opinion shouldn't be able to see the User Settings navigation item. Unfortunately Q485525 prevents this from happening easily. Or am I missing something that this should be visible to Administrator. Seems like only Configurator should see it.

Added By: Nate Laff at: 4/16/2013 5:29:56 PM    

Also, this has been an issue since the first iterations of this. If you make changes to the Win model at the highest level (Model.xafml) such as moving the location of MyDetails, these changes always get messed up. In the current scenario, MyDetails shows up in the navigation group I specified, but also gets duplicated in the default group after you logon with the Configurator user. Does this happen to anyone else?

Added By: Nate Laff at: 4/16/2013 6:03:33 PM    

Also, what's the process here? Let's say you want to make a global change to a view as Configurator..

Log on as Configurator
Make changes
Exit
Log on as Configurator
Manage User Settings action, import from source Configurator to all users
Exit
Log on as User
Verify changes

Is that the process? Am I missing something. The exits are required?

Also, you can't reset to defaults without opening Model Editor as configurator, resetting there, exiting, manage user settings and import from Configurator source again?

Just trying to make sure I have this process down correctly.

Added By: Nate Laff at: 5/2/2013 2:06:59 PM    

Dennis?

Added By: zacarias de prado habela at: 7/26/2013 7:31:49 AM    

Hi:
Where is "XPManageUserSettingsParameter", "XPUserSettings", XPUserSettingsAspect defined?
Thanks

Added By: Dennis (DevExpress Support) at: 7/26/2013 7:41:35 AM    

These classes are defined in the DatabaseUserSettings module. Use the Visual Studio search facilities to locate them...

Added By: Gabriel at: 9/24/2013 1:54:17 PM    

My happy day :D

Obsolete: dxList - How to scroll to a specific item

$
0
0

This approach is related to 13.1. Starting with 13.2, please use the dxList.contentReadyAction event and scrollTo method instead. See the ticket Add the afterRender event to widgets to learn more:

For example:

[JScript]
var itemHeight = 23; $("#list").dxList("instance").scrollTo(itemHeight * 12);

Prior 13.2:

dxList does not provide any API that allows scrolling to an item. We can create a dxList inheritor and add the required functionality. This example demonstrates how to add the dataBound event and a method that scrolls content to a specific item index.

[JScript]
var MyList = DevExpress.ui.dxList.inherit({ _render: function(){this.callBase();if(this._dataSource){if(this._dataSource._isLoaded && $.isFunction(this.option("dataBound")))this.option("dataBound")(this);}}, scrollToItemIndex: function(index){var elements = this._items();if(elements.length < index || index < 0)return;var itemHeight = elements[0].offsetHeight;this._scrollView.scrollPos(itemHeight * index, true);}}); DevExpress.ui.registerComponent("myList", MyList);

We handle the dataBound event and call the scrollToItemIndex method that was added to our inheritor.

See also:
DevExpress.ui.registerComponent

How to format tables


How to load MVC extensions using the CallbackPanel extension

$
0
0

Technically, there is not much difference between the DevExpress Extension and the jQuery method, because the CallbackPanel extension uses the latter internally. However, in many cases, the CallbackPanel helps load a page content dynamically, even if it has extensions that use callbacks.

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

Obsolete: How to localize a DevExtreme application

$
0
0

This approach is related to 13.1. Starting with 13.2, please follow recommendations from theLocalization help topic.

This example demonstrates how to localize a DevExtreme application. The main idea is to create a "hash table" that contains all the necessary captions and titles associated with a corresponding language. When an application is loaded, the required titles are applied to elements on your views. The example allows you to change the current language at runtime. We use LocalStore to save/restore the selected language between application re-execution.

How to: Use the PropertyGrid to Manage Collection Properties

$
0
0

This example shows how to manage collection properties and implement item initializers in the Property Grid.

dxMap - How to add the current location marker

$
0
0

This example describes how to use the dxMap widget with HTML5 Geolocation.

See also:
How to take advantage of map provider API features that were not implemented in the dxMap widget?
dxMap - How to add draggable markers

Example Comments

Added By: Joe Ehrenfeld at: 9/17/2013 10:29:57 AM    

I'm getting this error when I try to use the code below:
Error: Object doesn't support property or method '_initMap'

Added By: Marion (DevExpress Support) at: 9/18/2013 12:51:47 AM    

@Joe,
It seems that the dxMap is not found. Please open a new thread and post your sample.

Added By: Franco Bonacchi at: 11/19/2013 1:40:08 PM    

Please update this example for 13.2.3 (Beta)

_initMap() is no more

Added By: Marion (DevExpress Support) at: 11/20/2013 5:07:18 AM    

@Franco,
We will update this example when the official release is published.

Added By: Franco Bonacchi at: 12/4/2013 12:56:12 PM    

Is 13.2.5 the official release? I'm waiting for this to make my maps work again! Thanks.

Added By: Marion (DevExpress Support) at: 12/5/2013 7:09:12 AM    

@Franco, I have updated the example.

How to use the ASPxHtmlEditor to edit the XtraReport content directly on the web page

$
0
0

This example illustrates how to enable rich text editing when viewing web reports. To accomplish this task, the HTML content is obtained via the ASPxHtmlEditor.Html property, and then copied to the report's XRRichText using the XRRichText.LoadFile(Stream, XRRichTextStreamType.HtmlText) method. In the example, an extra ReportToolbar button is used to invoke the ASPxHtmlEditor embedded into the ASPxPopupControl.

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).

How to implement Filter Panel for ASPxGridView control as XtraGrid's Find Panel


ASPxGridView batch editing - Hide update / cancel links

$
0
0

It's possible to update multiple ASPxGridViews on the ASPxButton click. To achieve this, I suggest you implement the following:

- Wrap the ASPxGridView by ASPxCallbackPanel;

- Set the ASPxButton.AutoPostBack to false;

- Call the ASPxClientCallbackPanel.PerformCallback method in the ASPxClientButton.Click event handler;

- Use the ASPxGridView.UpdateEdit or the ASPxGridView.CancelEdit to update the ASPxGridViews or cancel editing in the ASPxCallbackPanel.Callback event handler.


To hide Update / Cancel buttons, use the ASPxGridView.CommandButtonInitialize event:

[C#]
</para><para>protectedvoidgv_CommandButtonInitialize(objectsender,ASPxGridViewCommandButtonEventArgse){</para><para>if(e.ButtonType==ColumnCommandButtonType.Update||e.ButtonType==ColumnCommandButtonType.Cancel)</para><para>e.Visible=false;</para><para>}

How to use PhoneJS widgets in desktop web applications

How to create a custom hyperlink control

$
0
0

The following example demonstrates how to create a custom HyperlinkLabel control. This control is intended to show hyperlinks on a web page without using JavaScript, as it is done by default in XtraReports. Instead, to show a hyperlink it shows the "a href=" tag to avoid security warnings.

How to apply conditional formatting to a range of cells (WPF Spreadsheet)

$
0
0

This example illustrates how to get started with conditional formatting that can be applied to cells that match a certain condition specified by a conditional formatting rule.

In particular, this sample demonstrates how to use the SpreadsheetControl API to create the following types of conditional formatting rules:

- a rule that formats cells whose values are above or below the average;

- a rule that highlights cells whose values are between or not between two specified values;

- a rule that formats top or bottom ranked values;

- a rule that highlights cells containing the given text;

- a rule that formats unique or duplicate values, blank cells and formula errors;

- a rule that highlights cells containing dates in the specified time period;

- a rule that formats cells whose values meet the condition expressed by the relational operator;

- a rule that uses a formula to determine which cells to format;

- a two-color scale conditional formatting rule;

- a three-color scale conditional formatting rule;

- a data bar conditional formatting rule;

- an icon set conditional formatting rule.





How to customize cell appearance in WPF Spreadsheet using a cell template

$
0
0

In this example the SpreadsheetControl.CellTemplate property is used to specify a data template that displays a cell formula near the cell.

Viewing all 7205 articles
Browse latest View live


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