Quantcast
Viewing all 7205 articles
Browse latest View live

How to add the "Open a new tab" button to DXTabControl

This example demonstrates how to add the "Open a new tab" button to DXTabControl.

Update: Starting from version 15.1, TabControl supports this functionality out of the box. Please refer to this article for more details: Adding and Removing Tab Items (update the example description).


How to add a PickerColumn to a GridControl

This example demonstrates how to implement the grid's PickerColumn whose items are coming from the grid's underlining data source.

In this example, a grid is bound to a collection of the Order objects. Each order contains information about a customer (the CustomerId property). A customer is represented by a Customer object that has the Id and Name properties. Customer objects are stored in an IList collection (however, it can be any object that implements the IEnumerable interface). The following properties of the PickerColumn object are set to show customer names for orders in this column within the grid (see the MainPage.xaml file):

FieldName– an order's property to be bound to a column (CustomerId).
ItemsSource– a collection of customers.
ValueMember– a customer’s property used to associate a customer with an order (Id).
DisplayMember– a customer’s property to be displayed in a column (Name).

Report Server - How to get the list of available reports and display a report preview in a WPF application

ASPxGridView - How to implement cascading comboboxes in Batch Edit mode

The concept of cascading combo boxes requires sending a callback to the server to get data for the second editor based on the first editor's selected value. 
In the meantime, it's impossible to send callbacks for built-in editors and it's necessary to use the EditItemTemplate (see ASPxGridView - Batch Edit - Support a scenario when GridViewComboBoxColumn is used in callback mode).
A basic scenario of this approach requires the following steps:
1) Use the client-side ASPxClientGridView.BatchEditStartEditing  and ASPxClientGridView.BatchEditEndEditing  events  to provide the template combo box with values.
2) Handle the SelectedIndexChanged event to send callbacks if it's required.
3) Handle the ASPxClientComboBox.EndCallback event for the second editor to apply the selected item after a callback.
4) Handle the ASPxClientGridView.Init  and ASPxClientGridView.EndCallback events  to initialize and reset global variables responsible for data providing logic after the grid was refreshed. 
 
The attached example illustrates how to implement all these steps.

Question Comments

Added By: umesh patel 1 at: 8/19/2014 11:34:15 PM    

Dear sir
Binding City Editor , if i have more then 400,000 cities need to be bind, Shall i used same binding concept of i used linqservermodedatasource for the binding to increase performance. Can you please send me sample project how can i use linqservermodedatasouce.  
Thanks for your time

Added By: Artem (DevExpress Support) at: 8/20/2014 6:41:34 AM    

Hello,

To process your recent post more efficiently, I created a separate ticket on your behalf: T142172: ASPxGridView - How to implement cascading comboboxes bound to a large data in Batch Edit mode . This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Added By: umesh patel 1 at: 8/20/2014 11:01:37 PM    

in CITY edittor inside GridViewDataComboBoxColumn , EditItemTemplate instead of ASPxComboBox i can use aspxlookup becuase i want to provide user to search item based on incremental search

Umesh

Added By: Artem (DevExpress Support) at: 8/20/2014 11:57:38 PM    

Hello,

To avoid discussing multiple topics in this thread, I created a separate ticket on your behalf: T142423: ASPxGridView - Batch Edit - How to use ASPxGridLookup bound to a large database with incremental filtering in EditItemTemplate. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Added By: Zoltán Gelencsér at: 6/23/2015 5:23:30 AM    

Dear Support Team,

I've integrated this solution into my project.
It is working well but I have little (huge) problem with it.
If I use Enter key to move cursor from the column to the next column, which is a cascased combobox, and I'm fast and I use 2 times Enter key the combobox value is shown and cleared and the focused column is the next column after combobox.

I've analyzed the code.
The OnBatchEditStartEditing set value of Combobox but the PerformCallback of combobox clears it.
In client side event endcallback I reset it back to the original value. It is working well if I do not leave the combobox column fast.

I hope you have solution for this problem.

Best Regards,

Zoltán

GridView - Batch Edit - How to calculate unbound column and total summary values on the fly

This example illustrates how to calculate unbound column and total summary values on the fly. It combines the following two examples: GridView - Batch Edit - How to calculate values on the fly and GridView - How to update total summaries on the client side in Batch Edit mode

ASP.NET Web Forms Example:
ASPxGridView - Batch Edit - How to calculate unbound column and total summary values on the fly


Question Comments

Added By: Bong Choon Fatt at: 6/23/2015 3:09:53 AM    

