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

How to horizontally merge cells in VGridControl

$
0
0

This example demonstrates how to create a custom VGridControl and manually paint required cells to merge them horizontally.

Question Comments

Added By: Kinjal Nandu at: 6/10/2016 4:39:54 AM    There seems to be something missing in the code when I try to run it on my machine.
1. The variable  vGridControl1 is not declared anywhere but used in Form1.cs
2. The method CreatePainterCore() is not used anywhere - where is it supposed to be called?
Is there a designer file missing?
Added By: Stas (DevExpress Support) at: 6/10/2016 6:15:59 AM    

Hello,

I've created a separate ticket on your behalf (Specific questions regarding the How to horizontally merge cells in VGridControl example). It has been placed in our processing queue and will be answered shortly.


How to print a report without displaying it in a web application

$
0
0

This example illustrates the approach of printing report document directly, via Adobe PDF web browser plug-in.
This can be done by sending the exported XtraReport document via the Page.Response.OutputStream.Write method, and setting the PdfExportOptions.ShowPrintDialogOnOpen property to True.

See also:
How to print/export XtraReport in an ASP.NET application without showing a report preview

Question Comments

Added By: M Abo Habiba at: 8/28/2013 2:08:29 PM    

can i print it without export to pdf ?

Added By: Alex (DevExpress Support) at: 8/29/2013 2:54:42 AM    

Hi,

The direct printing approach is not supported in a Web application because the web server does not have direct access to the printer installed on the client's machine.

Added By: M Abo Habiba at: 9/2/2013 12:38:48 PM    

I face a problem when i try to print using pdf (Arabic Unicode)
i tried to print it using java script but when page load it show the print dialog before report displayed can detect after print in java script or any way else
thanx

Added By: Alex (DevExpress Support) at: 9/3/2013 1:29:36 AM    

Hi,

If possible, create a separate ticket in Support Center and provide your test application for further examination. We will check for a suitable solution.

Added By: FSzymanska at: 3/5/2014 3:34:09 AM    

Hi,

I have run your example. Everything works fine when English chars are used. But when I put poloish chars like 'ś' , ć' in the report content thay are printed badly. Looks like problem with encoding. Can you please help me?

Added By: M Abo Habiba at: 4/24/2016 9:19:51 AM    i used this example to print put it's appear look like pdf viewer in browser Added By: Dmitry Tok (DevExpress Support) at: 4/25/2016 5:27:42 AM    

Hello,

This behavior depends on the PrintUsingAdobePlugIn property value. Please review the Printing in Web help topic for details.

Thanks,
Dmitry

Added By: Mike Bowen 1 at: 6/10/2016 2:44:54 AM    Are there known issues with this and printing with Microsoft Edge?

The print dlg never shows.
Edge 25.10586
Added By: Vasily (DevExpress Support) at: 6/10/2016 8:02:03 AM    

Hello Mike,  

I've created a separate ticket on your behalf (T390890: How to print a report without displaying it in a web application in Edge browser). It has been placed in our processing queue and will be answered shortly.

ASPxRichEdit - How to save and load documents from a database

$
0
0

This code example demonstrates how to save and restore ASPxRichEdit documents from a database using a Binary column.
Use the ASPxRichEdit.Open method to load a document and call the ASPxRichEdit.SaveCopy method to save changes.

It is also possible to handle the ASPxRichEdit.Saving event to save a document by clicking the ribbon's built-in Save button.

Question Comments

Added By: IS Dept at: 4/16/2016 12:00:03 PM    I get
Error 2 The type or namespace name 'Rtf' does not exist in the namespace 'DocumentFormat' (are you missing an assembly reference?) 

When trying to use this sample

Added By: Jenny (DevExpress Support) at: 4/18/2016 12:41:25 AM    

Hello,

I've created a separate ticket on your behalf (T368691: The type or namespace name 'Rtf' does not exist in the namespace 'DocumentFormat' error occurs). It has been placed in our processing queue and will be answered shortly.

Added By: Sim Joo Siong at: 6/12/2016 8:27:00 PM    Hi Support,

I get the error 'The file is corrupt and cannot be opened'.. at OpenFromByteArrayBtn_Click

how to solve it for that?

I look forward your reply.

Thanks

Added By: Artem (DevExpress Support) at: 6/13/2016 2:14:03 AM    

Hi,

