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

Tutorial - Creating a registration form using ASPxEditors

$
0
0

This solution is created to illustrate the steps described in the Creating a registration form using ASPxEditors. Introduction tutorial series.


The solution consists of the following projects:

ASPxEditorsTutorial.Part1 - The resulting project for the Creating a registration form using ASPxEditors. Part 1 - Create the registration form layout article

ASPxEditorsTutorial.Part2 - The resulting project for the Creating a registration form using ASPxEditors. Part 2 - Customizing editors and adding built-in client-side validation article

ASPxEditorsTutorial.Part3 - The resulting project for the Creating a registration form using ASPxEditors. Part 3 - Adding a Cascading Combo Boxes feature article

ASPxEditorsTutorial.Part4 - The resulting project for the Creating a registration form using ASPxEditors. Part 4 - Saving data to database article

ASPxEditorsTutorial.Part5 - The resulting project for the Creating a registration form using ASPxEditors. Part 5 - Implementing the password verification mechanism article

ASPxEditorsTutorial.Part6 - The resulting project for the Creating a registration form using ASPxEditors. Part 6 - Checking the entered email address article


Question Comments

Added By: Bharat Lakhani 1 at: 10/8/2014 9:35:25 AM    

Thanku  Very Much for u r Prompt and correct reply All doubts are clears

Added By: Larry (DevExpress Support) at: 10/8/2014 10:14:13 AM    You are always welcome!

How to track changes made to persistent objects, and write them into a separate table

$
0
0

The OnSaving and OnDeleting method of the persistent objects can be overridden to log create/update/delete actions into a separate table. This example demonstrates the basic implementation of this feature.

Note: eXpressApp Framework have built-in module for Audit purposes. This example demonstrates how to use this module in non XAF application: How to use XAF Audit Trail module outside XAF.

Question Comments

Added By: Mohammed Al-Atari at: 10/8/2014 4:29:24 PM    

what about view record?
do you have code to get the below events
View
Login
Invalid Login
View List

Added By: Alexey (DevExpress Support) at: 10/9/2014 12:05:10 AM    

Hello,

To process your recent post more efficiently, I created a separate ticket on your behalf: T159303: Audit application events. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

How to create the "select all" check box dynamically

$
0
0

UPDATED:

Starting with version v2014 vol 1 (v14.1), this functionality is available out of the box:
S173621: ASPxGridView - Add the built-in SelectAll CheckBox for Command Column

Simply set the GridViewCommandColumn.SelectAllCheckboxMode property to GridViewSelectAllCheckBoxMode.AllPages to activate it. Please refer to the ASP.NET: GridView Select All Rows Updated blog post and the Select All Rows demo for more information.

This sample illustrates how to add the "select all" check box dynamically within the HeaderCaptionTemplateContainer of the command column using the ITemplate interface.

Question Comments

Added By: Nathan Price at: 6/6/2012 11:01:56 AM    

In my project I have serveral fields that i do not wish to share on my page but i must have them. The visibility is set to false. When I insert your sample code into my project all invisible fields are now visible. Also the order of the fields on the gridview is altered and this is not prefferable. Thanks for your time.

ASPxGridLookup - How to implement the multiple selection DropDownWindow scenario

$
0
0

This example demonstrates how to use the ASPxGridLookup to select multiple values from a dropdown grid containing lookup items. The ASPxGridLookup is bound with the custom DataItem defined within the "LookUpDataItem" type (contains row field).

The embedded ASPxGridView component is pre-customized as the ASPxListBox:

- The ASPxGridView's Header is hidden;

- The ASPxGridView's Pager is used for splitting DataItems within multiple pages to improve the client-side performance.


The embedded ASPxGridView's sever-side "CustomJSProperties" event is attached by handling the ASPxGridLookup's Init event. To get a reference to the embedded ASPxGridView, use the ASPxGridLookup.GridView property.

The embedded ASPxGridView's client-side "SelectionChanged" event is attached by handling the ASPxGridLookup's Init event, via the ASPxGridLookup.GridView.ClientSideEvents.SelectionChanged property.


UPDATED:

Starting with version v2014 vol 1 (v14.1), the "Select All" functionality is available out of the box:
S173621: ASPxGridView - Add the built-in SelectAll CheckBox for Command Column

Simply set the GridViewCommandColumn.SelectAllCheckboxMode property to GridViewSelectAllCheckBoxMode.AllPages to activate it. Please refer to the ASP.NET: GridView Select All Rows Updated blog post and the Select All Rows demo for more information.