How do u refresh the total if user delete the row? it is deleting row will raise the BatchEditEndEditing event?

Added By: Larry (DevExpress Support) at: 6/23/2015 5:32:44 AM    

Hello,

To process your recent post more efficiently, I created a separate ticket on your behalf: T258932: GridView - Batch Edit - How to detect when the delete button is clicked. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

How to prevent removing a Master object being referenced by other objects and containing an aggregated Details collection when the Deferred Deletion feature is turned off

This example demonstrates how to implement your classes, to save the referential integrity of your tables when removing master objects being referenced by other objects. This solution is appropriate when you have the Deferred Deletion feature of XPO turned off. Without the code in this example, you will get an SQLException. This solution will allow you to provide your users with more meaningful exceptions, when such a situation takes place.

The Master object in this example has an aggregated One-To-Many relationship to Child objects. If a Master object has some aggregated children, it can be immediately deleted with all associated Child objects. However, if there is a Neighbour object, having a reference (without association) to this Master object, the code will raise an exception, notifying about existing referencing objects.

See Also:
Core - Introduce an automatic check to the deleting algorithm whether an object is referenced by any other object
Deferred deletion and (foreign key) exception handling

RibbonForm - How to display ribbon page headers in the form's caption in the OfficeUniversal style

This example illustrates how to display ribbon page headers in the form's caption in the OfficeUniversal style
Image may be NSFW.
Clik here to view.
Question Comments

Added By: Justin Zeng at: 6/23/2015 2:58:15 AM    

OK, Thanks, I got it.

Added By: Mark Callahan at: 6/23/2015 7:28:38 AM    

this sample but with Office2013 style ?. thanks

How to post values to the DXGrid DataSource immediately after changing a cell value

To post values immediately, subscribe to the CellValueChanging event and call the View.PostEditor method.

If you don't want to handle events, check the E4155 - How to make GridControl immediately save changes in a cell after editing example demonstrating how to create a custom helper that does the entire job automatically.

UPDATE: Starting with version 15.1, you can use the DataViewBase.EnableImmediatePosting property to post values to a data source without leaving an edited cell.


How to make GridControl immediately save changes in a cell after editing

This example shows how to update GridControl's data source right after a cell editor value has been changed. To implement this scenario, we created a custom helper class exposing the CommitHelper.CommitOnValueChanged attached property.

This example uses the same idea as the one demonstrated in the E1801 - How to post values to the DXGrid DataSource immediately after changing a cell value thread. If you don't want to use custom helpers, check the solution from the E1801 example instead.

UPDATE: Starting with version 15.1, you can use the DataViewBase.EnableImmediatePosting property to post values to a data source without leaving an edited cell.

Question Comments

Added By: (no info) at: 9/6/2012 12:10:03 PM    

Great example.
One thing to note --> It may be necessary to call view.ActiveEditor.EditValue = view.Grid.GetCellValue(e.RowHandle, e.Column); after the call to view.PostEditor(); to display the value that was actually stored. The problem here is, the value that actually gets stored doesn't get displayed to the user. The call to GetCellValue will show the user the value that was actually persisted.

Added By: Gregory Colton at: 9/25/2013 9:16:28 AM    

I am getting a error stating that CommitOnValueChanged was not found in CommitHelper. Event the Example has the same error. The CommitHelper class does not have a method called CommitOnValueChanged either. Am I missing something? As it sits the example won't even compile.

Added By: Puneet Lulla at: 3/10/2014 11:37:35 PM    

Even i am getting the same problem like Gregory Colton. Please provide some assistance as soon as possible

Added By: Jaap Vliet at: 9/24/2014 2:11:00 AM    

Works only in a Tableview, but easy to edit for a Treelistview