We'll reply to you in the context of the ASPxRichEdit - Unable to open a file as stream thread. Please bear with us.

How to implement unbound rows in PropertyGridControl

$
0
0

By default, unbound rows are not supported by PropertyGridControl. So, you can use VGridControl to display them.
However, PropertyGridControl allows you to provide custom property descriptors via the CustomDescriptors Event. So, you can implement the same functionality by creating a custom property descriptor that will store values for properties that do not present in the selected object.

This example demonstrates how this solution can be implemented.

Question Comments

Added By: Jeterson Miranda Gomes at: 3/31/2016 10:37:38 AM    hello, not find object used for UnboundRowsHelper, please, specify dependences for need for this exampleAdded By: Nikita (DevExpress Support) at: 3/31/2016 11:04:11 AM    Hello,
You can download the example runner and the full compilable sample using the link in the Download section: 

I hope this helps.Added By: Frank Link 3 at: 6/13/2016 2:08:04 AM    Hi,

this example doesn't work correctly because i can't see the new properties.

Can you correct them?

regards
FrankAdded By: Dimitros (DevExpress Support) at: 6/13/2016 5:40:52 AM    

Hello Frank,

To solve the issue, call the RetrieveFields method. 

I've updated this example accordingly.

How to display the dxChart widget in an XAF view

$
0
0

Scenario:
It is necessary to show a chart control with a lot of points. The built-in Charts module draws all points on the same screen at once, which may be inconvenient for an end-user. To achieve better usability, it is possible to implement real-time zooming and scrolling capabilities.

The dxChart widget from the DevExtreme library perfectly fits this scenario. This example demonstrates how to utilize this widget in an XAF application.



Steps to implement:
The approach used in this example is based on the well-known technique of displaying a custom data bound control described in our online documentation: How to: Show a Custom Data-Bound Control in an XAF View (ASP.NET). The example demonstrates how to use this technique with client-side components that do not have server-side implementation. Refer to the following Knowledge Base article for more details and concepts: How to use DevExtreme Widgets in an XAF application.


1. Register client libraries.
Since you need to control the order of referenced client libraries, it is necessary to disable automatic embedding of them using the dedicated option in the application configuration file. This option and the list of client libraries required by our ASP.NET controls are described in our online documentation: Embedding Required Client Libraries.
Disable the embedRequiredClientLibraries option in the YourSolutionName.Web/Web.config file and add required client libraries to the YourSolutionName.Web project using the following commands in the NuGet Package Manager console:
    Install-Package jQuery.Validation.Unobtrusive
    Install-Package Microsoft.jQuery.Unobtrusive.Ajax

    Install-Package ChartJS
    Install-Package jQuery -Version 1.10.0
Library files will be installed into the Scripts and Content directories. Register the required script files in the <head> element of the YourSolutionName.Web/Default.aspx file.

[HTML]
<linkrel="stylesheet"type="text/css"href="Content/dx.common.css"/><linkrel="stylesheet"type="text/css"href="Content/dx.light.css"/><scripttype="text/javascript"src="Scripts/jquery-1.11.3.min.js"></script><scripttype="text/javascript"src="Scripts/jquery.validate.min.js"></script><scripttype="text/javascript"src="Scripts/jquery.validate.unobtrusive.min.js"></script><scripttype="text/javascript"src="Scripts/jquery.unobtrusive-ajax.min.js"></script><scripttype="text/javascript"src="Scripts/globalize/globalize.js"></script><scripttype="text/javascript"src="Scripts/dx.webappjs.js"></script><scripttype="text/javascript"src="Scripts/dx.chartjs.js"></script>


2. Create content.
In the YourSolutionName.Web project, create a custom ASP.NET User Control (*.ascx) and add ASPxPanel to it. This panel will be a container for DevExtreme widgets. It is convenient to keep client-side scripts in a separate file. Add a JavaScript file and declare the createWidgets function in it. Implement this function using the approach described in the Zooming and Scrolling article.

[JScript]
window.DxSample = window.DxSample || {}; window.DxSample.OrdersChart = { createWidgets: function(panel){var $mainElement = $(panel.GetMainElement()); $mainElement.dxChart({..});}};

Using the client-side Init event of the ASPxPanel component, call the createWidgets function passing the first event argument as a parameter.

3. Register your JavaScript files.
In code behind for your UserControl (e.g., YourSolutionName.Web/YourUserControlName.ascx.xx file), handle the UserControl.Load event and call the WebWindow.RegisterClientScriptInclude method to include your JavaScript file into the web page.

