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

ASPxGridListEditor - Reference properties editing in the batch mode


How to use the ASPxGridView control (with the enabled vertical scrollbar) in a Full Screen mode (100% browser Width and Height)

$
0
0

This example demonstrates how to resize the ASPxGridView control based on the browser window size.

Update:
To keep the visual grid's size intact while adjusting it on the first load, wrap ASPxGridView with a hidden container and show it only after its full initialization and adjustment. For example:

[ASPx]
<divid="gridContainer"style="visibility: hidden"><dx:ASPxGridViewrunat="server"ID="gridView"...> ...</dx:ASPxGridView></div>
[JavaScript]
function OnInit(s, e){ AdjustSize(); document.getElementById("gridContainer").style.visibility = "";}

See Also:

How to use the ASPxPageControl control in a Full Screen mode (100% browser Width and Height)

Question Comments

Added By: neuDev33 at: 5/16/2012 11:48:45 AM    

I'm copy + pasting this code, but the height does not increase to cover the parent control

Added By: just wqq at: 9/18/2012 7:45:13 PM    

DevExpress.Web.ASPxGridView.v8.3 can do this

Added By: Michelle Young at: 7/31/2013 7:46:42 AM    

Visual studio says the code behind method is obsolete and you should now use RegisterBaseScript instead.

Added By: Yevgeniy Reznik at: 7/31/2013 8:45:41 PM    

Can you please update to the latest version of DevExpress?

Added By: Honesto Manlig at: 5/28/2014 9:03:24 PM    

How can I have the columns to be of width they need to be. Except for the last column to be the only one that grows to fill the rest of the gridview. For example, if there's three columns, if first column contains  text, it'll get as wide as it needs to so it does not wrap the text, then second column is a checkbox, so can always be same width, then the last column must get wide enough so that it fills the rest of the grid's width.

Added By: Artem (DevExpress Support) at: 5/29/2014 12:01:42 AM    Hello,

I've moved your question to a separate thread created on your behalf:
How to use the ASPxGridView control (with the enabled vertical scrollbar) in a Full Screen mode (100% browser Width and Height)
Please refer to it for further correspondence.Added By: Satarupa Brahma 1 at: 3/8/2016 10:37:29 AM    It is important to note that the ClientInstanceName needs to be set so that the java script can find the control that needs to be resized.   I struggled with this for several hours before I found the key.Added By: Jonathan Kent at: 9/7/2017 5:05:55 AM    When trying to implement this resolution using Razor it worked fine but I experienced a javascript error when my gridview was editable when clicking on add or update. To resolve the issue I removed all javascript and simply added this line to my gridview implentation;
settings.ClientSideEvents.Init = "function OnInit(s, e) {myGridViewName.SetHeight(Math.max(0, document.documentElement.clientHeight));}";

Spreadsheet Document Server API - Part 2

$
0
0
This example demonstrates how to use the Spreadsheet Document Server API to programmatically manage spreadsheet documents, without the need for Microsoft Excel to be installed.
The application includes the RichEditControl  used to display and edit the code. The code modifies the spreadsheet document loaded in the Workbook instance. To see the results, open the document in Microsoft Excel by clicking the button.
You can modify the code and watch the result. If an error occurs during compilation or execution, the backcolor of the code window changes.

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

- Insert, delete and modify pictures
- Add a hyperlink to a picture
- Create a table
- Apply a custom style to the table
- Protect a workbook
- Protect a worksheet
- Apply user-specific permissions to a range in a protected worksheet
- Sort a range in descending and ascending orders
- Sort by multiple columns
- Simple search
- Search with options
- Export to HTML
- Group and outline data
- Insert subtotals
- Filter data by a list of values
- Apply a number filter
- Apply a text filter
- Apply a dynamic filter
- Sort the filtered data

For more information, review the Examples section in the documentation.

The Universal Subscription or an additional Document Server Subscription is required to use this example in production code. Please refer to the DevExpress Subscription page for pricing information.

Question Comments

Added By: Goran Ambrosic at: 9/7/2017 6:03:55 AM    Hi guys,
I am facing an issue with the worksheet protection.

In a tested sheet (Workbook created with Excel Pro 2016), I've Unlocked one cell ("B8").
Others are locked by default in Excel.
Then I try to programmatically protect the Sheet, via the API:
worksheet.Protect("password", WorksheetProtectionPermissions.Default)
as you've suggested.
In Visual Studio debugger I can confirm that before the call, worksheet.IsProtected was false and after the call true.
Also,
worksheet.Cells["B7"].Protection.Locked == true
as any other cell in a worksheet, except for the one chosen not to be locked, i.e.
worksheet.Cells["B8"].Protection.Locked == false.