Added By: Alexander S (DevExpress Support) at: 9/24/2014 3:57:35 AM    Hi Jaap,
Since TreeListView.CellValueChanging and GridViewBase.CellValueChanging are different events, the suggested helper is not universal. And yes, it can be easily adopted to work with TreeListView. The following code is more universal:
[C#]
classCommitHelper{publicstaticreadonlyDependencyPropertyCommitOnValueChangedProperty=DependencyProperty.RegisterAttached("CommitOnValueChanged",typeof(bool),typeof(CommitHelper),newPropertyMetadata(CommitOnValueChangedPropertyChanged));publicstaticvoidSetCommitOnValueChanged(GridColumnBaseelement,boolvalue){element.SetValue(CommitOnValueChangedProperty,value);}publicstaticboolGetCommitOnValueChanged(GridColumnBaseelement){return(bool)element.GetValue(CommitOnValueChangedProperty);}privatestaticvoidCommitOnValueChangedPropertyChanged(DependencyObjectsource,DependencyPropertyChangedEventArgse){GridColumnBasecol=sourceasGridColumnBase;if(col.View==null)Dispatcher.CurrentDispatcher.BeginInvoke(newAction<GridColumnBase,bool>((column,subscribe)=>{ToggleCellValueChanging(column,subscribe);}),col,(bool)e.NewValue);elseToggleCellValueChanging(col,(bool)e.NewValue);}privatestaticvoidToggleCellValueChanging(GridColumnBasecol,boolsubscribe){if(!(col.ViewisDataViewBase))return;if(subscribe){if(col.ViewisTreeListView)(col.ViewasTreeListView).CellValueChanging+=TreeCellValueChanging;else(col.ViewasGridViewBase).CellValueChanging+=GridCellValueChanging;}else{if(col.ViewisTreeListView)(col.ViewasTreeListView).CellValueChanging-=TreeCellValueChanging;else(col.ViewasGridViewBase).CellValueChanging-=GridCellValueChanging;}}staticvoidTreeCellValueChanging(objectsender,TreeListCellValueChangedEventArgse){if((bool)e.Column.GetValue(CommitOnValueChangedProperty))(senderasDataViewBase).PostEditor();}staticvoidGridCellValueChanging(objectsender,CellValueChangedEventArgse){if((bool)e.Column.GetValue(CommitOnValueChangedProperty))(senderasDataViewBase).PostEditor();}}
Added By: Arjan Douwes 1 at: 1/13/2015 3:53:16 AM    

This sample has a serious perfromance issue when there are many columns in a grid.
The current implementation causes the event to be called as many times as there are columns in the grid.
To resolve this issue add e.Handled = true to the TreeCellValueChanging and GridCellValueChanging eventhandlers.

The original code:
if ((bool)e.Column.GetValue(CommitOnValueChangedProperty))
               (sender as DataViewBase).PostEditor();

becomes:
if ((bool)e.Column.GetValue(CommitOnValueChangedProperty))
{
    (sender as DataViewBase).PostEditor();
    e.Handled = true;
}

Added By: Alexander Rus (DevExpress Support) at: 1/13/2015 5:09:53 AM    Hi Arjan,
Thank you for your suggestion. We have updated our example according to it.

Thanks,
Alexander

How to allow ComboBoxEdit to select multiple items with the autocomplete feature

By default, ComboBoxEdit allows you to select one item using the autocomplete feature.

This example provides a way to enable the behavior when the autocomplete feature works for multiple item selection.

Firstly, it is necessary to create a ComboBoxEdit descendant and override the CreateEditStrategy method, which should return your own ComboBoxEditStrategy class descendant.

Then, override and implement the ProcessChangeText method, and some more methods to enable item auto-searching selection.

For unimpeded search and selection of items without losing input field focus, the set FocusPopupOnOpen property to False.

UPDATE:  In 15.1, we provided this feature out of the box. Please refer to this thread to get more information: Q561698: Provide ComboBoxEdit incremental search functionality

How to display appointments in Agenda View by using the DXGrid for WPF component

The Agenda view is a list of upcoming events grouped by the appointment's date. This list can be displayed in the GridControl component.

This example demonstrates how to implement this behavior.

Please see "Implementation Details" (click the corresponding link below this text) to learn more about technical aspects of this approach implementation.

How to make the scheduler take the entire container content

This example demonstrates how to make the ASPxScheduler take the entire container content. The scheduler lies inside the ASPxSplitter control. It automatically changes height depending on the window size.
The height is calculated on the client side. Then, the calculated value is applied to the ScrollAreaHeight property of the Day ViewWork-Week View and Full Week View and 
to the DateCellBody property of the Month View.
Review the How to: Set the Scheduler's Size article to get more information about these properties.

How to use the ExpressionEditorForm as a stand-alone control

This example demonstrates how to embed the ExpressionEditorForm into the PanelControl and provide a functionality to apply expressions to unbound GridColumns.

Question Comments

Added By: Paul Weiss at: 7/10/2013 8:38:43 PM    

Does this work for Silverlight? I'd like to use the expression editor stand-alone in Silverlight.

Added By: Anders Wang at: 6/24/2015 12:53:08 AM    

Hi,
The GridControl in the sample always no data can be showned. Please correct the example. Thanks.

Added By: Uriah (DevExpress Support) at: 6/24/2015 2:06:39 AM    Hi Anders,

Thank you for pointing us to this problem. The example uses the Access database, which does not support x64 applications. I have fixed the problem by setting the Platform target option to x86 in the project properties.

OBSOLETE - GridView - How to implement remote validation based on the unobtrusive JavaScript validation

Starting with DevExpress 14.1, the ASP.NET MVC GridView extension fully supports the unobtrusive client validation for built-in edit forms. Refer to the Support unobtrusive validation for the GridView's built-in edit form thread to learn more.

If you have version v14.1+ available, consider using the built-in functionality instead of the approach detailed below.
If you need further clarification, create a new ticket in our Support Center.

This example illustrates how to implement Remote Validation in the context of the GridView's edit form. We use the approach illustrated in the E3744 - OBSOLETE - How to enable unobtrusive validation for GridView using the EditForm template code example as a starting point because it is necessary to process Update button click in a custom manner to handle remote validation correctly. Here is the major code part that accomplish this task:
[JScript]
   function UpdateGridView(s, e){        PrepareValidationScripts();       var form = $('#frmProduct');       var validator = $.data(form[0], 'validator');        validator.form();       var timer = window.setInterval(function(){           if(form.data('validator').pendingRequest > 0)               return;            clearInterval(timer);           if(validator.valid())                GridView.UpdateEdit();       }, 100);   }

How to display custom controls instead of the standard cell editor

This example demonstrates how to display custom controls instead of a cell's in-place editor.
• If an end-user tries to edit a cell located in the "Order Date" column of a worksheet table, the DateEdit control is displayed, so that the user can select the required date in the drop-down calendar.
• If the end-user tries to edit a cell in the "Category" column of a table, the ComboBoxEdit appears allowing the user to select one of predefined values.
• And finally, if the end-user activates a cell located in the "Discount" column, the CheckEdit control is displayed. It gives the user the true/false option to apply a 10% discount to the total amount.
Image may be NSFW.
Clik here to view.

To implement this behavior, subscribe to the SpreadsheetControl.CellBeginEdit event that is raised before the cell editor is activated, and then use the SpreadsheetControl.GetCellBounds method to obtain boundaries of the currently edited cell. Cell boundaries are defined by an instance of the System.Drawing.Rectangle class. Display the custom control over the cell editor by assigning the returned rectangle to the Control.Bounds property to specify the custom control's size and location.

ASPxCardView - How to update an external control during a callback

By default, the ASPxCardView works during callbacks and there's no way to update an external control (that isn't a child control of the callback owner) on the server side. The following article describes this limitation in detail.
The Concept of Callbacks
This example covers both the JSProperties feature of the ASPxCardView that allows passing a value from the server to the client and the client-side EndCallback event, which is raised each time a callback is executed successfully.
It is possible to set a JSProperty on the server, get it on the EndCallback, and change the "target" control using its client-side capabilities.
This example illustrates how to use the ASPxLabel to identify that the grid was successfully updated. 

