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

How to filter appointments and resources


How to animate tile frames on hovering over with the mouse

$
0
0

Applies to TileControl and TileContainer (WindowsUIView) since only these containers support tile frame animations.


Sometimes it is useful to show only brief data on a tile and show detailed information there on hovering over this tile with the mouse. Tooltips implement a similar idea.

The first thing you may think of is to create two TileItemFrames for the tile:
1st frame: show brief data
2nd frame: show detailed data
Now, you need to switch between frames when the mouse is over the tile and not.

This example demonstrates how to animate tile frames in this way. The FrameHoverHelper class encapsulates all the required functionality. Pass your tile container to FrameHoverHelper's constructor to apply this custom animation.

Bookmarks and Hyperlinks Simple Example

$
0
0
This example demonstrates how to create hyperlinks and bookmarks in code.
A specific phrase in the document is converted to a hyperlink. New bookmark is created and anchored to a specific document hyperlink.
Use the checkboxes and combo edit on the right panel to change the hyperlink and bookmark options: set hyperlink modifier keys, enable highlighting bookmarks in the document, etc.

Bookmarks and Hyperlinks Simple Example

$
0
0
This example demonstrates how to create hyperlinks and bookmarks in code. 
A specific phrase in the document is converted to a hyperlink. New bookmark is created and anchored to a specific document hyperlink.
Use the checkboxes and combo edits on the right panel to change the hyperlink and bookmark options: set hyperlink modifier keys, enable highlighting bookmarks in the document, etc.

How to show warnings using the IDataErrorInfo interface implemented at the data level

$
0
0

Please implement the IDataErrorInfo interface on the data object. Then, pass the text and type of error in the IDataErrorInfo.Error property ( it is possible to easily parse this string). Implement a custom style for the ErrorControl. This element presents the error icon. Modify the ErrorControl style in such a way as to take into account a custom error type and text (use the converter).


Question Comments

Added By: Gavrilo Mumovic 1 at: 10/28/2016 4:54:13 AM    How does this apply to GridControl?Added By: Alexander Rus (DevExpress Support) at: 10/28/2016 8:26:08 AM    

Hi Gavrilo,
I've created a separate ticket on your behalf (T444786: Different validation icons in GridControl when IDataErrorInfo is used). It has been placed in our processing queue and will be answered shortly.

Thanks,
Alexander

Added By: Natasja Patry at: 8/28/2017 5:51:00 AM    Is this also supported by POCO view models?

How to: Use EventToCommand

How to process authenticated requests on the OData service

$
0
0

This example demonstrates how to process authenticated requests on the OData service. The main idea is to override the DataService.OnStartProcessingRequest method and implement authenticated logic in it.

To access this service, use the following credentials:

UserName: John
Password: qwerty

See also:
OData and Authentication – Part 6 – Custom Basic Authentication
Salt (cryptography)
How to send authenticated requests to the OData service
How to: Use the XPO OData V3 Service

Question Comments

Added By: Jay Patel 15 at: 9/24/2013 11:33:27 AM    

I was wondering why this project is not compatible with Visual Studios Ultimate 2010? Thanks

Added By: Joseph Tang 3 at: 10/10/2013 7:57:30 AM    

I used your code with the modification that it would check the AD for authentication. It works. However, it always popup the login window for entering the username and password.

Added By: Pedro Coutinho 1 at: 11/28/2013 3:22:33 AM    

How can i get the userinfo from the database?

Added By: Pedro Coutinho 1 at: 11/29/2013 7:09:31 AM    

How can i retrieve this users from a database?

Added By: George Yoder at: 1/25/2014 1:19:44 PM    

How would you do authentication with sql membership provider????

Added By: Enderson Salas at: 7/29/2014 4:26:35 PM    

This example no compile in  Visual Studio 2013  because some assembly references are missing.

Added By: Nikolai (DevExpress Support) at: 7/30/2014 4:23:50 AM    

Hello,

To process your recent post more efficiently, I created a separate ticket on your behalf: T135174: E4403 is not compiled in Visual Studio 2013. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Added By: PedroPerez at: 7/1/2015 7:56:29 AM    

Hello Dev express team,