However, I can update the value of any Locked cell.

The same is unclear in your example ProtectionActions.cs, in a method
static void ProtectWorksheet(Workbook workbook)
where you write a content into the
worksheet.Cells["B2"].Value
after the call
worksheet.Protect("password", WorksheetProtectionPermissions.Default);

What am I missing?

How to reuse XAF Audit Trail module functionality in a non-XAF WinForms application

$
0
0

The XAF Audit Trail module is intended to track changes being made in persistent objects. This module uses the AuditTrailService class to track changes and write them to the database. It is possible to use this API in a non-XAF application based on XPO, without creating and configuring the DevExpress.ExpressApp > XafApplication object as it is usually done in XAF apps. 

To use these features of the Audit Trial module, you will need to reference the DevExpress.Persistent.BaseImpl and DevExpress.Persistent.Base assemblies, which are part of the standard XAF delivery package. 

NOTE: You need to have a valid license for the eXpressApp Framework to use this example.

See Also:
Audit Trail Module Overview
How to reuse XAF Audit Trail module functionality in a non-XAF ASP.NET application
How to track changes made to persistent objects, and write them into a separate table

Question Comments

Added By: Scott Gross at: 4/23/2015 9:45:02 AM    

CANNOT use ExplicitUnitOfWork with the Audit Trail Module:
See: https://www.devexpress.com/Support/Center/Question/Details/T205670

How to reuse XAF Audit Trail module functionality in a non-XAF ASP.NET application

$
0
0

The XAF Audit Trail module is intended to track changes being made in persistent objects. This module uses the AuditTrailService class to track changes and write them to the database. It is possible to use this API in a non-XAF application based on XPO, without creating and configuring the DevExpress.ExpressApp > XafApplication object as it is usually done in XAF apps. 

To use these features of the Audit Trial module, you will need to reference the DevExpress.Persistent.BaseImpl and DevExpress.Persistent.Base assemblies, which are part of the standard XAF delivery package. 

NOTE: You need to have a valid license for the eXpressApp Framework to use this example.


See Also:

Audit Trail Module Overview
How to reuse XAF Audit Trail module functionality in a non-XAF WinForms application
How to track changes made to persistent objects, and write them into a separate table

How to access a tab control in a Detail View layout

$
0
0

Scenario
This example demonstrates how to implement a View Controller that will access layout controls and customize them as required. In particular, the second tab in the tab control should become active when opening the detail form.

Steps to implement

1. This functionality is implemented in the WinCustomizeTabControlViewController and WebCustomizeTabControlViewController classes that are added into the WinForms and ASP.NET module projects respectively (copy these classes into the respective projects of your test solution). Take special note that on the Web we are activating a required tab on the client side instead of using the server-side ASPxTabControlBase > ActiveTabIndex property, which is not appropriate for updating tab control on external callbacks (learn more...).

2. To identify the layout element by the "TabbedGroup" string, make sure this identifier is specified under the Views | YourBusinessObject_DetailView | Layout node in the Model Editor invoked for the YourSolutionName.Module/Model.DesignedDiffs.xafml file.

See also:
 
eXpressApp Framework > Concepts > UI Construction > View Items Layout
How to show the number of the nested list view's items in the tab caption (Web)

Question Comments

Added By: Wieland Voß at: 4/26/2016 11:30:50 PM    Hi all.

Do you have a hint for me, how to determine the index of the active tab?
And moreover, how to determine the index of a particular tab (i. e. by name)?

I want to switch to the "totals" tab, only if the "particulars" tab is the active one.

Best regards,
Wieland

Added By: Dennis (DevExpress Support) at: 4/26/2016 11:37:37 PM    

@Wieland: I've created a separate ticket on your behalf (T372263: how to determine the index of the active tab?). It has been placed in our processing queue and will be answered shortly. Please specify your target platform in that new ticket as well (WinForms/Web).

How to load a file on the callback of the ASPxGridView

$
0
0

By default, it is impossible to load files on callbacks:
The Concept of Callbacks
However, there's a solution that allows you to overcome this problem.
This sample shows how to load a file by clicking the custom ASPxGridView button using two approaches: 
1.  Load a file on the client side only (using the window.location.href property).
2.  Load a file on the client side using ASPxCallback control.
The first solution doesn't perform a callback to the server and all actions occur on the client-side. Another way is using ASPxCallback control to send a callback to the server and then handle CallbackComplete event. 