OBSOLETE:

For the "Select All" functionality, instructions from the ASPxGridView - How to implement SelectRows and SelectAllRowsOnPage CheckBox features KB Article is used.

For the "partial selection" functionality, newly implemented ASPxCheckBox rendering (ASP.NET Check Box - New Render State For Multiple Controls (available now in v2011.1)) is used.

How to change themes on-the-fly

$
0
0

This sample illustrates a possibility to change themes on-the-fly. You can easily change all your pages' look and feel like in demos which come with our product. Please note that this demo's base class is inherited from a BasePage class declared in Utils.cs (or Utils.vb file).

See also
ASP.NET Themes In DLL: Easy Theme Deployment
How To Deploy DevExpress ASP.NET Themes
ASP.NET Themes and Skins
How to: Apply ASP.NET Themes

Question Comments

Added By: Jean-Luc Praz at: 2/1/2013 6:08:10 PM    

The links "ASP.NET Themes In DLL: Easy Theme Deployment" and "How To Deploy DevExpress ASP.NET Themes" do not seem to work anymore

Added By: A G 4 at: 3/1/2013 6:00:03 PM    

The online sample does not work.
I downloaded the sample and this does work, but only contains one page. It is stated that it can apply to all pages, but the mentioned Utils file with the BasePage class is not included. How about adding it?

Added By: Abdulkadir Bener at: 7/5/2013 11:47:26 AM    

Hello,

There is a problem with master page with Page_PreInit event.
I want to change theme from a master page and i cannot do it.

Could you mind giving an example to do the scenario on master page?
I do not want to apply theme changing codes on all Pages.

Thank you.

How to create detail grid with different sets of columns

$
0
0

This example demonstrates how to create a detail grid with different sets of columns.
When DataControlDetailDescriptor is used to create a detail grid, all columns are synchronized. So, a detail grid with DataControlDetailDescriptor cannot contain different sets of columns. Therefore, we used ContentDetailDescriptor to create a detail grid with different sets of columns in this sample.

How to serialize custom properties with a custom type using the CreateContentPropertyValue event

$
0
0

This example demonstrates how to serialize and deserialize custom properties with a custom type. If a custom property is null when the deserialization process is invoked, it's necessary to handle the DXSerializer.CreateContentPropertyValue event. In the CreateContentPropertyValue event handler, create a new instance of a custom type and assign it to the XtraCreateContentPropertyValueEventArgs.SomeCustomProperty property. 

GridView - How to show a message after CRUD operations

$
0
0
This example illustrates how to show a custom message after performing CRUD operations:
- Handle a particular Action method on the Controller side and save the related data/message via a custom ViewData key.
- Handle the GridViewSettings.CustomJSProperties event in the GridView's PartialView and check if a custom ViewData key exists. If so, store it as a custom JS Property.
- Handle the client-side ASPxClientGridView.EndCallback event and check if a custom JS Property exists. If so, visualize its value in the required manner and remove it.

How to show custom forms and controls in XAF (Example)

$
0
0

This example implements the following scenarios when an end-user clicks on a custom item in the navigation control:

- a custom non-XAF form is opened as a result;

- a standard XAF View containing a custom user control is opened as a result.


Both custom forms and user controls display persistent data from the XAF application database. For that purpose, this example solution provides a set of reusable elements (custom ViewItem and Application Model extensions) organized in a way that you can once implement them in an XAF module and reuse to display custom user controls in various forms.


Take special note that if you do not need your custom controls to display data from the application database or do not require a complex and reusable solution for this task,
you can use (recommended)a much simpler and built-in XAF solution - ControlDetailItemplaced within a DashboardView. Refer to the Using a Control that is not Integrated by Default article for more details.

If this is not your case, proceed to the instructions below:

1.
Define a base structure of the navigation control in your XAF application, as shown in the E911.Module\Model.DesignedDiffs.xafml file.

You can simply copy and paste the contents of the NavigationItems element into the corresponding file (pre-opened via the text editor) of your platform-agnostic module.

The same customizations can be achieved via the Model Editor visually.
Take special note that you can set the View parameter to any View from the list, e.g. AboutInfo_DetailView, BaseObject_ListView, etc.

This navigation structure will be further customized in the WinForms and ASP.NET executable projects later.


2. Intercept events of the navigation control to display a custom form when a custom navigation item is clicked.

To do this, implement a WindowController into your platform-agnostic module and handle events of the ShowNavigationItemController class as per the E911.Module\Controllers\ShowCustomFormWindowController.xx file. This controller will be abstract and be overridden in WinForms and ASP.NET modules.