Can you please explain me how to get my the user information from our DB, we use  The Profile provider in ASP.NET Membership & Users, and how to integrated to this Authentication process?

************************* YOUR SAMPLE CODE************************
namespace MyDataService {     
public class CustomBasicAuth {          
class UserInfo {             
public string Name { get; set; }             
public string PasswordHash { get; set; }             
public string[] Roles { get; set; }         }          
static UserInfo[]
Users = new[] {             new UserInfo {                 
Name = "John",                 
PasswordHash = "F3U89ry4+MMXyqbbT90tcs18J5Y=",                 
Roles = new[] { "User", "Admin" }             }         };
************************************************************************
My Tables:

aspnet_Users:
UserID
UserName

aspnet_Membership:
UserID
Password (encripted)

aspnet_Roles:
RoleID
RoleDescripcion

aspnet_UsersInRoles:
UserID
RoleID

Regards
Pedro Perez

Added By: Nikolai (DevExpress Support) at: 7/2/2015 1:27:09 AM    

Hello Pedro,

To process your recent post more efficiently, I created a separate ticket on your behalf: T262586: How to select users from DB in authenticated data service. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Added By: Luong Tu at: 11/29/2015 7:24:29 PM    

When I debug this webservice and go to this link http://localhost:65443/MyDataService.svc. It throw an error 'Invalid login or password'. How can I access this service? I don't know how to use UserName: John, Password: qwerty you gave me.

Added By: Nikolai (DevExpress Support) at: 11/29/2015 11:51:43 PM    Hi,

This example is intended for  How to send authenticated requests to the OData service. It demonstrates how to send user credentials to the server side.Added By: Hari Setyawan 2 at: 6/14/2016 3:25:21 AM    How do you connect the authentication with the view html and js and also the data in the database?Added By: Nikolai (DevExpress Support) at: 6/14/2016 6:47:14 AM    

Hello Hari,

I've created a separate ticket on your behalf (T391925: How to implement authentication). It has been placed in our processing queue and will be answered shortly.

Added By: Fernando Gonzalez 2 at: 8/29/2017 10:50:40 AM    Hi,

I've modified the example to run on the latest versions but I can't get the categories from the service. The Authentication works perfectly. I don't know if I have to do somethig else to get the categories?

The error is below:

"An error ocurred while processing the request"

As I can't attach the sample project I don't know how to show us.

Thank's for your help.

How to create a custom Table Of Contents for merged reports with page indexes

$
0
0
This code example illustrates how to create a custom "Table Of Contents" in a separate report.
It is necessary to create links between bricks of merged reports manually, after the reports are merged. Get the required bricks from the report using NestedBrickIterator and use the VisualBrick.NavigationPair property to create a link. To provide page indexes for such links, collect "page" bricks to a separate collection and then modify the VisualBrick.Text property value based on Target.Page.Index.
Question Comments

Added By: Kurt Stricker at: 1/7/2017 12:02:27 PM    This is a great example, thank you. However, try as I might, I cannot get the page number (in addition to the category text) to link to the page. Could you provide an update on how to do that?Added By: Vasily (DevExpress Support) at: 1/9/2017 7:08:55 AM    

Hi Kurt,

This issue is not completely clear to me. The "CreateLinks" method (which is used in this code example to create links) adds the target page number to the brick that displays the page number in the custom table of contents. You can use the same approach to add the page number to the brick that displays the category text.

Added By: Kurt Stricker at: 1/9/2017 7:22:49 PM    Actually, the sample has the category text as the link and not the page number. I've tried adding the Link to the page number by modifying the following in Form1.vb:

If valueString.StartsWith("Link_") Or valueString.StartsWith("PageBrick_") Then

This should set the nativation pair further down in code. However, when I click on the page brick (I've set target and NavigationURL) nothing happens. As an alternative, I've tried using a transparent label that spans the entire row, which didn't work either.Added By: Yaroslav (DevExpress Support) at: 1/10/2017 4:59:02 AM    Thank you for the clarification, Kurt. Please find Dmitry's project in the comments section of the PixelPerfect Report scripting in NPrinting; dynamic table of contents thread for more implementation details (in this sample, a custom document map contains not only category names, but the number of the page where the target content is located as well).
Feel free to contact us in case of further questions.Added By: Scott Gross at: 8/29/2017 10:36:52 PM    This approach does work when the CreateLinks Method is called within the Master (Category) report.

It does not need to be called from outside of the report.

This would be a great feature to have built into the reporting Suite. We have been wanting this feature for a while now.
 

How to reorder ASPxGridView rows using buttons or drag-and-drop

$
0
0

This example demonstrates how to move ASPxGridView rows using buttons or jQuery Drag&Drop.


To keep the order of rows, it is necessary to set up an extra column to store row order indexes. Then, sort ASPxGridView by this column and deny sorting by other columns. This example stores this information in the unbound column and additionally puts a dictionary "row key = row index" to the session. We have implemented this approach only for demo purposes. You can store this information in your DataSource.

Updated:

We updated an example for v.14.2 to show how to save order information to a database and tune the ASPxGridView drag and drop appearance using the UI Draggable and Droppable plug-ins. If you need to check the unbound column  implementation, choose the second item in the version build combo box. 

 

See also:
T191258 - How to reorder GridView rows using buttons or drag-and-drop

E1810: How to use jQuery to drag and drop items from one ASPxGridView to another

E3850: How to reorder ASPxTreeList sibling nodes, using buttons or drag-and-drop
E4299: How to move up or down a line a row of ASPxGridView by using external buttons

Question Comments

Added By: Hiren Joshi (Venture) at: 8/20/2013 3:03:21 PM    

Hello,

I have seen your example however I have a question from user view point. Once you start to drag a row button you don't have any way to tell which row you are dragging. So unless you remember the row to started with it will be diffcult for users to use this practically. Do you have a way to drag the entire row or have a button with some text to identify the row you are dragging? Please let me know if this is possible.

Added By: Jacob Blumberg at: 8/27/2013 4:05:00 PM    

I agree, that is what I am looking for too.

Added By: Hiren Joshi (Venture) at: 9/11/2013 10:54:22 AM    

I was able to use the link tag <a href=""><%#Eval("YourData")%></a> instead of the image; in order to over come the problem of knowing which row is being dragged. So now when I drag the row I can see the text that I am dragging.

Added By: Wouter Stichelbout at: 2/11/2014 7:54:23 AM    

I there an MVC equivalent?

Added By: Vasily (DevExpress Support) at: 2/11/2014 9:48:17 AM    

Hi Wouter,

I have extracted your question to a separate ticket created on your behalf: Q466606: GridView - How to reorder GridView rows using buttons or drag-and-drop.
Your time and cooperation are appreciated.

Added By: Walter Rijk at: 6/23/2014 1:45:25 AM    

Hello,

This approach much more resembles the way Telerik has implemented row dragging and dropping:

       function InitalizejQuery() {
           var openhand = "url(https://mail.google.com/mail/images/2/openhand.cur), move";
           var closedhand = "url(https://mail.google.com/mail/images/2/closedhand.cur), move";

           $('.dxgvDataRow, .dxgvFocusedRow').each(function () {
               $(this).css({ "cursor": openhand });
           });
           $('.dxgvDataRow, .dxgvFocusedRow').draggable({
               helper: function () {
                   var result = $("<table class='dxgvTable' cellspacing='0' cellpadding='0' style='opacity:0.7;background-color:#dddddd;'>").append($(this).clone()).append($("</table>"));
                   $("td", this).each(function (index) {
                       $("td", result).eq(index).css({ 'width': $(this).width() });
                   });
                   return result;
               },
               axis: "y",
               start: function (event, ui) {
                   $("tr", $(this).parent()).each(function (index) {
                       $(this).css({ "cursor": closedhand });
                       $(this).removeClass('dxgvFocusedRow'); // this is the same as removing the focussedrowindex
                       $(this).addClass('dxgvDataRow');
                   });
                   $(this).addClass('dxgvFocusedRow');
               },
               stop: function (event, ui) {
                   $(this).css({ "cursor": openhand });
               }
           });
           $('.dxgvDataRow, .dxgvFocusedRow').droppable({
               drop: function (event, ui) {
                   var draggingRowKey = ui.draggable.find("input[type='hidden']").val();
                   var targetRowKey = $(this).find("input[type='hidden']").val();
                   gridView.PerformCallback("DRAGROW|" + draggingRowKey + '|' + targetRowKey);
               }
               , over: function (event, ui) {
                   var targetRowKey = $(this).find("input[type='hidden']").val();
                   var rowindex = gridView.keys.indexOf(targetRowKey);
                   window.setTimeout(function () { gridView.MakeRowVisibleNew(rowindex); }, 100);
                   $(this).addClass('borderClass');
               }
               , out: function (event, ui) {
                   $(this).removeClass('borderClass');
               }
           });
       }

Best Regards,
Ernstjan Freriks

Added By: Kchouk at: 12/8/2014 2:00:35 PM    

I am having difficulties figuring out how to actually use a field from the datasource to save the sorting order. Any help will be appreciated.

Added By: Artem (DevExpress Support) at: 12/9/2014 12:17:45 AM    

Hello,

To process your post more efficiently, I created a separate ticket on your behalf: T184636: ASPxGridView - How to save sort order to a database using approach from the E4582. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Added By: Gregory Lange 1 at: 4/9/2015 12:28:22 PM    

Just a suggestion you should also make these for where people load data via datasource in the code behind because trying to translate this sometime to that things get messed up.

Added By: Anthony (DevExpress Support) at: 4/9/2015 1:07:37 PM    

Hi Gregory,

You are always welcome to create a support ticket if you have difficulties in implementing approaches from our examples.

Added By: Michael Herron at: 9/2/2015 9:28:02 AM    

This example does not work if used within a MasterPage. Has anyone tried this?

Added By: Artem (DevExpress Support) at: 9/2/2015 1:14:20 PM    

Hello Michael,

To process your recent post more efficiently, I created a separate ticket on your behalf: T285292: E4582 doesn't work if ASPxGridView in on a MasterPage. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Added By: Wendy so at: 9/14/2016 1:31:35 AM    Hi Dev Express Support,

I have go through your example code below, it work fine for my case. But unfortunately after I add second grid view, it not work fine. How to modify the InitalizejQuery() in order to randomly get the current grid view being drag.

Note: I do not drag from one row in one grid view to another grid view. Only drag inside its own grid view.

Appreciated if you can provide me the solution rapidly. Thank you. Added By: Vova (DevExpress Support) at: 9/14/2016 6:53:31 AM    

Hello,

I've created a separate ticket on your behalf (T427213: How to reorder ASPxGridView rows using buttons or drag-and-drop if several ASPxGridViews are placed on the page ). It has been placed in our processing queue and will be answered shortly.

Added By: Petar Kosama at: 10/19/2016 12:41:07 AM    How can I achieve the same thing when using a List as a datasource?

Thanks Added By: Lex (DevExpress Support) at: 10/19/2016 1:34:07 AM    

Hello Petar,

I've created a separate ticket on your behalf (T440888: How to reorder ASPxGridView rows using buttons or drag-and-drop and using List as a data source). It has been placed in our processing queue and will be answered shortly.

Added By: Petar Kosama at: 10/19/2016 3:14:21 AM    I get this exception 

"A potentially dangerous Request.Path value was detected from the client"

Do you have any idea why this might occur? Added By: Lex (DevExpress Support) at: 10/19/2016 3:19:49 AM    

Petar,

To prevent discussing different questions in the same thread, I've created a separate ticket on your behalf (T440956: A potentially dangerous Request.Path value was detected from the client error occurs). It has been placed in our processing queue and will be answered shortly.

Added By: Daniel Connor 1 at: 2/2/2017 4:36:10 PM    Hello,

I followed this example, it works well for the order by when my lines get updated the "Produ ctName" gets empty.

Do you know the reason ?

Thanks ! Added By: Lanette (DevExpress Support) at: 2/2/2017 10:12:32 PM    Hello,

We see thatyou've created a separate Drag and Drop rows ASPxGridView on the ClientSide ticket regarding this problem. We will continue discussing the issue in that thread.Added By: Dimitri R at: 8/30/2017 4:12:52 AM    I need to use ObjectDataSource instead of AccessDataSource.


In the following function I am getting the error when compiling (in my code dsHelper is an ObjectDataSource
):
[C#]
privateintGetKeyIDBySortIndex(ASPxGridViewgridView,intsortIndex){dsHelper.SelectParameters["DisplayOrder"].DefaultValue=sortIndex.ToString();introwKey=(int)(dsHelper.Select(DataSourceSelectArguments.Empty)asSystem.Data.DataView)[0][gridView.KeyFieldName];returnrowKey;}
Error: "Method Select has 0 parameter(s) but is invoked within 1 argument(s) "


ASPxGridListEditor - Reference properties editing in the batch mode

Capability for a single column to fill an empty space in a grid view

$
0
0

We implemented this feature in v17.1. Assign a column to the GridView.AutoFillColumn Property.

[For older versions]
In this example we added a FillEmptySpace option to the GridColumn descendant. Only one column in the grid view can have this option enabled, i.e. if you set the FillEmptySpace property to true for a single column other columns immediately set this option to false themselves. Column with this option enabled now recalculates its width after every layout change in order to fill an empty space in the grid view. This feature won't work if the grid view's option OptionsView.ColumnAutoWidth is enabled.

Question Comments

Added By: Eduardo Ramirez at: 10/28/2014 11:47:25 AM    

Hi folks,

would you mind to attach an example using the code below?

Thanks in advanced.
Eduardo

Added By: Nikita (DevExpress Support) at: 10/29/2014 1:43:16 AM    

Hello,
You can download the project for this example by a link on a right panel (see the screenshot in the attachment). First you have to download the Example Runner, then use this runner to open the *.dxsample file. 
I hope this helps. 

Added By: Simon Hewitt at: 12/17/2015 3:10:30 AM    

Needs a bit of tweaking in RecalculateColumnWidths to exclude summing columns with GroupIndex >= 0 (unless OptionsView.ShowGroupedColumns == true)

Added By: Nadezhda (DevExpress Support) at: 12/17/2015 8:55:00 AM    As far as I understand, your issue has been resolved. Please do not hesitate to contact us in case of any difficulty. We will be happy to help you!Added By: Crealogix AG at: 12/22/2015 12:31:18 AM    

please note:
- doesn't take into account grouped columns
- if the user manually chooses "best fit column" or "best fit all columns" from the context menu, the results are weird.

Added By: Sasha (DevExpress Support) at: 12/22/2015 9:09:02 AM    

Hello,
I've created a separate ticket on your behalf: The 'Capability for a single column to fill an empty space in a grid view' example works incorrectly in certain scenarios . Let us continue our discussion in this thread.

Added By: deyvi saavedra at: 6/5/2016 8:43:35 PM    I am from peru, I want to know how to call the "FillEmptySpace" property and I have the FillGridColumn classes. I leave a picture.
Note: commented lines is correct if or not.
Imagen Added By: Svetlana (DevExpress Support) at: 6/6/2016 2:03:55 AM    

Hello,

I've created a separate ticket on your behalf (T388227: How to make a single column to fill an empty space in a grid view). It has been placed in our processing queue and will be answered shortly.

Added By: Andrew Bingham 2 at: 8/30/2017 11:47:17 PM    
RecalculateColumnWidths is called several times when form is initiallised and when data is loaded - once per column I think.

Is there a ways of avoiding this?

How to: Use Google, Facebook and Microsoft accounts in ASP.NET XAF applications (OAuth2 authentication demo)

$
0
0
This example demonstrates the use of OAuth2 authentication in a web application. Users can sign in to the application via Google, Facebook or  Microsoft authentication providers.


You can try this demo "as is" to overview its capabilities, and then try the demonstrated functionality in your own XAF applications according to the instructions below.


How to Run this Demo

Before running this demo, register developer accounts at the services you are going to use:
https://console.developers.google.com/
https://developers.facebook.com/
https://apps.dev.microsoft.com/ 

Open the Web.config file and specify your own client IDs and client secrets for each provider.

[XML]
<appSettings><addkey="GoogleClientID"value="YourGoogleClientID"/><addkey="GoogleClientSecret"value="YourGoogleClientSecret"/><addkey="FacebookClientID"value="YourFacebookClientID"/><addkey="FacebookClientSecret"value="YourFacebookClientSecret"/><addkey="MicrosoftClientID"value="YourMicrosoftClientID"/><addkey="MicrosoftClientSecret"value="YourMicrosoftClientSecret"/>

You can remove keys corresponding to providers that you do not want to use. 


Now you can run the application.


Overview of this Demo Capabilities


In the logon window, there are buttons for each provider specified in Web.config:


Standard XAF authentication with built-in username/password is also supported. When you log in via OAuth authentication, the email is used as a user name. By default, a user object is autocreated for each logon. You can disable autocreation, or specify the auto-assigned role for new users in the InitializeComponent method (see WebApplication.cs(vb)):
[C#]
this.securityStrategyComplex1.NewUserRoleName="Default";((AuthenticationStandartWithOAuth)authenticationBase).CreateUserAutomatically=true;
[VB.NET]
Me.securityStrategyComplex1.NewUserRoleName = "Default"CType(authenticationBase, AuthenticationStandartWithOAuth).CreateUserAutomatically = True
When CreateUserAutomatically is false, the logon is allowed if a user with the email returned by the external service exists in the application database. To grant access to a user with a specific e-mail, use the built-in Admin account, create a user object and set the UserName to this e-mail.



If you set the EnableStandardAuthentication property to true for an auto-created user, this user will be able to login directly, with a user name and password. Note that the password is empty by default, so do not forget to specify it when enabling standard authentication.



Each user can have several associated email addresses. To add or remove email addresses, use the  OAuth Authorization Emails list in the user's Detail View.



How to Implement the Demonstrated Functionality in your XAF Application
 

1. In your solution, open Package Manager Console.
  1.1. Choose the YourSolutionName.Web project in the Default project combo box, and execute the following commands to add Owin packages:
  Install-Package Microsoft.Owin -Version 3.1.0
  Install-Package Microsoft.Owin.Security -Version 3.1.0
  Install-Package Microsoft.Owin.Security.Cookies -Version 3.1.0
  Install-Package Microsoft.Owin.Host.SystemWeb -Version 3.1.0
  Install-Package Microsoft.Owin.Security.Google -Version 3.1.0
  Install-Package Microsoft.Owin.Security.Facebook -Version 3.1.0
  Install-Package Microsoft.Owin.Security.MicrosoftAccount -Version 3.1.0
  1.2. Switch to the YourSolutionName.Module.Web project and install these two packages:
  Install-Package Microsoft.Owin -Version 3.1.0
  Install-Package Microsoft.Owin.Host.SystemWeb -Version 3.1.0

2. Open the Web.config file and specify your own client IDs and client secrets for each provider you are going to use. Refer to the AuthenticationOwin.Web\Web.config file in the demo solution to see the example. Then, set the authentication mode to "None" and comment or remove settings related to the default XAF authentication:
[XML]
<authenticationmode="None"/><!--<forms name="Login" loginUrl="Login.aspx" path="/" timeout="10" />--></authentication><!--<authorization><deny users="?" /><allow users="*" /></authorization>-->

3. Copy the following files from the demo solution to the corresponding locations within your solution:
- AuthenticationOwin.Module\AuthenticationStandartWithOAuth.cs(vb)
- AuthenticationOwin.Module\IAuthenticationOAuthUser.cs(vb)
- AuthenticationOwin.Module.Web\Controllers\LogonAuthController.cs(vb)
- AuthenticationOwin.Module.Web\Security\CustomSecurityStrategyComplex.cs(vb)
- AuthenticationOwin.Module.Web\Controllers\LogonAuthController.cs(vb)
- AuthenticationOwin.Module.Web\Images\Facebook.svg
- AuthenticationOwin.Module.Web\Images\Google.svg
- AuthenticationOwin.Module.Web\Images\Microsoft.png

- AuthenticationOwin.Web\Startup.cs(vb)
AuthenticationOwin.Web\LogonTemplateContent1.ascx
AuthenticationOwin.Web\LogonTemplateContent1.ascx.cs(vb)
AuthenticationOwin.Web\LogonTemplateContent1.ascx.designer.cs(vb)
Include the copied files to your solution (Add | Existing Item...). Update the namespace names in the copied code files to match namespaces you use in your solution. For image files, set the Build Action property to Embedded Resource.

4. Edit the YourSolutionName.Module\Module.cs file. In the overridden Setup method, handle the XafApplication.CreateCustomLogonWindowControllers event and add the LogonAuthController to the e.Controllers collection passed to this event. Refer to the AuthenticationOwin.Module.Web\Module.cs(vb) file to see an example.

5. Edit the YourSolutionName.Web\WebApplication.cs(vb) code and register this custom security strategy:
[C#]
this.securityStrategyComplex1=newAuthenticationOwin.Module.Web.Security.CustomSecurityStrategyComplex();
[VB.NET]
Me.securityStrategyComplex1 = New AuthenticationOwin.Module.Web.Security.CustomSecurityStrategyComplex()

6. Implement the IAuthenticationOAuthUser interface in your custom user class. You can see an example in the AuthenticationOwin.Module\BusinessObjects\OAuthUser.cs file. If you use the built-in user, you can copy the OAuthUser class to your project from the demo and set the SecurityStrategy.UserType property to OAuthUser in the Application Designer.

7. Change the code that creates your predefined users in YourSolutionName.Module\DatabaseUpdate\Updater.cs. Set EnableStandardAuthentication to true for users who can login with standard authentication (username and password). See the example in the AuthenticationOwin.Module\DatabaseUpdate\Updater.cs file.

8. Register the LogonTemplateContent1.ascx template in the YourSolutionName.Web\Global.asax.cs file:
[C#]
WebApplication.Instance.Settings.LogonTemplateContentPath="LogonTemplateContent1.ascx";
[VB.NET]
WebApplication.Instance.Settings.LogonTemplateContentPath = "LogonTemplateContent1.ascx"

9. Copy the LoginWith* actions customizations and the AuthenticationStandardLogonParameters_DetailView layout settings from the AuthenticationOwin.Module.Web\Model.xafml file to the same file in the YourSolutionName.Web project. If you have no model customizations in Model.xafml, you can just overwrite it with the file from demo.


Tip: You can refer to the OWIN OAuth 2.0 Authorization Server documentation to learn how to add more authentication providers.

Question Comments

Added By: Scott Gross at: 7/14/2017 8:43:09 AM    Will this work with XAF Mobile as well?Added By: Konstantin B (DevExpress) at: 7/16/2017 11:07:04 PM    We haven't yet tested this approach with XAF Mobile. However, we will consider including the mobile app project to this demo. I've created a separate ticket on your behalf (T536304: OAuth2 authentication in XAF Mobile). It has been placed in our processing queue and will be answered shortly.Added By: Rik Pronk at: 8/1/2017 6:41:49 AM    In the sample project, I noticed some errors in the web.config file. Below 'For applications with a security system' the <Authentication> tag is used, but that's supposed to be the <authorization> tag instead.Added By: Konstantin B (DevExpress) at: 8/1/2017 8:49:03 AM    Hello Rik,

Your comment is correct, we have updated this demo. Thanks!  Added By: Martin Svärd at: 8/31/2017 3:40:34 AM    Hi Konstantin,

I am not able to try this example, even though I register it with Microsoft.
Am I missing something?
And will this work with Microsoft Azure as well, or is it only Microsofts non O365 accounts?

How to generate a filter set based on DataLayoutControl

$
0
0

In this example, we use the FilteringBehavior class to generate a set of filters based on the metadata type. The metadata type is specified using the SourceType property.

[XAML]
<dx:FilteringBehaviorSourceType="{x:Type local:PersonFilteringViewModel}"/>


The way properties are edited is configured using the following attributes.

- FilterBooleanChoice

[C#]
[FilterBooleanChoice()]publicboolHasCar{get;set;}

 



- FilterDateTimeRange

[C#]
[FilterDateTimeRange("MinBirthDate","MaxBirthDate")]publicDateTimeBirthDate{get;set;}

 



- FilterRange

[C#]
[FilterRange("MinAge","MaxAge",EditorType=RangeUIEditorType.Range)]publicintAge{get;set;}

 



- FilterLookup

[C#]
[FilterLookup("NumberOfChildren")]publicintChildren{get;set;}

 

 

Important: In this example, we used the grid's FilterCriteria property and disabled grid-level filtering. If you want to use FilteringBehavior without losing the possibility of filtering data in your grid (using the Filter Dropdown, Filter Editor, etc.), bind the FixedFilter property instead:

[XAML]
<dxg:GridControlItemsSource="{Binding ListPerson}"AutoGenerateColumns="AddNew"FixedFilter="{Binding Path=FilterCriteria, ElementName=filteringBehavior}">

How to create a simple filtering UI for GridControl with nested properties

$
0
0

This example demonstrates how to create a simple filtering UI for GridControl. The main idea is to use the special FilteringBehavior which can be integrated to DataLayoutControl. First thing you need to do is to bind your GridControl.FilterCriteria property to the FilteringBehavior.FilterCriteria property to synchronize their current filter expressions. Then, you are required to set the object whose properties will be displayed and edited by your DataLayoutControl. To achieve this, set the DataLayoutControl.CurrentItem property to the FilteringBehavior's FilteringViewModel property. After that, create the required layout of items in your DataLayoutControl and bind them to corresponding properties of your view model. Note that you can use DataAnnotation attributes for properties in your view model to specify which controls will be used in your DataLayoutControl.
Also, FilteringBehavior provides the capability to filter the nested object's properties. All you need is to bind the required DataLayoutItem to a corresponding nested property. You will see this in action in the current example.

 

Important: In this example, we used the grid's FilterCriteria property and disabled grid-level filtering. If you want to use FilteringBehavior without losing the possibility of filtering data in your grid (using the Filter Dropdown, Filter Editor, etc.), bind the FixedFilter property instead:

[XAML]
<dxg:GridControlx:Name="myGrid"Grid.Column="1"ItemsSource="{Binding Orders}"FixedFilter="{Binding Path=FilterCriteria, ElementName=filteringBehavior}">


See also:
How to generate a filter set based on DataLayoutControl

How to generate bands based on a collection in a ViewModel


How to bind ASP.NET MVC Dashboard to an Entity Framework Data Source (Runtime sample)

$
0
0

The following example shows how to add the Entity Framework data source to the Web Dashboard's list of data sources available to end-users. In this example, the DashboardEFDataSource class is used to establish a connection to the Entity Framework data source.

How to create custom theme for DXTabControl

$
0
0

This example shows how to customize main visual elements of the DXTabControl by overriding styles. 

You can read an article that describes this approach: KA18580: How to modify DX themes in WPF Refer to it for more information.

Update

In the 15.1 release, we introduced new customization capabilities. Refer to the T245606 example to learn more.

Question Comments

Added By: Jeffrey A. Mazur at: 3/22/2013 8:39:17 AM    

You've got to be joking. (FYI, I was referred to this page from Q430835, as was the poster of that question.) I cannot believe the audacity it takes to just point someone in the direction of a massive block of code with no comments or explanatory text, leaving paying users to fend for themselves, having to wade through reams of documentation to extract the definition and proper use of dozens of classes themselves.

The mentality of tool builders is infantile in its selfishness. No other group of "professionals" has such a blatant disregard for the needs of their customers. "Oh, well, the code is self-explanatory" just doesn't cut it - we paid lots of money for your product to SAVE OURSELVES TIME, not to shift our burden from one labyrinthine puzzle to another.

So how about a brief explanation of what the heck is going on here in this code?

Added By: Andrey K (DevExpress Support) at: 12/26/2014 7:16:16 AM    Hello Jeffrey,

We accidentally discovered that your initial post was out of scope of our Support Center for a long time. Please accept our sincere apologies for not responding in a timely manner.I've created a separate ticket on your behalf regarding the task you've mentioned in your message to process it more efficiently: T191241: How does the E3168 example work

If this task is still important for you, please find a couple of minutes to refer to that thread.

Thanks,
AndreyAdded By: vinaya kumar at: 9/4/2017 4:29:39 AM    Hi,

Could you please modify the above  attached example (q401061.zip) for Dev-Express 16.2 version dlls.

It will be a great help if you provide the solution at the earliest

Regards
Vinaya

How to export a report to MHT format

How to export a report to HTML format

How to export a report to RTF format

Viewing all 7205 articles
Browse latest View live


Latest Images

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