How to apply conditional formatting to Grid cells using the Value format condition

The Value format condition (FormatConditionValue) allows you to compare dimension/measure values with predefined static values.
This example demonstrates how to apply conditional formatting to Grid cells whose values are greater than, less than or between the specified values.

How to filter selected / unselected ASPxGridView's DataRows

The example demonstrate how to filter ASPxGridView's DataRows based on the Selection state. The outside ASPxComboBox editor performs a custom ASPxGridView callback and determines the filtering mode. ASPxGridView's FilterExpression is combined via the InOperator / GroupOperator objects - special types for data filtering.

See Also:
DevExpress.Data.Filtering Namespace

Question Comments

Added By: John Daren Dizon 1 at: 6/25/2015 1:44:00 AM    

how to use the filtering when there is a composite key for a grid?

Added By: Vladimir (DevExpress Support) at: 6/25/2015 2:37:07 AM    

Hello,

To process your recent post more efficiently, I created a separate ticket on your behalf: ASPxGridView - How to filter our only selected/unselected rows in case of a composite key. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

How to apply conditional formatting to Grid cells using the Top-Botton and Average format conditions

The Top-Bottom (FormatConditionTopBottom) format conditions allow you to highlight a specific number of topmost/bottommost values. This example shows how to apply conditional formatting to the specified number of top/bottom values. The number of values can be specified as an absolute value or a percentage of all values.
The Average format condition (FormatConditionAverage) is used to highlight values above or below an average value.

How to programmatically fill a PDF Form with values

Viewing all 7205 articles
Browse latest View live


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