3. Declare a custom ViewItem class that is supposed to host a custom user control in the standard XAF View. To do this, implement a custom ViewItem descendant and related types in the platform-agnostic module as shown in the E911.Module\Editors\CustomUserControlViewItem.xx file.

This ViewItem will also be abstract and platform-agnostic as it will not create platform-dependent controls, and will just provide a common customization code for both platforms. For instance, the OnControlCreated method will be overridden to bind the created control to data. To access persistent data from the database used by an XAF application, the ViewItem will implement the IComplexViewItem interface that consists of a single Setup method, receiving the IObjectSpace and XafApplication objects as parameters.

To unify our data binding code for both platforms, the IXpoSessionAwareControl interface and an auxiliary XpoSessionAwareControlInitializer class are introduced.

The interface provides a single UpdateDataSource method that is implemented by custom forms and user controls to bind them to data received by means of XPO.

You can use a similar mechanism and modify these auxiliary types to pass other custom data into your custom forms and controls.


4. Define a base structure of the standard XAF View with a custom ViewItem as shown in the E911.Module\Model.DesignedDiffs.xafml file.

You can simply copy and paste the contents of the Views element into the corresponding file (pre-opened via the text editor) of your platform-agnostic module.


5. Create custom forms and user controls in WinForms and ASP.NET executable projects analogous with what is shown in the example. The easiest way to do this is to copy the contents of the E911.Win\Controls and E911.Web\Controls folders and then include the necessary files into your solution. Take special note that these custom forms and controls implement the IXpoSessionAwareControl interface to automatically receive persistent data and other parameters when they are created.


6. Implement platform-dependent behavior to open and customize custom forms and controls. To do this, copy the following files into your WinForms and ASP.NET module projects:

WinForms:

E911.Module.Win\Controllers\WinShowCustomFormWindowController.xx - contains an WinForms version of the WindowController, which is inherited from the platform-agnostic

E911.Module.Win\Editors\WinCustomUserControlViewItem.xx - contains an WinForms version of the ViewItem, which is inherited from the platform-agnostic one;

E911.Module.Win\WinModuleEx.xx - contains a registration code for WinForms version of the ViewItem;


ASP.NET:

E911.Module.Web\Editors\WebCustomUserControlViewItem.xx - contains an ASP.NET version of the ViewItem, which is inherited from the platform-agnostic one;

E911.Module.Web\WebModuleEx.xx - contains a registration code for ASP.NET version of the ViewItem;

E911.Module.Web\Controllers\WebShowCustomFormWindowController.xx - contains an ASP.NET version of the WindowController, which is inherited from the platform-agnostic one;


These platform-dependent versions of the WindowController and ViewItem are required to implement the creation and display of custom forms and controls using the means specific for each platform. They are also designed to provide the capability to be able to set custom forms and control settings via the Model Editor. For that purpose, custom Application Model extensions are implemented for the Navigation Item and View Item model elements.


7. Set the custom forms and controls settings for each platform.

To do this, copy the contents of the E911.Win\Model.xafml and E911.Web\Model.xafml files into the Model.xafml file in the executable WinForms and ASP.NET projects:

WinForms:

ASP.NET:

 

IMPORTANT NOTES

1. It is also possible to mix the traditional and XAF development approaches (consult our Support Team if you are not sure how to integrate your standard non-XAF solution into XAF), because an XAF application is a regular .NET application built of reusable blocks like View, ViewItem, Property and List Editors, etc. that eventually create and customize platform-dependent controls exactly the same way you do this without XAF. So, using XAF does not mean something absolutely new and allows you to reuse your existing development skills and practices. Of course, it is possible to create your own reusable blocks if the standard ones do not meet your needs. For instance, the example of a custom View class designed to show a custom form can be found on CodeProject here.


2. This solution contains some generic code (e.g., base WindowController and ViewItem) that is mainly required because our XAF application is for both Windows and the Web. You may avoid this generic code and make a simpler implementation if you are developing for only one platform.


3. You can display custom forms not only when interacting with the navigation control, but from any other place. To do this, intercept the events of a required entity, e.g., an XAF Controller, Action or a View. Refer to the product documentation or consult with our Support Team in case of any difficulties.


4. By default controls layout and user customizations are preserved only for built-in XAF ListEditors, because they have special code for that. If you embed a custom user control into XAF, you need to preserve its settings yourself as well, exactly like you would do when implementing this task in the "old way" in a non-XAF application. Refer to the control's documentation to learn more on how to accomplish this task.