4. Load data and pass it to the client side.
To provide data for client-side widgets, use the approach described in the following article: How to: Access Server Data on the Client Side. For this purpose, implement the IComplexControl interface in your UserControl class. Within the IComplexControl.Setup method, load data from the database, convert it into an array of plain objects (you can use anonymous types in C# and VB.NET for this purpose), and add it to the JSProperties dictionary.

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.

How to: Drag-and-Drop GridControl Rows to the TreeList

$
0
0

This example demonstrates how to drag-and-drop rows from the Grid Control to the Tree List control. To support drag-and-drop operations within the GridView, set the ColumnViewOptionsBehavior.EditorShowMode property to either MouseUp or Click. This prevents a cell editor from being opened on the MouseDown event, as this event is used for initialization of drag-and drop operations. To allow the Tree List to accept data dropped onto it, set its AllowDrop property to true.
The TreeList.GetDXDragEventArgsDrag method is used to convert drag event arguments to the DXDragEventArgs type. This allows you to get extended drag-and-drop parameters. The following parameters are used in this example:
- DXDragEventArgsDrag.TagetNode - the target node over which the row is dropped;
DXDragEventArgsDrag.DragInsertPosition - specifies how a node is inserted (as a child, before or after a node, or at the end of the node collection).
The TreeList is bound to a BindingList data source. Nodes are added using the AppendNode method overload, which takes an array of column values as a parameter. The order of values in this array should match the order of the public properties in the data source.

Question Comments

Added By: JJDX at: 8/27/2015 5:07:24 AM    

Hello, could you redone your example to not require VS 2015 or VS 2013 ? I think that many of us still use 2012. Thanks :)

Added By: Sasha (DevExpress Support) at: 8/28/2015 4:12:19 AM    

Hi,
I've updated this example. Please test it and let me know if you can run it with VS 2012 now.

GridView - Batch Editing - A simple implementation of an EditItemTemplate with client-side unobtrusive validation

$
0
0
This example is based  on GridView - Batch Editing - A simple implementation of an EditItem template and describes how to enable  client-side unobtrusive validation: 

1) Wrap the GridView in a form:
[C#]
<formid="myForm">@Html.Action("GridViewPartial")</form>

2) Since GridView is bound to the list of values,  it's necessary to bind the EditItemTemplate editor to an item's model property from this list: 
CS:
[C#]
settings.Columns.Add(column=>{column.FieldName="C1";column.SetEditItemTemplateContent(c=>{Html.DevExpress().SpinEditFor(m=>m.FirstOrDefault().C1,spinSettings=>{spinSettings.ShowModelErrors=true;spinSettings.Properties.ValidationSettings.Display=Display.Dynamic;spinSettings.Width=System.Web.UI.WebControls.Unit.Percentage(100);spinSettings.Properties.ClientSideEvents.KeyDown="C1spinEdit_KeyDown";spinSettings.Properties.ClientSideEvents.LostFocus="C1spinEdit_LostFocus";}).Render();});});

VB:

[VB.NET]
settings.Columns.Add(Sub(column) column.FieldName = "C1" column.SetEditItemTemplateContent(Sub(c) Html.DevExpress().SpinEditFor(Function(m) m.FirstOrDefault().C1, Sub(spinSettings) spinSettings.Name = "C1" spinSettings.ShowModelErrors = True spinSettings.Properties.ValidationSettings.Display = Display.Dynamic spinSettings.Width = System.Web.UI.WebControls.Unit.Percentage(100) spinSettings.Properties.ClientSideEvents.KeyDown = "C1spinEdit_KeyDown" spinSettings.Properties.ClientSideEvents.LostFocus = "C1spinEdit_LostFocus"EndSub).Render()EndSub)EndSub)
3)  The $.valid method in the ASPxClientGridView.BatchEditEndEditing event handler is required  to force validation when a currently edited cell loses focus:
[JScript]
function Grid_BatchEditEndEditing(s, e){var editItemTemplateColumn = s.GetColumnByField("C1");if(!e.rowValues.hasOwnProperty(editItemTemplateColumn.index))return; $("#myForm").valid();var cellInfo = e.rowValues[editItemTemplateColumn.index]; cellInfo.value = C1.GetValue(); cellInfo.text = C1.GetText(); C1.SetValue(null);}