See also:
ASPxTreeList - How to download a file by clicking a custom command button
ASPxGridViewExporter - How to show content document in a new tab

How to show a hyper link (URL, email, etc.) for a business class property

$
0
0

Scenario
The following basic functionality is implemented in the HyperLinkPropertyEditor.Win,HyperLinkPropertyEditor.Web and HyperLinkPropertyEditor.Mobile modules:

1. Custom PropertyEditor classes for WinForms, ASP.NET and Mobile are based on the HyperLinkEdit, ASPxHyperLink and LinkComponent controls that can be used for representing object fields, containing email address, a URL or phone number (only for a Mobile application) in the UI.
2. To validate an input, a combined RexEx mask is used in both ListView and DetailView of WinForms and ASP.NET applications. The default regular expression is the following:
(((http|https|ftp)\://)?[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(:[a-zA-Z0-9]*)?/?([a-zA-Z0-9\-\._\?\,\'/\\\+&amp;amp;%\$#\=~])*)|([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6})
You can use it as is or modify it per your specific needs. Look for Regular Expressions in MSDN for more information on how to do this.
In Mobile applications, the CalculatedField.Getter property is used to determine whether or not the field value is a ten-digit phone number, email address or a URL, as it is shown in the MobileHyperLinkStringPropertyEditor.xx file.
3. The default email client, browser window or application for calling (only for a Mobile application) is opened after a single click on the hyperlink if it represents a valid email, web address or phone number. For end-users convenience, in DetailView of WinForms projects, a double-click is necessary to be able to easily edit the field.



Steps to implement

1. Copy and include the HyperLinkPropertyEditor.Web,HyperLinkPropertyEditor.Winand HyperLinkPropertyEditor.Mobile projects into your solution and make sure it is built successfully. Feel free to modify the settings of the underlying controls according to their documentation to better meet your business needs, e.g. provide a custom display text instead of the raw URL via the RepositoryItemHyperLinkEdit.Caption, ASPxHyperLink.Text and LinkComponent.Text options.

2. Invoke the Application Designer for the YourSolutionName/WinApplication.xx file by double-clicking it in Solution Explorer. Invoke the Toolbox (Alt+X+T) and then drag & drop the HyperLinkPropertyEditorWindowsFormsModule component into the modules list on the left.

3. Invoke the Application Designer for the YourSolutionName/WebApplication.xx file by double-clicking it in Solution Explorer. Invoke the Toolbox (Alt+X+T) and then drag & drop the HyperLinkPropertyEditorAspNetModule component into the modules list on the left.

4. Invoke the Application Designer for the YourSolutionName/MobileApplication.xx file by double-clicking it in Solution Explorer. Invoke the Toolbox (Ctrl+Alt+X) and then drag & drop the HyperLinkPropertyEditorMobileModule component into the modules list on the left.

5. Define a string persistent property within your business class and decorate it with the DevExpress.Persistent.Base.EditorAliasAttribute passing the "HyperLinkStringPropertyEditor" string as a parameter. See the E2096.Module\HyperLinkDemoObject.xx file for an example.


Frequently Asked Questions
E2096 - How to specify a display text for the hyper link based on a different business class property


How to generate a sequential and user-friendly identifier field within an XPO business class

$
0
0

Scenario

Orders, articles or other business entities often require that you have user-friendly Id or Code fields that end-users can memorize and use during phone conversations. They are usually sequential, but some gaps can be allowed as well (e.g., when an order is deleted). Refer to this StackOverFlow thread for more information on this common scenario, and a possible implementation.

Steps to implement

1.Add a new business class to your platform-agnostic module and call the static DevExpress.Persistent.BaseImpl.DistributedIdGeneratorHelper.Generate method in OnSaving. Depending on your business requirements, you can implement a readonly persistent or editable property where the generated value will be stored as well as check various conditions before generating the next sequence (e.g., string.IsNullOrEmpty(currentSequenceProperty) - to avoid double assignments, Session.IsNewObject(this) - to check whether the object is new, !(Session is NestedUnitOfWork) - to check whether the object is being saved to the database and not to the parent session, security system checks as per this blog post, etc.)

Take special note that you can use any strings as the "seqType"  and "serverPrefix" (optional) parameters that allow you to run named sequences in parallel (these parameters determine criteria for  updating right sequences). In the demo, I am just using the full persistent type name and a custom prefix, which can be changed as you need:

2. Build your platform-agnostic project and double-click on the Solution2.Module\Module.xx file to invoke the Module Designer;

3. Refer to the Exported Types section within the designer and expand the Referenced Assemblies | DevExpress.Persistent.BaseImpl node;

4. Select and press the space bar on the OidGenerator node to include this persistent type into the business model of your module:

 

IMPORTANT NOTES
1. The DistributedIdGeneratorHelper class demonstrated in this solution creates the IDGeneratorTable table to store the information about the last sequential number of a type. You can learn more on how this works from its source code at "C:\Program Files (x86)\DevExpress 1X.X\Components\Sources\DevExpress.Persistent\DevExpress.Persistent.BaseImpl\IDGenerator.cs".
Although this particular solution is simpler to implement and maintain (as it uses built-in XAF classes) than the How to generate and assign a sequential number for a business object within a database transaction, while being a part of a successful saving process (XAF) example, it is pretty safe and should also work in the most typical business scenarios.
2. If you have validation rules for your business class, the OnSaving method (and thus the sequence generation) is called only after all validation is passed. However, in rare cases, if a database related error is thrown during the first save and then the form is re-saved, the OnSaving method may be called again and a new sequence can be generated. This may lead to gaps in sequential numbers, which is not always allowed by business requirements (e.g., government regulations). To avoid this, you can use a more complicated solution from the How to generate and assign a sequential number for a business object within a database transaction, while being a part of a successful saving process (XAF) example or implement a database-level solution to handle such situations (e.g., using triggers).

3.  In the Integrated Mode and middle-tier Application Server scenario the newly generated sequence number will appear in the DetailView only after a manual refresh (i.e., it will be empty right away after saving a new record), because the sequence is generated on the server side only and is not passed to the client. You can download a ready test project for these configurations here.

4. You can find functional EasyTest scripts for this scenario in the Solution2.Module\FunctionalTests\E4904.ets file.
5. You can specify the initial sequence value manually: either by editing the IDGeneratorTable table in the database or using the standard XPO/XAF means by manipulating the DevExpress.Persistent.BaseImpl.OidGenerator objects. Another simpler solution would be using a different server prefix, e.g. "2017" or "2018" to start numbering with 1 again.

Question Comments

Added By: Gareth- at: 10/2/2013 5:58:17 AM    

Thanks, works perfectly - I've seeded the ID by manually changing the [Oid] in the IDGeneratorTable, do I need to worry about the [OptimisicLockField] or will this update automatically?

Added By: Dennis (DevExpress Support) at: 10/2/2013 7:10:50 AM    

@Gareth: No, you do not need to care about the OptimisticLockField.

Added By: MohammedFarooq at: 12/2/2013 1:07:31 AM    

Hi,

The code is really helpful but it increments the value of code even if the record is deleted! How can we stop the code to increase its value when a record is deleted?

Added By: MohammedFarooq at: 12/2/2013 1:25:16 AM    

I manage to figure out the solution. I have just added the IsDeleted checking and it worked like a charm!!!

    Protected Overrides Sub OnSaving()
        If (Not IsDeleted) Then
             Me.codeCore = String.Format("N{0:D6}", DistributedIdGeneratorHelper.Generate(Me.Session.DataLayer, Me.GetType().FullName, String.Empty))
        End If
        MyBase.OnSaving()
    End Sub

Added By: Dennis (DevExpress Support) at: 12/2/2013 1:26:50 AM    

@Mohammed: Yes, your solution is correct. I will consider updating this example accordingly. Thanks for your input in this regard.

Added By: rushdan . at: 11/6/2014 12:02:48 AM    

Hallo

I do not understand about explanation. What I know is, after I run the application, then save the data , it will execute Code number automatically.

Is it this example to show how to execute auto increase number ? Thanks

Added By: Dennis (DevExpress Support) at: 11/6/2014 2:00:43 AM    

@Rushdan: With the current implementation, the generation code is executed when the persistent object is being saved (OnSaving). I do not quite understand your last question. The functionality implemented in this example is well-detailed in the description and it can also be seen from simple code.

Added By: Andrew Bingham 2 at: 2/5/2015 12:40:25 AM    

"override its AfterConstruction method, as shown in the Solution2.Module\BusinessObjects\DomainObject1.xx file"

1. I cannot find the DomainObject1 file in the sample
2. The only BusinessObject is Order.cs which does not have an AfterConstruction method
3. What code need to go in AfterConstruction method?
4. What are the advantages / disadvantages compared to E2829?

Added By: Dennis (DevExpress Support) at: 2/5/2015 12:47:04 AM    @Andrew: Thanks for your feedback.
1-3. I've corrected this misprint in the description. 
3. This particular solution is simpler to implement than E2829.Added By: Vishwas Mokashi at: 4/21/2015 8:52:32 AM    

Is there any provision so that we can restart the Sequence Number after say an Year is completed?. Also, any way to give the start number for the sequence?.

Added By: Dennis (DevExpress Support) at: 4/21/2015 8:57:35 AM    

@Vishwas: Sure, you can do this. Technically, the information about the last sequence number is stored in the Oid column of the IDGeneratorTable table with the help of the OidGenerator persistent class. You can modify this data using either ADO.NET or XPO means.

Added By: Vishwas Mokashi at: 4/21/2015 9:02:11 AM    

Ok thanks Dennis...will try

Added By: MohammedFarooq at: 10/14/2015 2:37:53 AM    

Dear Dennis,

I have applied this logic in my project which also has validation enabled. Now the issue is, if the validation of the document fails while saving the new number is generated. And when the user saves the document again then a new number is generated as well.

Added By: Dennis (DevExpress Support) at: 10/14/2015 2:58:59 AM    @Mohammed: The original example has the if(string.IsNullOrEmpty(Code))  check that prevents multiple generations. Have you applied this code in your project? If this does not help, submit a separate ticket and attach your problematic sample so we can assist you further.Added By: MohammedFarooq at: 10/14/2015 5:03:57 AM    

You hit a bull's eye! I didn't have the  if(string.IsNullOrEmpty(Code)) in my code.

Was it added recently? Because i followed this example before and somehow i missed it.

Added By: Dennis (DevExpress Support) at: 10/14/2015 5:18:38 AM    You're always welcome. AFAIK, I added it a year ago or so.Added By: Paul Kubb at: 3/16/2016 2:14:58 AM    Would you please describe more in detail about serverprefix table? how and when to use it?
I cannot find any documentation about it also.Added By: Dennis (DevExpress Support) at: 3/17/2016 1:57:56 AM    

@Paul: It was a mistake in the original description, because this table is actually unused by the DistributedIdGeneratorHelper class. Please accept my apologies for the confusion. As for the "string serverPrefix" parameter of the Generate method, it allows you to run several sequences in parallel. Refer to the "C:\Program Files (x86)\DevExpress 1X.X\Components\Sources\DevExpress.Persistent\DevExpress.Persistent.BaseImpl\IDGenerator.cs" source file for more details.

Added By: Paul Kubb at: 8/4/2016 9:44:09 AM    I have read a source file and have several questions aboud DistributedIdGeneratorHelper.Generate():

1.  it seems like you intend to create a separate new session, attempt to save it to the database separately until success and return its Oid. Why can't we use the bo's existing session here?

2. by this design, do you intend to avoid some multi-user problem or something? if so, please explain why having a separate session will overcome it

3. if the OidGenerator is saved successfully in a separate session but the main bo's save event is dead, will the OidGenerator's save event be rolled back? or will we have a jumpy running number instead?

thanks in advance

Added By: Dennis (DevExpress Support) at: 8/5/2016 7:12:09 AM    

@Paul:
A1-2: Your understanding of class design is correct. A separate session will help to avoid concurrency issues in a multi-user environment: if another user generated a new number while you were saving your own, the locking exception occurs and a new attempt to generate the next number for you starts in the loop.
A3:No, it will not. See my answer in the T304004 ticket for more details.

Added By: wang yu 4 at: 9/23/2016 12:59:54 AM    does it support middle tier ?Added By: Dennis (DevExpress Support) at: 9/23/2016 2:13:47 AM    

@Wang: As in the example's description, the DistributedIdGeneratorHelper class currently does not support the middle-tier Application Server scenario, because the Session.DataLayer property is not initialized in this case.

Added By: 13 chi at: 10/3/2016 2:21:46 AM    That fix for middle-tier doesn't work well.
[C#]
newSession(sourceSession.ObjectLayer).DataLayer;
still returns null.
Added By: Dennis (DevExpress Support) at: 10/4/2016 2:41:06 AM    @13 chi: Thanks for your report and please accept my apologies for the inconvenience here. I will update the article with a better solution as soon as it is available.Added By: Dennis (DevExpress Support) at: 10/4/2016 10:29:13 AM    @13 chi: I've updated the E4904 example classes for the middle-tier Application Server scenario (see additional checks in the OnSaving method). Note that in this scenario, the generated sequence number will appear in the WinForms DetailView only after a manual refresh (i.e., it will be empty right away after saving a record), because the sequence is generated on the server side only and is not passed to the client.

How to display details collections with descendant classes filtered by object type in a DetailView

$
0
0

Suppose we have the same classes structure as shown in the How to: Use UpCasting help topic.
Our goal is to provide two details collections into a DetailView that will allow end-users to view objects of the LocalEmployee and ForeignEmployee classes separately in a Department DetailView.
In order to do this, we will declare two calculated details collections in the Department class and also write some code to update these collections when objects are added in or deleted from the main (associated) Employees collections.
By design the Employees collection is intended to list both local and foreign employees and also to allow end-users to perform any operations with them. The LocalEmployees and ForeignEmployees collections are intended to view objects only. So, the corresponding nested ListViews will be readonly.

See Also:
How to: Set Relationships Between Objects
How to: Calculate a Property Value Based on Values from a Detail Collection
How to filter persistent objects against their type

Question Comments

Added By: Willem de Vries at: 9/12/2012 11:36:40 AM    

I'm curious why HintCollection is used despite the documentation stating:
HintCollection - This member supports the .NET Framework infrastructure and cannot be used directly from your code.

Added By: Dennis (DevExpress Support) at: 3/11/2013 2:08:29 AM    

The HintCollection property is used here to specify a data source for an XPCollection.

Added By: Randy Jean at: 12/5/2014 11:07:54 AM    

Is there any way for these descendant collections to not be read-only?  Or, at the very least, when the list view is clicked the detailview is not read-only?  

Also, on the top-level listview (not filtered) can the New button be set to always drop down the list of objects?  Users are complaining that they hit the "button" part of the New and they don't realize there are different objects to choose to add.

Added By: Dennis (DevExpress Support) at: 12/8/2014 4:48:01 AM    >>Is there any way for these descendant collections to not be read-only?  Or, at the very least, when the list view is clicked the detailview is not read-only?  

You can try to remove the following attribute from these auxiliary collections, though I have not tested this particular configuration when creating this example solution:

[ModelDefault("AllowEdit", "False")]

 In general, it is better to use separate Views for editing these collections; e.g., show an editable ListView via a command on the toolbar.



>>Also, on the top-level listview (not filtered) can the New button be set to always drop down the list of objects?
Yes, set the IModelAction.ShowItemsOnClick Property for the New Action via the Model Editor.Added By: Wojciech Gurdek at: 9/8/2017 1:30:17 AM    I try to make editable descendant collections, change attribute [ModelDefault("AllowEdit", "True")]. The new button is visible but records are not stored after add.
When adding records from common listview, the descendant collections not refresh.
How to fix it ?

How to use the DropDownButton control

$
0
0

This example demonstrates the easiest way to utilize the DropDownButton control

Question Comments

Added By: michael williams 12 at: 1/20/2015 11:27:15 AM    

Poor example..  This is just the Designer's code.. How do I programmatically add a data source, or add a control inside the dropdown?

Added By: Alexey Z (DevExpress Support) at: 1/20/2015 11:40:22 PM    Hello,

In order not to mix several questions within one thread, I will extract your question to a new ticket. Let us continue our discussion there How do I programmatically add a data source, or add a control inside the dropdown. Added By: Marleen Schilt at: 9/8/2017 6:28:33 AM    This is an incomplete example, containing only the designer code, nothing on the use of this thing.

How to implement a scrollable ASPxDockZone

$
0
0
This example demonstrates how to implement a scrollable ASPxDockZone using ASPxPanel and a CssClass property.

How to create the print page header and footer when exporting the GridControl

$
0
0

To accomplish this task, create a PrintableControlLink class instance based on the GridControl. After that, assign your custom templates to the PageHeader and PageFooter properties of the PrintableControlLink object.

See also: GridReportManagerService.

How to: Show different views for the same object, based on the source view, from where it is open or created

$
0
0

Scenario:
I have two business classes representing a producer and a consumer of an transaction, and a transaction class that have references to both producer and consumer. I want to be able to open (or create) a transaction from the producer's transactions list, and do not show the producer property in the detail view (it is obvious). The same behavior I want for the consumer object.

Solution:
To accomplish the task, create additional detail views for the transaction class, with a different layout for each case (Transaction_DetailView_FromConsumer and Transaction_DetailView_FromProducer). Then, customize the nested list view models (Consumer_Transactions_ListView and Producer_Transactions_ListView) by specifying the custom detail view in the IModelListView.DetailView property.

See Also:
How to provide a specific View layout for users of certain security roles
Core - Provide an easy way to specify a different DetailView depending on whether a new object is created, shown from the ListView or on other conditions

Drawing tick values in the TrackBarControl and RangeTrackBarControl

$
0
0

This example demonstrates how to create custom TrackBarControl and RangeTrackBarControl editors that allow showing tick values.

Question Comments

Added By: Annie Shi at: 3/3/2016 6:07:31 PM    can you provide the solution for the following example code,it will be very convenient. thank you.
Added By: Annie Shi at: 3/3/2016 6:16:20 PM    Sorry,I have found the solution.Added By: Annie Shi at: 3/3/2016 6:33:52 PM    Sorry,I have found the solution.Added By: Joe Pool at: 9/11/2017 1:49:14 PM    Oh wow. This example does nothing to show someone how to use a TrackBarControl.

If my TrackBarControl goes from 0 to 10 and I load a record from the database that shows a 4 was saved, how do I set it?

So far, I have tried both of these:

    private void SetTrackBarEditValue(int value)
    {
        trackBarControl1.EditValue = value;
    }


    private void SetTrackBarValue(int value)
    {
        trackBarControl1.Value = value;
    }


Neither technique works. Added By: Aleks (DevExpress Support) at: 9/12/2017 12:40:25 AM    

Hello Joe,

In order not to mix multiple questions within one thread, I have created a separate ticket on your behalf (T554281: How to set TrackBarControl's value ). I will address it shortly.


DXGrid - How to bind GridControl context menu items to commands

$
0
0

This example demonstrates how bind a grid's and ViewModel's commands to the popup menu.


In addition, this example shows two different implementations of the popup menu in DXGrid:

1. Embedded BarItems.
2. BarManager and BarItemItemLinks.

Show a popup window in response to right-clicking a grid row

$
0
0

This demo shows how to:
    - Use client-side events to respond to right-clicking a grid.
    - Use client-side functions to identify the clicked row.
    - Invoke a popup control with additional information about the clicked row.
    
    Please look at the JS code (JS tab on the Code page) to find out how to do this.

Question Comments

Added By: Brad C at: 8/5/2014 4:30:02 PM    

what is popup_notesEditor ?? doesn't seem to be declared anywhere

Added By: Andrew (DevExpress) at: 8/5/2014 10:52:03 PM    

Hi Brad,
Yes, it is not obvious. Let me explain this.
The most our server side asp.net controls have corresponded j script/client widgets. They have the same name as server side control. For example, ASPxGridView  on server and ASPxClientGridView on client.
The grid in this example has name “grid” ID="grid" PopupControl has ID=”popup”, Memo control inside the popup control has ID=”notesEditor”. The full name for memo control (id + all parent controls ids, excluding page) is “popup_notesEditor”. So here is what we have.
If you run the demo and “View Source”, you will see the following generated Jscript:
var dxo = new ASPxClientMemo('popup_notesEditor');

Thank you,
Andrew R&D.

Added By: LEONEL GONZALEZ at: 9/12/2017 12:29:27 PM    Hi.

It cannot access to ShowAtPos, I am using DX v11.1.

How to customize an old version of the Report Wizard (that was used up to version 13.2)

$
0
0

Important Note: The approach demonstrated in this code example is related to an old version of the Report Wizard that was used up to version 13.2. Starting with version 14.1, a new version of the Report Wizard was introduced, so please refer to the How to customize the New Report Wizard (introduced in the 2014 vol.1 release) in the End-User Designer code example to learn how to customize the new version of the Report Wizard.


This example demonstrates how to create a Custom Report Wizard with the capability to define the SQL query, based on which the resulting report's data source will be generated (see the corresponding suggestion: AS4685).

In order to run you custom wizard in the corresponding handler, override the ReportCommand.NewReportWizard, ReportCommand.AddNewDataSource, and ReportCommand.VerbReportWizard commands (as described in this documentation article: How to: Override Commands in the End-User Designer (Custom Saving). A Custom Report Wizard inherits from the XRWizardRunnerBase class, custom wizard pages are inherited from the InteriorWizardPage class.

Note that for most custom wizard pages, you should override the InteriorWizardPage.OnWizardBack() and InteriorWizardPage.OnWizardNext() virtual methods, to provide proper wizard navigation logic.

Question Comments

Added By: Fernando Minguet at: 9/23/2013 2:51:31 PM    

How download this example for VS2012 and DevExpress 13.1.5

Added By: Troy Patterson at: 11/18/2013 3:31:47 PM    

How do you implement this when you've dropped a Ribbon Report Designer on the form?

Added By: R Williams at: 11/23/2013 3:46:04 AM    

In the code for this example where are the classes WizPageConnectionCustom, WizPageDataOption and WizPageQuery defined?

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.

See also:
Data Source Wizard – How to Replace the Standard Query Builder
Data Source Wizard - How to customize the list of data providers
How to customize an old version of the Report Wizard (that was used up to version 13.2)

Question Comments

Added By: Jon 9 at: 10/23/2014 5:08:13 AM    

Is there any further documentation on how to customize the new report wizard. This sample code would really benefit from some comments... I can see why it has attracted down votes - it isn't really sufficient.

Added By: Ingvar (DevExpress Support) at: 10/23/2014 6:28:50 AM    Hi Jon,

I agree with you that we need to prepare documentation related to our Report Wizard. I have created a separate request and forwarded it to our developers. You can track our progress in the following ticket:
Documentation - Provide informative help topics on how to customize Report Wizard introduced in v14.1Added By: Jon 9 at: 10/23/2014 6:37:12 AM    

Great, thanks! Will look forward to it.

Added By: Scott Bogash 1 at: 12/5/2014 9:19:21 AM    

Can you please update this example to work with v2014 vol 2.3.  Thank you

Added By: Scott Bogash 1 at: 12/30/2014 11:43:37 AM    

Can you please update this example to work with v2014 vol 2.3.  Thank you

Added By: Andrew L (DevExpress Support) at: 12/30/2014 1:09:06 PM    

Hello Scott,

We are working hard on this problem and we will do our best to prepare this sample to work with our next minor release, 2014.2.4.

Added By: Andrew L (DevExpress Support) at: 1/21/2015 1:29:16 AM    

Hello Scott,

We have found an issue in our 2014.2.4 release, which prevents us from publishing the sample. Please install the hot fix provided in the The Wizard Customization example (T140683) cannot be compiled thread and review the updated samples (in that thread).

Added By: Michael Vasiliev at: 3/24/2016 9:19:30 AM    Hi guys.

Can you please tell me how can I create a custom view for custom wizard?
I noticed that the views in the example (ChoosePersonsPageView2) were created  in Designer.
And they have specific controls (DevExpress.DataAccess.UI.Wizard.BackButton).
But I can't find them in Toolbox.Added By: Jannet (DevExpress Support) at: 3/24/2016 10:20:03 AM    

Hello,
To process your recent post more efficiently, I created a separate ticket on your behalf: T360326: How to create a custom view for custom wizard. This ticket is currently in our processing queue and will be addressed shortly.

Added By: Chad at: 4/29/2016 2:19:26 PM    Can you please fix the file Person.vb to remove the New Object cast..

[VB.NET]
PublicFunction GetStaticPersons() As IList(Of Person)ReturnNew List(Of Person)({New Person() With {.FirstName = "John", .SecondName = "Abbot"}, New Person() With {.FirstName = "Paul", .SecondName = "Bass"}, New Person() With {.FirstName = "George", .SecondName = "Chance"}})EndFunction


Added By: Dmitry Tok (DevExpress Support) at: 5/2/2016 4:03:45 AM    

Hello Chad,

Thanks for pointing out this issue to us. 
I have fixed the corresponding part of the provided Code Example per your request. 

ASPxSpreadsheet - How to save and load documents from a database

$
0
0

UPDATED:

This code example demonstrates how to save and restore ASPxSpreadsheet documents from a database using a Binary column.
Starting with version 15.1, we recommend using the ASPxSpreadsheet.Open method to load a document and call the ASPxSpreadsheet.SaveCopy method to save changes.

In version 15.2, it is also possible to handle the ASPxSpreadsheet.Saving event to save a document by clicking the ribbon's built-in Save button.


For Older Versions:
Use ISpreadsheetComponent.LoadDocument to load a document and ISpreadsheetComponent.SaveDocument - to save it.

See Also:
MVC Version:

T190813: Spreadsheet - How to save and load documents from a database

Question Comments

Added By: MILES GIBSON at: 9/14/2017 5:08:30 PM    I am getting the error "Operation is not valid due to the current state of the object" when I try this:

  Dim Mystream As IO.Stream = Nothing
PackoutSpreadSheet.SaveDocument(MyStream, DevExpress.Spreadsheet.DocumentFormat.Xlsx)

The spreadsheet has data in it.  Ideas?
Viewing all 7205 articles
Browse latest View live


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