Feel free to contact the respective product team if you experience any difficulties customizing this control.

See also:
How to show custom forms and controls in XAF
How to create controls dynamically
How much of XAF's default UI is customizable.
How to Show a Window via an Action
How to: Display a List of Non-Persistent Objects
How to: Display a Non-Persistent Object's Detail View from the Navigation
ShowNavigationItemController.CustomShowNavigationItem Event
XafApplication.CustomProcessShortcut Event

Question Comments

Added By: kenngo at: 11/6/2012 2:24:10 AM    

Hi, I would like the custom from to be tabbedMDI, how to set this in the controller class?

Added By: Dennis (DevExpress Support) at: 2/1/2013 6:12:45 AM    

@Ngo Ken Hui:
Refer to the Q391718 ticket that describes a possible solution.

Added By: Alan mahone at: 4/26/2013 8:39:40 AM    

i have a problem in CustomUserControlViewItem.cs file
 in line "new XpoSessionAwareControlInitializer(Control as IXpoSessionAwareControl, theObjectSpace);"
the Control is converted to null

Added By: Dennis (DevExpress Support) at: 4/26/2013 8:43:18 AM    

Please submit a new ticket and attach your problematic project there:
http://www.devexpress.com/Support/Center/Question/Create
We will be glad to help you.

Added By: Andrew Bingham 2 at: 6/5/2013 10:11:58 AM    

The downloaded solution states it is for " v13.1".

The latest version I am aware of is 12.2?

Added By: Carl Howarth 1 at: 10/11/2013 4:00:36 AM    

Just in case anyony else hits the issue where the model.CustomControlTypeName is null; there are some additional model settings that are not included in the example code below (but are in the actual download).

Have a look at the XML for the E911.Module.Win/Web Model.xafml. You will notice that there are settings within these files that are not detailed below (it may be obvious to some based on the article but I missed it and it cost me the best part of a day).

Win version:
<Application>
  <NavigationItems>
    <Items>
      <Item Id="Default">
        <Items>
          <Item Id="CustomForm" CustomFormTypeName="E911.Module.Win.Controls.WinCustomForm" />
        </Items>
      </Item>
    </Items>
  </NavigationItems>
  <Views>
    <DashboardView Id="StandardFormWithCustomUserControl">
      <Items>
        <CustomUserControlViewItem Id="CustomUserControlViewItem" CustomControlTypeName="E911.Module.Win.Controls.WinCustomUserControl" />
      </Items>
    </DashboardView>
  </Views>
</Application>

Web version:
<Application>
  <NavigationItems>
    <Items>
      <Item Id="Default">
        <Items>
          <Item Id="CustomForm" CustomFormPath="Controls/WebCustomForm.aspx" />
        </Items>
      </Item>
    </Items>
  </NavigationItems>
  <Views>
    <DashboardView Id="StandardFormWithCustomUserControl">
      <Items>
        <CustomUserControlViewItem Id="CustomUserControlViewItem" CustomControlPath="Controls/WebCustomUserControl.ascx" />
      </Items>
    </DashboardView>
  </Views>
</Application>

Hope this helps.

Cheers

Carl

How to edit a dictionary with PropertyGridControl

$
0
0

To edit a dictionary with PropertyGridControl, you can create a DictionaryWrapper class that implements the ICustomTypeDescriptor interface. The DictionaryWrapper’s GetProperties method should return the PropertyDescriptionCollection of PropertyDescriptor objects. To create this collection, use a custom class that implements an abstract PropertyDescriptor class.

 

How to implement Metro Navigation Style

$
0
0

This example is actually only for versions 12.2 and lower. In 13.1, we introduced the NavigationFrame control, providing a similar functionality out of the box. See How To: Use NavigationButtons to Navigate in WPF WindowsUI Applications for more information.