4) The ASPxClientEdit.GetIsValid and ASPxClientEdit.GetErrorText methods allow passing validation information from the editor to GridView cells in ASPxClientGridView.BatchEditRowValidating:
[JScript]
function Grid_BatchEditRowValidating(s, e){var editItemTemplateColumn = s.GetColumnByField("C1");var cellValidationInfo = e.validationInfo[editItemTemplateColumn.index];if(!cellValidationInfo)return; cellValidationInfo.isValid = C1.GetIsValid(); cellValidationInfo.errorText = C1.GetErrorText();}

See Also:
ASPxGridView - Batch Editing - A simple implementation of an EditItem template 
GridView - Batch Editing - A simple implementation of an EditItem template


GridView - Batch Editing - A simple implementation of an EditItem template

$
0
0

This example demonstrates how to create a custom editor inside column's DataItem template when GridView is in Batch Edit mode.

You can implement the EditItem template for a column by performing the following steps:

1. Specify column's EditItem template:

[C#]
       settings.Columns.Add(column=>       {           column.FieldName="C1";           column.SetEditItemTemplateContent(c=>           {               @Html.DevExpress().SpinEdit(spinSettings=>               {                   spinSettings.Name="C1spinEdit";                   spinSettings.Width=System.Web.UI.WebControls.Unit.Percentage(100);                   spinSettings.Properties.ClientSideEvents.KeyDown="C1spinEdit_KeyDown";                   spinSettings.Properties.ClientSideEvents.LostFocus="C1spinEdit_LostFocus";               }).Render();           });       });

2. Handle grid's client-side BatchEditStartEditing event to set the grid's cell values to the editor. It is possible to get the focused cell value using the e.rowValues property:

[JScript]
       function Grid_BatchEditStartEditing(s, e){           var templateColumn = s.GetColumnByField("C1");           if(!e.rowValues.hasOwnProperty(templateColumn.index))               return;           var cellInfo = e.rowValues[templateColumn.index];            C1spinEdit.SetValue(cellInfo.value);           if(e.focusedColumn === templateColumn)                C1spinEdit.SetFocus();       }


3. Handle the BatchEditEndEditing event to pass the value entered in the editor to the grid's cell:

[JScript]
function Grid_BatchEditEndEditing(s, e){           var templateColumn = s.GetColumnByField("C1");           if(!e.rowValues.hasOwnProperty(templateColumn.index))               return;           var cellInfo = e.rowValues[templateColumn.index];            cellInfo.value = C1spinEdit.GetValue();            cellInfo.text = C1spinEdit.GetText();            C1spinEdit.SetValue(null);       }

 

4. The BatchEditRowValidating event allows validating the grid's cell based on the entered value:

[JScript]
function Grid_BatchEditRowValidating(s, e){           var templateColumn = s.GetColumnByField("C1");           var cellValidationInfo = e.validationInfo[templateColumn.index];           if(!cellValidationInfo)return;           var value = cellValidationInfo.value;           if(!ASPxClientUtils.IsExists(value) || ASPxClientUtils.Trim(value) === ""){                cellValidationInfo.isValid = false;                cellValidationInfo.errorText = "C1 is required";           }       }

 
5. Finally, handle the editor's client-side KeyDown and LostFocus events to emulate the behavior of standard grid editors when an end-user uses a keyboard or mouse:

[JScript]
var preventEndEditOnLostFocus = false;function C1spinEdit_KeyDown(s, e){           var keyCode = ASPxClientUtils.GetKeyCode(e.htmlEvent);           if(keyCode === ASPx.Key.Esc){               var cellInfo = grid.batchEditApi.GetEditCellInfo();                window.setTimeout(function(){                    grid.SetFocusedCell(cellInfo.rowVisibleIndex, cellInfo.column.index);               }, 0);                s.GetInputElement().blur();               return;           }           if(keyCode !== ASPx.Key.Tab && keyCode !== ASPx.Key.Enter)return;           var moveActionName = e.htmlEvent.shiftKey ? "MoveFocusBackward" : "MoveFocusForward";           if(grid.batchEditApi[moveActionName]()){                ASPxClientUtils.PreventEventAndBubble(e.htmlEvent);                preventEndEditOnLostFocus = true;           }       }function C1spinEdit_LostFocus(s, e){if(!preventEndEditOnLostFocus) grid.batchEditApi.EndEdit(); preventEndEditOnLostFocus = false;} 

 
See Also:
ASPxGridView - Batch Editing - A simple implementation of an EditItem template 
GridView - Batch Editing - A simple implementation of an EditItemTemplate with client-side unobtrusive validation

Question Comments

Added By: Abdullah Garcia at: 5/14/2015 7:36:56 AM    

Is there any example that uses GridLookup instead of a SpinEdit?

Added By: Mike (DevExpress Support) at: 5/15/2015 12:57:34 AM    

I see you've created a separate ticket with this subject. We'll reply to you there. Please bear with us.

Added By: Saitgalina Albina at: 3/30/2016 11:52:31 PM    Hello! I do the same in my project, but the data is not saved. In HomeController.cs batchValues.Insert.count = 0, batchValues.Update.Coumt = 0, batchValues.DeleteKey.column = 0 always coming.  What could be the reason?  Added By: Mike (DevExpress Support) at: 3/31/2016 12:37:45 AM    Hello,

To process your recent post more efficiently, I created a separate ticket on your behalf: T362286: GridView in Batch Edit Mode - Why BatchValue Count = 0 on Controller. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

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

$
0
0
This example demonstrates how to move GridView rows using buttons or jQuery UI  Draggable and Droppable plug-ins. To keep the order of rows, it is necessary to set up an extra column to store row order indexes. Then, sort GridView by this column and deny sorting by other columns.

See also:
E4582 - How to reorder ASPxGridView rows using buttons or drag-and-drop
Question Comments

Added By: Nishant Jha 1 at: 6/14/2016 11:44:23 AM    Thanks for this example. It helped me a lot.

How to maintain the visibility of components in the End-User Designer

$
0
0

The following example demonstrates how to maintain the visibility of components (such as DataSet and DataAdapter) in the End-User Report Designer for Windows Forms.

To hide a report's associated components together, or list them in the Report Explorer or the Component Tray displayed at the bottom of the Design Panel, use the XRDesignPanel.ComponentVisibility property.

Question Comments

Added By: Sachin Pise at: 6/14/2016 11:47:59 PM    How does this really work? Where to add this form? I want to see the components tray as I use it for copy/ paste of components between reports.

Thanks
Sachin Added By: Vasily (DevExpress Support) at: 6/15/2016 12:39:22 AM    

Hello Sachin,

I've created a separate ticket on your behalf (T392221: How to maintain the visibility of components in the End-User Designer). It has been placed in our processing queue and will be answered shortly.

How to load an excel file to the server using ASPxUploadControl and display its data in ASPxGridView

$
0
0

This example shows how to load an excel file from your computer to the server using ASPxUploadControl and then display its data in ASPxGridView.
To do this, you first need to place the ASPxGridView and ASPxUploadControl controls on a page and, secondly, handle the ASPxGridView.Init event and both the server-side and the client-side ASPxUploadControl.FileUploadComplete events.
After uploading the excel file from your computer, save it in the "~/XlsTables/" directory using the ASPxUploadControl.FileUploadControl event handler on the server-side. You may choose any filename and then save it in the Session["FileName"] object to use later.
In the ASPxGridView.Init event handler you need to check the value of the Session["FileName"] object. If it's null, do nothing. Otherwise create a new DataTable and DataTableExporter objects.

Question Comments

Added By: John Daren Dizon 1 at: 5/11/2015 8:43:46 PM    

So how can I save the data uploaded in the grid into a database?

Added By: Sergi (DevExpress Support) at: 5/12/2015 12:25:35 AM    

Hello,

To process your recent post more efficiently, I created a separate ticket on your behalf: T240435: ASPxGridView How to save data from Excel to a database. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Added By: wael ramadan at: 11/28/2015 5:01:26 AM    

I used this code. Version=14.1.6.0  visual studio 2012 version.,   But it shows a red line under(workbook)      Workbook book = new Workbook();

Added By: Vladimir (DevExpress Support) at: 11/29/2015 11:00:46 PM    

Hello,

To process your recent post more efficiently, I created a separate ticket on your behalf: T318205: How to load an excel file to the server using ASPxUploadControl and display its data in ASPxGridView. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

How to bind the ASPxDataView control to the data source declaratively

$
0
0
To bind the ASPxDataView control to the data source declaratively, use one of the data source controls. Assign its ID to the ASPxDataView.DataSourceID property value and configure the item template to display the data source information in data items.
In this example, the data view is bound to the XmlDataSource control.

See Also:
ASPxDataView — Binding to Data
How to bind the ASPxDataView control to the data source at runtime
How to fill the unbound ASPxDataView control with data items at runtime

How to fill an unbound ASPxDataView control with data items at runtime

$
0
0

Aside from binding to a data source, you can populate the ASPxDataView control with data items manually. 

Data items can be added into the ASPxDataView.Items collection in code behind by using the DataViewItemCollection.Add method. In this case, a custom data object with the required properties should be assigned to the DataViewItem.DataItem property value. The ASPxDataView.Items collection cannot be popularized declaratively.

In this example, an object of an anonymous type with custom data fields is created for each data item. The item template for displaying data items is also created at runtime.


See Also:
ASPxDataView — Binding to Data
How to bind the ASPxDataView control to the data source declaratively
How to bind the ASPxDataView control to the data source at runtime

How to bind the ASPxDataView control to a data source at runtime

$
0
0

To bind the ASPxDataView control to a data source at runtime, use any object that implements the IEnumerable interface such as ADO.NET datasets, data readers (e.g., SqlDataReader, OleDbDataReader), and most collections. Assign the data object to the ASPxDataView.DataSource property value and call the ASPxDataView.DataBind method to bind the control to data.

In this example, a custom data source is created with the Enumerable.Range method. The item template for displaying data items is also created at runtime.


See Also:
ASPxDataView — Binding to Data
How to bind the ASPxDataView control to the data source declaratively
How to fill the unbound ASPxDataView control with data items at runtime

How to save (load) a report definition from a file

$
0
0

This example illustrates how to save a report definition to a REPX file (by using CodeDOM serialization mechanism) and XML file, and then restore the report from any of these files.

NOTE:
Deserialization of reports obtained from untrusted parties can trigger execution of malicious code that can either be directly embedded into the report definition, or contained in an external assembly referenced by the report.
To avoid this, we recommend that you use XML serialization instead of CodeDOM (in this case, reports can be safely deserialized by using the XtraReport.LoadLayoutFromXml method) and prevent any untrusted third-party libraries from becoming available on the server.

ASPxGridView - Cell Merging

$
0
0

The example shows how to implement the cell merge feature for the ASPxGridView control.
You can use the helper class that will perform cell merging for the grouped grid as well.
Please keep in mind that functionality such as row selection, in-place editing and focused row may not work as expected which is understandable.

Question Comments

Added By: Seonkyeong Min at: 5/11/2015 2:23:37 PM    

Hello, This example is not working well.

First Line is complex.

other lines is works.

i wanna attach an image file.
but i cant upload the image because you guys doesn't have upload file function.

Added By: Larry (DevExpress Support) at: 5/12/2015 12:33:07 AM    

Hello,

To process your recent post more efficiently, I created a separate ticket on your behalf: T240441: ASPxGridView - Issue with a cell merging. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Added By: Jay Gamblin at: 5/29/2015 10:41:37 AM    

This does not appear to work with 14.2.5.  I get  'ASPxClientTableFixedColumnsHelper' is undefined

Added By: Anthony (DevExpress Support) at: 6/1/2015 4:28:57 AM    

Hello,

To process your recent post more efficiently, I created a separate ticket on your behalf: T249336: E970 - 'ASPxClientTableFixedColumnsHelper' is undefined. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Added By: Balmukund Shrivastav at: 7/13/2015 12:13:52 AM    

Thanks for the helper class. this functionality is working first time on the page load for ASPxGridView v12.1, but grid get distorted when we try to filter the records. Appreciate if you could provide some help.

Thank you,
Blamukund

Added By: Mike (DevExpress Support) at: 7/13/2015 12:18:28 AM    

Hello Blamukund,

To process your recent post more efficiently, I created a separate ticket on your behalf: T266070: E970 for version 12.1. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Added By: Ivo Michielsen 1 at: 9/22/2015 2:54:32 AM    

Unfortunately I get an error while trying to implement this class. I get the error 'The typename "Rendering" does not exist in the type "DevExpress.Web.ASPxGridView" '. The version used is 15.1.6

Added By: Larry (DevExpress Support) at: 9/22/2015 5:49:14 AM    Hello,

It seems that you have created a separate ticket for this issue. Let's continue discussing this issue in the ASPxGridView - Cell Merging thread.

Added By: Vyacheslav Emelianov at: 6/15/2016 9:26:33 AM    This does not appear to work with 15.2.9.0  I get  this.SetCellVisible is not a function, because the object "this" is Window in 
 
ChangeCellsVisibility: function(row, startIndex, endIndex, display) { 
  var visible = display !== "none";
  for(var i = startIndex; i <= endIndex; i++) {
   if(!row.cells[i])
    break;
   this.SetCellVisible(row.cells[i], visible);
  }
 },

Added By: Helen (DevExpress Support) at: 6/15/2016 11:46:50 AM    

Hello Vyacheslav,

I've created a separate ticket on your behalf (T392595: ASPxGridView - Cell Merging). It has been placed in our processing queue and will be answered shortly.

How to use the FrameNavigationService with the Managed Extensibility Framework (MEF)

$
0
0

The FrameNavigationService allows navigating between Views within a NavigationFrame. This example shows how this service can be used along with the Managed Extensibility Framework (MEF).


In this example, we've defined a custom ViewLocator for the FrameNavigationService. This ViewLocator uses MEF and can load views dynamically from the external libraries. The MainWindow contains a NavigationFrame, which shows a MenuPage view at startup. The MenuPage contains tiles, which invoke a command to navigate to child views when clicked. Each child view contains the Back button for backward navigation.

Question Comments

Added By: RishiSharma at: 5/13/2014 4:47:48 AM    

Hi,

This is the great example but.. Can you please send me some sample where same thing can be implemented with UnitFramework..

Regards
Rishi Sharma

Added By: Ivan (DevExpress Support) at: 5/13/2014 11:28:50 PM    

As I can see, you have posted the same question in the How to use the FrameNavigationService with the Unityframework ticket. We will answer you there.

How to: Build Dock UI According to MVVM Pattern Using IMVVMDockingProperties Interface

How to import large amounts of data into ListView (Example)

$
0
0

See the K18260 KB Article for more information.

See also:
ORM Magic–Importing from any datasource

Note
This example cannot be automatically converted to VB.NET because of the VB.NET compiler limitations. We apologize for any inconvenience...

Question Comments

Added By: Tony Tadros at: 12/11/2012 4:51:05 AM    

Hello Devexpress ,

do yo have any update about such functionality,do you have a plan to create or update current rows from excel as built in in the future

Added By: Dennis (DevExpress Support) at: 2/5/2013 10:55:49 PM    

@Tony: Here is a recent blog post on this functionality:
http://community.devexpress.com/blogs/eaf/archive/2012/12/29/orm-magic-importing-from-any-datasource.aspx

You can find more solutions in www.devexpress.com/issue=AS10553

Added By: Andreas Mummenhoff at: 8/22/2013 7:50:48 PM    

Hello Dennis,

regarding VB conversion and porting to 13.1, here a short guide:

At first you have to fix one line in the C# project to convert it to 13.1
...
RuleSetValidationResult validationResult =
                                    Validator.RuleSet.ValidateTarget(
                                    nestedImportObjectSpace, obj, new ContextIdentifiers(DefaultContexts.Save.ToString()));

After that you can use a converter to create a VB solution.
Then in the VB project Dennis.ImportData, you have to fix the delegate definitions:
...
Public Delegate Function ImportDataDelegate(Of T)(
               ByVal objectSpace As IObjectSpace, <[ParamArray]> ByVal args() As Object) As T

Public Delegate Function ValidateDataDelegate(Of T)(
               ByVal data As T, <[ParamArray]> ByVal args() As Object) As Boolean

and at least you have to be correct in creating a delegate in

Public Shared Function CreateCoolPersonImportDataFromExcelDelegate() As ImportDataDelegate(Of Person)
     Return Function(os As IObjectSpace, args() As Object) As Person
               Throw New NotImplementedException("TODO: you can use the FileHelpers library to ...")
          End Function

End Function

Then the project will run in VB too :-)

Added By: Fernando Minguet at: 6/16/2016 11:34:04 AM    Is this implementation still based on UnitOfWork? I couldn't find any reference to UnitOfWork in the code, as found in K18260.

Per K18260: "...The use of the XAF's ObjectSpace class is not recommended here because it is not as lightweight as the UnitOfWork."

Best Regards,


Viewing all 7205 articles
Browse latest View live