This example is now obsolete. The most up-to-date approach is available in the How to: Customize a Window Caption and How to: Customize Window Status Messages help topics.
See also:
How to add items with images to the Status Bar (WinForms)
This example is now obsolete. The most up-to-date approach is available in the How to: Customize a Window Caption and How to: Customize Window Status Messages help topics.
See also:
How to add items with images to the Status Bar (WinForms)
This example illustrates the specifics of using Criteria Property Editors in an XAF application. The complete description is available in the How to: Use Criteria Property Editors help topic.
Note: In this example, the SessionMixingException may occur if you refresh a list view filtered by criteria with object references. Several workarounds for this issue are provided in the E932 - object belongs to a different session after refresh filter with Business Entity ticket. The issue will be eliminated once the CollectionSourceBase - Refresh objects referenced by the applied criteria when the Object Space is reloaded suggestion is implemented.
See Also:
How to dynamic change the ObjectType Criteria Property Editors
Hello,
The idea is great but the most usefull fielter don't work. This filter, as example, can be created but when executed don't work because a popup window that should appear so the user can fill the desired name is not poped up.
Contains([FirstName], ?)
Thanks,
Marco Castro
Hello Douglas,
I've found that you already submitted a ticket with this question - T532838 - How to add more custom functions to PopupCriteriaPropertyEditor. We will answer you there.
@Sławomir: I've created a separate ticket on your behalf (T603628: Based on E932, how to save the current grid filter as a new FilteringCriterion object). It has been placed in our processing queue and will be answered shortly.
IMPORTANT NOTE
This article describes some advanced customization techniques and low-level entities of the framework with regard to data access, which may be required in complex scenarios only.
So, if you just want to change the connection string, e.g. to use the Oracle instead of the Microsoft SQL Server database, then you would better refer to the Connect an XAF Application to a Database Provider article and documentation on your database provider instead. The XAF integration of supported ORM libraries is also described in the Business Model Design section of the framework's documentation.
Introducing IObjectSpaceProvider and IObjectSpace
XAF accesses data from a data store through special abstractions called - IObjectSpaceProvider and IObjectSpace.
The IObjectSpace is an abstraction above the ORM-specific database context (e.g., the DBContext used in Entity Framework or the Session in XPO) allowing you to query or modify data.
The IObjectSpaceProvider is a provider/creator of IObjectSpace entities, which also manages which business types these IObjectSpace are supposed to work with, how to set up the underlying connection to the database, create and update it and other low level data access options.
Image may be NSFW.
Clik here to view.
An XafApplication can use one or several IObjectSpaceProvider objects at the same time, and you can access this information through the XafApplication.ObjectSpaceProvder or XafApplication.ObjectSpaceProviders properties. Check out these help links to learn more on how to plug in custom IObjectSpaceProvider objects a well.
There are several built-in implementations of the IObjectSpaceProvider and IObjectSpace interfaces in our framework, which are usually specific to a target ORM (Entity Framework or XPO). I suggest you check out the source code of the default framework classes to better understand the role of the IObjectSpaceProvider:
...\DevExpress.ExpressApp.Xpo\XPObjectSpaceProvider.cs
...\DevExpress.ExpressApp.EF\EFObjectSpaceProvider.cs
Typical customization considerations
You may want to provide a fully custom IObjectSpaceProvider implementation or inherit from the built-in implementors when you want to customize how data access is performed for a chosen ORM.
Below is a list of typical scenarios where a custom IObjectSpaceProvider may be required:
1. How to use XPO caching in XAF
2. How to prevent altering the legacy database schema when creating an XAF application
3. How to connect to remote data store and configure WCF end point programmatically
4. How do I map persistent classes to another schema, e.g. other than the default "dbo" in MS SQL Server?
5. How to use a custom ObjectSpace throughout the application by handling the CreateCustomObjectSpaceProvider event?
6. How to connect different ORM data models to several databases within a single application
7. How to customize the Object Space behavior in XPO-based XAF applications
8. How to customize the UnitOfWork behavior in XPO-based XAF applications
In most cases, it is not required to implement the IObjectSpaceProvider interface from scratch since you can inherit from existing implementors or customize/just their parts.
XPO-specific customizations
1. Implementing IXpoDataStoreProvider
For instance, in XPO one of such replaceable parts is the IXpoDataStoreProvider interface, which enables you to provide a custom or configured IDataStore object, which is used for underlying data access with this ORM:
[C#]publicinterfaceIXpoDataStoreProvider{IDataStoreCreateWorkingStore(outIDisposable[]disposableObjects);IDataStoreCreateUpdatingStore(outIDisposable[]disposableObjects);IDataStoreCreateSchemaCheckingStore(outIDisposable[]disposableObjects);stringConnectionString{get;}}
In its turn, XAF provides several ready to use implementations of this interface for most popular scenarios:
1. ConnectionDataStoreProvider - can provide IDataStore by the IDbConnection object;
2. ConnectionStringDataStoreProvider - can provide IDataStore by just connecting string information;
3. MemoryDataStoreProvider - DataSet based in-memory IDataStore providers.
Technically, such an IXpoDataStoreProvider part is passed into the XPObjectSpaceProvider constructor as a parameter, which means that you can just customize it instead of re-implementing the whole XPObjectSpaceProvider logic:
[C#]//In your XafApplication descendant class (e.g., in the YourSolutionName.Win/WinApplication.cs file).protectedoverridevoidCreateDefaultObjectSpaceProvider(CreateCustomObjectSpaceProviderEventArgsargs){args.ObjectSpaceProvider=newXPObjectSpaceProvider(newMyIXpoDataStoreProvider(args.ConnectionString,args.Connection,false),true);args.ObjectSpaceProviders.Add(newNonPersistentObjectSpaceProvider(TypesInfo,null));}
You can find IXpoDataStoreProvider implementation examples in the following articles:
How to use XPO caching in XAF
How to prevent altering the legacy database schema when creating an XAF application
Refer to the ...\DevExpress.ExpressApp.Xpo\XPObjectSpaceProvider.cs file within the XAF source code to better understand the role of this part.
2. Handling the DataStoreCreated event of ConnectionDataStoreProvider and ConnectionStringDataStoreProvider
Instead of creating your own IXpoDataStoreProvider from scratch, it is often simpler to explicitly create a ConnectionDataStoreProvider or ConnectionStringDataStoreProvider instance (an IXpoDataStoreProvider implementer) and subscribe to its DataStoreCreated event (available starting with version 17.2). The event arguments (DataStoreCreatedEventArgs) expose the DataStore and Destination parameters that provide access to the current data store and its type (SchemaChecking, Updating or Working). Refer to the How do I map persistent classes to another schema, e.g. other than the default "dbo" in MS SQL Server? example for more details.
3. Overriding XPO connection or database providers
To learn more on this approach, check out the Database Systems Supported by XPO help topic and How to create a custom XPO connection provider and then use it in an XAF application article in particular. To learn more on customizing data access settings for XPO, please refer to the corresponding product documentation: Data Access Layer.
Is this intended to contain an empty example resource?
Added By: Dennis (DevExpress Support) at: 9/16/2015 11:46:15 AMYes. This article originally contained an example, but it is now more like a KB article.
Added By: Rejoice Supsup at: 9/16/2015 12:00:10 PMThank you for the quick reply. But I thought this might be misleading since it's categorized as an example. Should I expect that you're be providing an example in the future? If I may suggest, what about 2 databases:
#1 - Departments and Employees
#2 - Customers and Orders
Where #1 is integrated with the Security Module and #2 (used by XAF Win Forms) to manage CRM data but will be authenticated via DB #1.
Added By: Dennis (DevExpress Support) at: 9/16/2015 12:16:34 PMThe category is to be changed in the future as the main purpose of this article is to describe the main concepts.
There are already multiple examples mentioned in this article - see under the "Typical customization considerations" section (no plans for new examples so far). I hope you find them helpful to implement your particular scenario. Should you have any further difficulties with your own implementation, please submit a separate ticket and attach your sample showing what you tried to do and what did not work as expected. Thanks.
Our GridControl, as well as any standard control, does not directly work with physical files. There are many reasons for this. For example, it is not possible to get notifications when some part of a physical file is changed. Thus, it will be necessary to reload the entire file each time the GridControl content needs to be refreshed. Also, to save each change made in GridControl, it will be necessary to access this file again. Thus, dealing with physical files directly will be very slow.
Starting with version 15.2, ExcelDataSource is available, which allows extracting data from Microsoft Excel workbooks or CSV files. For more information about it, please review the Binding to Excel Data Sources documentation topic.
If you are using an older version, you can populate a DataSet with data from an Excel file and then bind the grid control to this DataSet. To do this, you can use the Microsoft OLE DB Provider for Microsoft Jet.
These solutions are described in the following articles:
Microsoft OLE DB Provider for Microsoft Jet
Import Excel File to DataSet - CodeProject
This example demonstrates this approach in action.
This example demonstrates how to handle a double-click on a grid row or cell. Since GridControl can be in one of two states - editable or non editable, it is necessary to use different approaches for each state. Please refer to the How to handle a double-click on a grid row or cell article to learn implementation details.
This worked perfectly for me. However, now the double-click on the column width indicator is not functioning and I have no idea how to get it back! Basically, I stripped this down to just this:
Private Sub GridViewHistory_DoubleClick(sender As Object, e As System.EventArgs) Handles GridViewHistory.DoubleClick
Dim view As GridView = CType(sender, GridView)
Dim pt As Point = view.GridControl.PointToClient(Control.MousePosition)
Dim info As GridHitInfo = view.CalcHitInfo(pt)
If info.InRow OrElse info.InRowCell Then
GridControlHistory_Click(sender, New System.EventArgs)
Dim colView As ColumnView = GridControlHistory.FocusedView
Dim rhFound As Integer = view.FocusedRowHandle
If rhFound >= 0 Then
Call Edit_Record(colView, rhFound)
End If
Else
'NEED CODE HERE TO REPLACE THE COLUMN DOUBLECLICK EVENT
End If
End Sub
Any ideas?
This example illustrates how to add editors within EditFormTemplateContainer of ASPxGridView programmatically by implementing the ITemplate interface.
Custom editors are added onto the edit form by creating a custom edit form template. In this example, a template is created as a descendant of the ITemplate interface in the EditFormTemplate.cs file. The template is populated with content using the InstantiateIn method. The Update and Cancel edit form's regular buttons are kept within the custom edit form using Template Replacements (the ASPxGridViewTemplateReplacements object).
The edit form template is attached to the grid in the Page Load event handler. The edit form template's content can be accessed at runtime using the FindEditFormTemplateControl method. It receives a control's ID as a parameter and returns the control if it exists within the edit form template.
See also:
ASPxGridView - How to load UserControl within EditFormTemplate at runtime
Could you add some comments? It takes unnecessarily long from a devexp-noob to parse what is going on.
Added By: Lisa Bencic at: 11/28/2017 8:05:23 AM This whole topic fails when you have a detail inside a master, you cannot reference the (child) grid view during Page Load like that. Most solutions I am looking at (to Hide a field during Edit but not during New) do not work for that reason.Added By: Lex (DevExpress Support) at: 11/28/2017 9:49:38 PMHello Lisa,
I've created a separate ticket on your behalf (T581934: ASPxGridView - Master-Detail - How to hide a certain field in the detail grid's edit form when it is created at runtime). It has been placed in our processing queue and will be answered shortly.
This example illustrates how to automatically send a report via e-mail. To do this, a report should first be exported into one of the available formats. In this example, a report is exported to PDF, since this format provides the best output quality (the PDF result is as close to a report's print result as possible).
See also:
- How to send a report as HTML in an email body
Hi,
I am getting the following error when the button is clicked. For your information, i am executing this logic in XAF viewcontroller SimpleAction button execute event
Error sending a report.
System.Exception: Null object cannot be converted to a value type. ---> System.Exception: Null object cannot be converted to a value type. ---> System.InvalidCastException: Null object cannot be converted to a value type.
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
at System.Convert.ChangeType(Object value, Type conversionType)
at DevExpress.XtraReports.UI.XRSubreport.ApplyParameterBindings()
at DevExpress.XtraReports.UI.XRSubreport.OnBeforePrint(PrintEventArgs e)
at DevExpress.XtraReports.UI.XRControl.GetPrintableBrick(XRWriteInfo writeInfo)
at DevExpress.XtraReports.UI.XRControl.WriteContentTo(XRWriteInfo writeInfo)
at DevExpress.XtraReports.UI.Band.GenerateContent(DocumentBand docBand, Int32 rowIndex, Boolean fireBeforePrint)
at DevExpress.XtraReports.UI.Band.GenerateContentAndDecompose(DocumentBand docBand, Int32 rowIndex, Boolean fireBeforePrint)
at DevExpress.XtraReports.UI.Band.CreateDocumentBand(Int32 rowIndex, RootDocumentBand rootDocBand, PageBuildInfo pageBuildInfo)
at DevExpress.XtraReports.UI.DetailBand.CreateDocumentBand(Int32 rowIndex, Int32 rowCount, RootDocumentBand rootDocBand, PageBuildInfo pageBuildInfo)
at DevExpress.XtraReports.Native.Printing.DetailWriterBase.WriteDetailCore(PageBuildInfo pageBuildInfo)
at DevExpress.XtraReports.Native.Printing.DetailWriterBase.Write(DocumentBand rootBand, PageBuildInfo pageBuildInfo)
at DevExpress.XtraReports.Native.Printing.DocumentBuilder.GetBand(DocumentBand rootBand, PageBuildInfo pageBuildInfo)
at DevExpress.XtraPrinting.Native.DocumentBand.GetBand(PageBuildInfo pageBuildInfo)
at DevExpress.XtraPrinting.Native.PageHeaderFooterRowBuilderBase.CanProcessDetail(DocumentBand rootBand, PageBuildInfo pageBuildInfo)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPageForBands(DocumentBand rootBand, RectangleF bounds, ProcessBandsDelegate process)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillReportDetails(DocumentBand rootBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageHeaderFooterRowBuilderBase.FillReportDetailsAndFooter(DocumentBand rootBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPage(DocumentBand rootBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPageRecursive(DocumentBand rootBand, DocumentBand docBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageHeaderFooterRowBuilderBase.FillPageRecursive(DocumentBand rootBand, DocumentBand docBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPageForBandCore(DocumentBand rootBand, RectangleF bounds, RectangleF newBounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPageForBand(DocumentBand rootBand, RectangleF bounds, RectangleF newBounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPageForBands(DocumentBand rootBand, RectangleF bounds, ProcessBandsDelegate process)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillReportDetails(DocumentBand rootBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageHeaderFooterRowBuilderBase.FillReportDetailsAndFooter(DocumentBand rootBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPage(DocumentBand rootBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPageRecursive(DocumentBand rootBand, DocumentBand docBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageHeaderFooterRowBuilderBase.FillPageRecursive(DocumentBand rootBand, DocumentBand docBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPageForBandCore(DocumentBand rootBand, RectangleF bounds, RectangleF newBounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPageForBand(DocumentBand rootBand, RectangleF bounds, RectangleF newBounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPageForBands(DocumentBand rootBand, RectangleF bounds, ProcessBandsDelegate process)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillReportDetails(DocumentBand rootBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageHeaderFooterRowBuilderBase.FillReportDetailsAndFooter(DocumentBand rootBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPage(DocumentBand rootBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPageRecursive(DocumentBand rootBand, DocumentBand docBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageHeaderFooterRowBuilderBase.FillPageRecursive(DocumentBand rootBand, DocumentBand docBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPageForBandCore(DocumentBand rootBand, RectangleF bounds, RectangleF newBounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPageForBand(DocumentBand rootBand, RectangleF bounds, RectangleF newBounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPageForBands(DocumentBand rootBand, RectangleF bounds, ProcessBandsDelegate process)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillReportDetails(DocumentBand rootBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageHeaderFooterRowBuilderBase.FillReportDetailsAndFooter(DocumentBand rootBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPage(DocumentBand rootBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPageRecursive(DocumentBand rootBand, DocumentBand docBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageHeaderFooterRowBuilderBase.FillPageRecursive(DocumentBand rootBand, DocumentBand docBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPageForBandCore(DocumentBand rootBand, RectangleF bounds, RectangleF newBounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPageForBand(DocumentBand rootBand, RectangleF bounds, RectangleF newBounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPageForBands(DocumentBand rootBand, RectangleF bounds, ProcessBandsDelegate process)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillReportDetails(DocumentBand rootBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageHeaderFooterRowBuilderBase.FillReportDetailsAndFooter(DocumentBand rootBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPage(DocumentBand rootBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageBuildEngine.Build()
at DevExpress.XtraPrinting.Native.PageBuildEngine.BuildPages(DocumentBand rootBand, Boolean clearGroupingInfo)
--- End of inner exception stack trace ---
at DevExpress.XtraPrinting.PrintingSystemBase.OnCreateDocumentException(ExceptionEventArgs args)
at DevExpress.XtraPrinting.Native.PageBuildEngine.RaiseCreateDocumentException(Exception exception)
at DevExpress.XtraPrinting.Native.PageBuildEngine.BuildPages(DocumentBand rootBand, Boolean clearGroupingInfo)
at DevExpress.XtraPrinting.Native.DocumentHelper.BuildPagesCore()
at DevExpress.XtraPrinting.Native.DocumentHelper.BuildPages()
at DevExpress.XtraPrinting.Native.PrintingDocument.BuildPages()
at DevExpress.XtraPrinting.Native.PrintingDocument.End(Boolean buildPagesInBackground)
at DevExpress.XtraPrinting.PrintingSystemBase.End(Boolean buildPagesInBackground)
at DevExpress.XtraReports.UI.XtraReport.CreateDocumentCore(PrintingSystemBase ps, Single progressRange, Boolean buildPagesInBackground)
at DevExpress.XtraReports.UI.XtraReport.CreateDocument(Single progressRange, Boolean buildPagesInBackground, Boolean suppressClearDataContext)
at DevExpress.XtraReports.UI.XtraReport.TryCreateDocument(Single progressRange, Boolean buildPagesInBackground, Boolean suppressClearDataContext)
--- End of inner exception stack trace ---
at DevExpress.XtraPrinting.PrintingSystemBase.OnCreateDocumentException(ExceptionEventArgs args)
at DevExpress.XtraReports.UI.XtraReport.TryCreateDocument(Single progressRange, Boolean buildPagesInBackground, Boolean suppressClearDataContext)
at DevExpress.XtraReports.UI.XtraReport.CreateIfEmpty(Single progressRange, Boolean buildPagesInBackground)
at DevExpress.XtraReports.UI.XtraReport.ExportToPdf(Stream stream, PdfExportOptions options)
at DevExpress.XtraReports.UI.XtraReport.ExportToPdf(Stream stream)
at Solution6.Module.vcPayroll.SimpleAction1_Execute(Object sender, SimpleActionExecuteEventArgs e) in E:\My Docs\Projects\Solution6\Code\Solution6.Module\BusinessObjects\10 Payroll\Payroll Run\vcPayroll.vb:line 179
The error happens at this line
report.ExportToPdf(mem)
Added By: Ingvar (DevExpress Support) at: 10/21/2015 1:28:10 AMHello,
To process your recent post more efficiently, I created a separate ticket on your behalf: T302655: NullReferenceException when trying to apply solution described in E16. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.
This example binds a GridControl to a collection of custom Record objects and demonstrates the following features:
- Assigning an inplace editor (combo box) to a column
- Specifying a column's display name and data format by applying DataAnnotation attributes to Record class properties
- Two ways of changing cell values - at the data source and grid level.
- Highlighting cell values that meet a condition
GridView does not cache values of an unbound column, because it is impossible to determine when the cache should be cleared automatically. GridView just displays values provided by the CustomUnboundColumnData event. So, to display a specific value in a cell, you need to pass a corresponding value to the e.Value parameter based on a processed column and row. What you return as the e.Value parameter is what is displayed in GridView. Each time a cell needs to be updated, the CustomUnboundColumnData event is called.
This example demonstrates how a simple caching mechanism can be implemented. In this project, you can perform all supported operations with GridView, such as sorting/deleting/adding records, and the unbound column will display proper values. This is because values of the ID column are used as key values. This column is read-only and contains only unique values. So, rows can be always identified.
You can also use the GridColumn.UnboundExpression property to specify and unbound expression. Please refer to the Unbound Columns help article for additional information.
When using code I get following error
Error 1 'InitializeComponent' is not declared. It may be inaccessible due to its protection level. C:\Users\Boris\AppData\Local\Temporary Projects\WindowsApplication1\Form1.vb 32 13 WindowsApplication1
Error 2 'gridControl1' is not declared. It may be inaccessible due to its protection level. C:\Users\Boris\AppData\Local\Temporary Projects\WindowsApplication1\Form1.vb 34 13 WindowsApplication1
Error 3 'gridView1' is not declared. It may be inaccessible due to its protection level. C:\Users\Boris\AppData\Local\Temporary Projects\WindowsApplication1\Form1.vb 38 37 WindowsApplication1
Error 4 Handles clause requires a WithEvents variable defined in the containing type or one of its base types. C:\Users\Boris\AppData\Local\Temporary Projects\WindowsApplication1\Form1.vb 44 156 WindowsApplication1
Please advice
i tried but was not sucessfull when is this
Private Sub gridView1_CustomUnboundColumnData(ByVal sender As Object, ByVal e As DevExpress.XtraGrid.Views.Base.CustomColumnDataEventArgs) Handles gridView1.CustomUnboundColumnData
If e.IsGetData Then
e.Value = _Cache.GetValue(e.Row)
End If
If e.IsSetData Then
_Cache.SetValue(e.Row, e.Value)
End If
End Sub
called do and how
Hi are there any examples of this using an xpcollection of xpobjects as the datasource?
Added By: Dimitros (DevExpress Support) at: 1/6/2015 3:24:00 AMHello Johnathon ,
To process your recent post more efficiently, I created a separate ticket on your behalf: T193371: Unbound column - how to use with XPCollection. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.
Hi, I tried implementing this but the method gridView1_CustomUnboundColumnData is never triggered with IsSetData = true.
Only IsGetData is triggered.
In this regard, I found https://www.devexpress.com/Support/Center/Question/Details/CB65344
So, is this sample not correct or is there a way to get the IsSetData to work?
Hello,
To process your recent post more efficiently, I created a separate ticket on your behalf: How to set the CustomColumnDataEventArgs.IsSetData property to true . This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.
Here is an example illustrating the implementation of the MyCache class. Select it in the combo box as shown below:
Currently, the TreeList extension only allows node insertion (a modification of the current node's parent node).
This example demonstrates how to implement node reordering and also provides the implementation of custom reorder/insert icons.
Here is how you can implement this scenario:
- Get all of the sibling nodes of the node that is currently being dragged and calculate its bounds in the client-side ASPxClientTreeList.StartDragNode event handler.
- Ensure that the mousemove handler is attached to the document object. In the client-side mousemove event handler, check whether it is possible to reorder/insert nodes and change the reorder/insert image.
- In the client-side ASPxClientTreeList.EndDragNode event handler, get the e.htmlEvent object and see if reordering is possible. If so, set the e.cancel property to false and perform a custom callback to the TreeList extension.
In order to check whether it is possible to reorder nodes, iterate through the neighboring nodes' bounds you've saved in the StartDragNode event handler. In order to get the current cursor position, use the ASPx.Evt.GetEventX and ASPx.Evt.GetEventY methods.
In order to get the drag & drop image, use the GetDragAndDropNodeImage method of the ASPxClientTreeList object. Note that this is private API, so we do not guarantee that we will not change it in our further releases. Even though in the case of the GetDragAndDropNodeImage method it is hardly possible that we will change it, I still encourage you to test this solution while upgrading to the next releases.
Node reorder functionality limitation: It is not possible to keep a custom order of the nodes when the control is sorted by any column. Thus, it is necessary to disable the sorting functionality via the TreeListSettings.SettingsBehavior.AllowSort property.
See also:
How to reorder ASPxTreeList sibling nodes, using buttons or drag-and-drop
ASPxTreeList - How to implement node reordering - WebForms Version
This example demonstrates how to setup a grid so that it initially doesn't have a focused row. The focused row becomes highlighted once you click any.
If you want not to highlight the focused row at all, remove the code from the GridFocusedRowHighlightHelper.View_MouseDown event handler. Note that you can manually toggle the focused row indication by using the GridFocusedRowHighlightHelper.SetFocusedRowIndication method.
The example for older versions demonstrates how to setup a grid so that it doesn't have a focused row at all.
See Also:
How to remove row selection highlighting when the GridControl loses focus
Currently, the ASPxTreeList control only allows node insertion (a modification of the current node's parent node).
This example demonstrates how to implement node reordering and also provides the implementation of custom reorder/insert icons.
Here is how you can implement this scenario:
- Get all of the sibling nodes of the node that is currently being dragged and calculate its bounds in the client-side ASPxClientTreeList.StartDragNode event handler.
- Ensure that the mousemove handler is attached to the document object. In the client-side mousemove event handler, check whether it is possible to reorder/insert nodes and change the reorder/insert image.
- In the client-side ASPxClientTreeList.EndDragNode event handler, get the e.htmlEvent object and see if reordering is possible. If so, set the e.cancel property to false and perform a custom callback to the ASPxTreeList control via the ASPxClientTreeList.PerformCallback method.
In order to check whether it is possible to reorder nodes, iterate through the neighboring nodes' bounds you've saved in the StartDragNode event handler. In order to get the current cursor position, use the ASPx.Evt.GetEventX and ASPx.Evt.GetEventY methods.
In order to get the drag & drop image, use the GetDragAndDropNodeImage method of the ASPxClientTreeList object. Note that this is private API, so we do not guarantee that we will not change it in our further releases. Even though in the case of the GetDragAndDropNodeImage method it is hardly possible that we will change it, I still encourage you to test this solution while upgrading to the next releases.
Node reorder functionality limitation: It is not possible to keep a custom order of the nodes when the control is sorted by any column. Thus, it is necessary to disable the sorting functionality via the ASPxTreeList.SettingsBehavior.AllowSort property.
See also:
How to reorder ASPxTreeList sibling nodes, using buttons or drag-and-drop
TreeList - How to implement node reordering - MVC Version
This example is a simplified implementation of the DXDocs demo that illustrates how to create a file thumbnail based on the first page of the document.
The ASPxFileManager.CustomThumbnail event is used for defining a custom value for the FileManagerItem.ThumbnailUrl property. Since this solution does not provide a cashing mechanism, previews are generated on each request. To increase application performance, refer to the FileSystemService class of the DXDocs demo.
Important Note:
The Document Server product license is required for using this approach. Please refer to the Subscriptions page for more information.
This example shows how to implement a simplified version of the responsive side bar from our online Bootstrap demos.
The required layout is implemented in the following files:
1. "Shared/Site.master"
This is a Master Page where the basic web site layout is implemented. It also contains the side bar element:
[ASPx]<uc:SideBarrunat="server"id="SideBar"/>
To enable responsive layout, add references to the following styles:
- bootstrap.min.css;
- navBarLayout.css - this file includes required CSS rules for this layout;
Also, the following scripts are required:
- jQuery;
- site.js - this file contains the required JavaScript code.
You can also include the desired icon font there.
2. "Shared/SideBar.ascx"
This is a User Control which implements the side bar element. It is created using the BootstrapTreeView control. Make sure that the ID of this control is set to "navTreeView" and the ClientIDMode is set to "static": this ID is used in the CSS classes. To collapse the side bar like in our demos, handle the client-side BootstrapClientTreeView.NodeClick event and call the onSideBarNodeClick function in it. This function hides the side bar depending on window size.
This example illustrates how to pass filter values to a parameter. The initial master filter state is set manually on page loading.
To obtain changed master filter values, handle the ASPxClientDashboard.ItemMasterFilterStateChanged event. Pass these values to the dashboard parameter using the ASPxClientDashboard.GetParameters method.
To assign default master filter values, use the Dashboard State. Refer to the Web Dashboard - How to specify a dashboard state manually in code example for more information about this approach.
See also:
How to specify dashboard parameter values on the client side in the ASP.NET Dashboard Control