With version v12.1.5, a new namespace is available in our DevExpress.Xpf.Core.Extensions library. This namespace is DevExpress.Xpf.Core.MvvmSample. Using this namespace it is possible to create the Metro Navigation style. Refer to the DevExpress.Xpf.Core.Extensions library in your project and add the DevExpress.Xpf.Core.MvvmSample namespace (dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvmsample", for xaml) to the using section of necessary files.

The first major step here is to represent a custom UserControl in a format that can be used by our MvvmRoot component. The MvvmRoot component allows you to register custom views and provide metro navigation between them. MvvmRoot is a wrapper around the whole Metro Navigation system. This component needs to be added to the MainWindow, and custom views should be registered in MvvmRoot.

Here are steps required to convert custom UserControls to custom views applicable for MvvmRoot. The main idea is to separate the UserControl data from your UserControl representation:

1. Inherit your custom UserControl from the ModuleView class. The ModuleView class is a UserControl descendant that supports our special IView interface. The ModuleView descendant will be your data representation.

2. Create a Module class descendant. Get data for your custom view in this Module descendant. The Module class instance will serve as DataContext for your custom view. In your custom view xaml, bind to data properties you specify in the Module descendant.

3. Now you have two modules. Register them in our MvvmRoot component. In the MainWindow, the following line is responsible for registration:

[XAML]
<dxmvvm:ModuleDescriptionModuleType="{x:Type viewmodel:Main}"ViewType="{x:Type view:MainView}"/>

Using these three steps, you can convert any number of user controls to custom views.

It is necessary to create the main view (with TileLayoutControl as representation) in a manner similar to the one you use to create your custom views. The only difference is that the main module part should be inherited from the MainModule class, not Module. In the MainModule descendant, declare a command to navigate via custom views. These commands will be available in the MainView representation, and you can assign them to the Tile.Command property:

[XAML]
<dxlc:TileStyle="{StaticResource VerticalTile}"Header="User Management"Background="#FF00ABDC"Command="{Binding ShowFirstViewCommand}">...</dxlc:Tile>

[C#]
publicclassMain:MainModule{#regionCommandsprotectedoverridevoidInitializeCommands(){base.InitializeCommands();ShowMainCommand=newSimpleActionCommand(DoShowModule<MainData>);ShowFirstViewCommand=newSimpleActionCommand(DoShowModule<FirstData>);//....}publicICommandShowMainCommand{get;privateset;}publicICommandShowFirstViewCommand{get;privateset;}//...voidDoShowModule<T>(objectp)whereT:ModuleData,new(){ShowModule<T>(p);}#endregion}

The ViewPresenter class with DoubleAnimation is used to provide smooth replacement of one view with another one.

Question Comments

Added By: Andrea Laperuta at: 7/30/2012 5:58:08 AM    

This sounds great, but what about a Silverlight sample?
I'm trying to porting this sample to silverlight but it won't works...
Thank you,
  Andrews.

Added By: Bob Lamb at: 5/20/2013 12:26:31 AM    

This is a good example but it could be improved by showing one of the views bound to an observable collection and having a command being bound to navigate to another view

How to apply sorting by Summary along with sorting by the Column.

$
0
0

This example shows how to sort group summary items along with the column that the summary is aligned with.

To add this functionality, you can use the proposed helper class (GroupSummaryOptions) in your solution. Just set the attached property of the Grid to "True".

Note that currently, DXGrid doesn't support sorting by multiple summaries in a single column out of the box. To implement it manually, handle the CustomColumnSort event.

How to create a chart control with a scrollable legend

$
0
0

This example illustrates how to create a chart control with a scrollable legend. This may be required, for instance, when a chart displays too many series, or a legend occupies too much space.


Question Comments

Added By: Cliff Knasinski at: 10/12/2014 8:59:46 AM    

How do I do this but get the layout of the legend below the chart diagram outside bottom justified to the left?  This places the legend to the right, and I need it below the diagram.

Added By: Cliff Knasinski at: 10/12/2014 9:00:38 AM    

I need this in WPF not Silverlight though.

Added By: John (DevExpress Support) at: 10/12/2014 9:34:00 PM    Hi Cliff,
I have created a separate ticket on your behalf: T160307: How to create a chart control with a scrollable legend . Let's continue the conversation there.

How to configure dxDataGrid with Angular Approach

$
0
0

This example demonstrates how to display data from a data source in dxDataGrid created using the AngularJS approach.

See also:
Configure Widget - Angular Approach

Question Comments

Added By: Marion (DevExpress Support) at: 8/12/2014 6:21:57 AM    

Hello,

To process your recent post more efficiently, I created a separate ticket on your behalf: T139489: How to configure dxDataGrid with Angular approach and handle the optionChanged event. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Added By: Scott Wood at: 8/27/2014 6:12:41 AM    

The demo code is incomplete.  dataSource:employees...   Where does employees come from?  I assume it's just a plain old javascript array????

Added By: Marion (DevExpress Support) at: 8/27/2014 10:53:50 PM    @Scott,
Please download the example locally to see all project files including the data.js file that contains the employees data. Added By: Will Meister at: 10/12/2014 9:39:05 AM    

Could you please dive a little deeper into this example? For instance, does listing 'employees' as the dataSource provide two-way databinding, or would 'dataSource' need to be listed in one of the bindingOptions? Also, could you provide a functioning example of configuring the rowUpdated, rowUpdating, rowRemoved, and rowRemoving event handlers? In my project, none of them get triggered, though rowClick works properly.

Thanks!,
Will

Added By: Marion (DevExpress Support) at: 10/12/2014 11:48:42 PM    

Hello,

To process your recent post more efficiently, I created a separate ticket on your behalf: T160337: How to configure dxDataGrid CRUD operations with Angular Approach. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Advanced Banded View Layout with attached behavior

$
0
0

Update:
Starting with version 13.1, we implemented banded grid support out of the box. See the Using Bands to Create Multi-Row Layout article and the E4625 - How to: Create a Banded View example for more information. The solution below applies to versions prior to 13.1.

This example demonstrates how to create the banded view for the DXGrid with the attached behavior.

See Advanced Banded View Layout with attached behavior for more information.

We have included this solution in the DevExpress.Xpf.Grid.v11.2.Extensions library shipped with the 11.2 major version. Refer to the GridDemo.BandedView demo module to see this feature in action.


How to implement the Drag&Drop functionality for the CardView

$
0
0

We have created an example demonstrating how to implement the Drag&Drop functionality for the CardView.

This functionality is encapsulated in the CardDragDropManager class. So, all you need to do is to attach this behavior to the GridControl.

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

$
0
0

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.

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();}}

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

DataEditors - How to localize data items based on the current culture

$
0
0

By default, our extensions don't provide any specific method for this scenario. However, it's possible to accomplish this task by creating a special helper method which will take an original text as a parameter, and return a localized text defined in resources. If your data is stored in .xml, create several files for different cultures and dynamically assign them based on the current culture.
This example illustrates the both ideas. 

How to use HtmlEditor for editing GridView data

$
0
0

This example demonstrates how to use HtmlEditor to edit GridView row data

Question Comments

Added By: md imran at: 11/18/2013 5:20:50 AM    

please can you give me the full project and i want to edit and delete on right click context menu not clicking on the grid view........ Thanks please answer me fast as possible as you can............

Added By: md imran at: 11/18/2013 5:21:29 AM    

same as below gridview with html editor

Added By: Vladimir (DevExpress Support) at: 11/19/2013 9:59:25 PM    

Hello,

I am not sure that I correctly understand the details of your request. If you need this example project, you can download it by clicking the 'Example' link on the right. I recommend you also install Example Runner, which you can get by clicking the 'Example Runner' link. You can find it under the 'Example' link.
If you need to apply some changes to this scenario, but you encounter certain difficulties doing so, would you please create a separate ticket and describe the issue in greater detail? If possible, also send us a sample project to illustrate the encountered difficulties. This will help us understand their cause and provide you with a detailed answer.

Added By: Luis Ramirez 12 at: 7/15/2014 9:09:27 AM    

Good Morning.
Can you help me with one thing. I need to do exact the same thing (put a HTML Control in the editing form of a Grid View) but in ASP .Net.
Actually I'm using this code:

<dx:GridViewDataMemoColumn FieldName="Texto" Visible="false" VisibleIndex="10" EditFormSettings-ColumnSpan="2" PropertiesMemoEdit-Height="75px">
                                   <PropertiesMemoEdit Height="75px" Width="100%" EncodeHtml="False"></PropertiesMemoEdit>
                                   <EditFormSettings Visible="True" />
                               </dx:GridViewDataMemoColumn>

But I have to use the HTML Editor control.

Thanks.

Added By: Artem (DevExpress Support) at: 7/15/2014 11:08:24 PM    

Hello,

To process your recent post more efficiently, we copied it to a separate ticket created on your behalf: T129913: How to use ASPxHtmlEditor in ASPxGridView.
This ticket is currently in our processing queue. We will post to it as soon as we have any updates.

Added By: Kevin Johnsrude at: 10/13/2014 11:01:14 AM    

This answer does not answer my question at:
https://www.devexpress.com/support/center/Question/Details/T160264

I am specifically asking about using the HtmlEditor within a Master-Detail GridView.

Added By: Anthony (DevExpress Support) at: 10/13/2014 12:12:20 PM    Kevin, thank you for clarifying this. We will provide you with the answer in the How do I use the HtmlEditor MVC Gridview for fields in detail of a master-detail grid? ticket.
Viewing all 7205 articles
Browse latest View live


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