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

How to refer to a client-side control within a UserControl, if there is more than one UserControl instance on a page

$
0
0

This is an example for article How to refer to a client-side control within a UserControl. There is a UserControl with an ASPxPopupControl control. Two instances of the UserControl are put on a page. Each UserControl instance deals with its own popup control. Note the dynamically generated handler for the button's client-side Click event in WebUserControl.ascx code behind.

Question Comments

Added By: Jay Johnson at: 6/10/2015 2:30:42 PM    

Trying this with an ASPxRadioButton and getting "Databinding expressions are only supported on objects that have a DataBinding event.  DevExpress.Web.CheckEditClientSideEvents does not have a DataBinding event."

Any ideas?

Added By: Jay Johnson at: 6/10/2015 2:31:38 PM    

<dx:ASPxRadioButton ID="optNo" runat="server" Text="No" GroupName="Answer" Layout="Flow" Theme="MetropolisBlue" >
       <ClientSideEvents CheckedChanged= '<%#GetButtonClickHandler()%>' />
   </dx:ASPxRadioButton>

Added By: Larry (DevExpress Support) at: 6/10/2015 11:37:58 PM    

Hello,

To process your recent post more efficiently, I created a separate ticket on your behalf: T254117: The "Databinding expressions are only supported on objects that have a DataBinding event. DevExpress.Web.CheckEditClientSideEvents does not have a DataBinding event." error occurs. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Added By: Jaime Castello at: 8/18/2015 11:53:20 PM    

This works for controls where you can bind the function. However it not explain how to bind the javascript function on grid callbacks.

If you have this situation, I have no idea how to adapt openComisarioDetalle:

<script id="dxss_personaluploaderscript" type="text/javascript">
function gridComisionadosCustomButtonClick(s, e) {
gridcomisarios.GetRowValues(e.visibleIndex, "idrecord;name;surname", openComisarioDetalle);
}
function openComisarioDetalle(values) {
//some code here
}
</script>

<dx:ASPxGridView ID="gridcomisarios" runat="server" AutoGenerateColumns="False"
                   Width="100%" EnableTheming="True" ClientInstanceName="gridcomisarios" EnableViewState="False" Cursor="pointer">
                   <ClientSideEvents CustomButtonClick="function(s, e) { gridComisionadosCustomButtonClick(s, e); }" />

Added By: Paul (DevExpress Support) at: 8/19/2015 1:43:13 AM    

Hello,

To process your recent post more efficiently, I created a separate ticket on your behalf: T279924: How to create a javascript function in code behind. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.


How to specify custom background for DXEditors

$
0
0

In our themes, the Control.BackgroundProperty is defined by several elements with different colors, gradients, margins, paddings and corner rounding. You can't specify this complex functionality with only the Control.BackgroundProperty property. You can implement your own template using the TextEditThemeKey key ({dxet:TextEditThemeKey ResourceKey=BorderTemplate}). Also, you need to bind to the Background property.

Question Comments

Added By: Drew Noakes at: 8/19/2015 3:58:07 AM    

Is it a problem that the control template's binding references TextEdit, yet is also used in DateEdit and ComboBoxEdit?

Change the Field Value Header appearance backcolor or draw it manually

$
0
0

If UserLookAndFeel.Style is equal to Skin, the XtraPivotGrid control uses the Skins technology to draw its content. With this approach, all headers are drawn using a specific bitmap provided by a corresponding skin element. The appearance back color settings have no effect in this instance. So, if you want to draw a field header using a custom color, you should draw the field header manually via the PivotGridControl.CustomDrawFieldValue event.

The DrawIndicator method can throw exceptions in versions 15.1.3 - 15.1.5. We have fixed this issue in the context of the DrawIndicator method call throws an exception after updating to 15.1.5 ticket.

ASPxCardView - How to add a new card when the edit form is always visible

$
0
0
The following example shows how to make the form used for the card editing always visible. To implement this, add the lines of code given below onto the form page.

How to export AcroForm data to XML

$
0
0
This example shows how a PDF document with AcroForm data (interactive forms) can be exported to an XML format.

You can also export the AcroForm data document to FDF, XFDF, and TXT formats using the approach described below.
Question Comments

Added By: Tim A at: 8/20/2015 12:40:00 PM    

Hello,
I do not see pdfViewer1.Export( ) method in my pdfViewer class.
My DevEx Win controls version is 14. 2. Is it available on this version?
I see that PdfViwercontrol  inside WPF Controls package has that Export method though PdfViewerControl.ExportFormData( ), and I do not have WPF Controls package :( .

Added By: Oleg (DevExpress Support) at: 8/21/2015 1:05:24 AM    

Hello Tim,
To process your recent post more efficiently, I created a separate ticket on your behalf: T280844: An issue with using the approach demonstrated in T273545 (How to export AcroForm data to XML) example. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

ASPxGridView - How to display BarCode in a grid column

How to connect to PostgreSQL and pass a parameter to a DataSet with XtraReports

$
0
0

To run this example, you should do the following:

1) Install PostgreSQL on your machine;
2) Install Npgsql .Net Data Provider for PostgreSQL;
3) In your data base, create a table (named "table1") with two fields in it ("name" and "id"), and populate it with data;
4) In the project, locate the connection string and define the user name and password for the data base.

How to create a ButtonEdit descendant that can show a multi-line text like MemoEdit

$
0
0

This example shows how to create and use a ButtonEdit descendant that will support multi-line text like MemoEdit.


This descendant's repository items have three additional properties:

RepositoryItemMultiLineButtonEdit.AcceptsReturn - gets or sets a value specifying whether return characters can be inserted into text.
RepositoryItemMultiLineButtonEdit.AcceptsTab - gets or sets a value specifying whether a user can insert tab characters into text.
RepositoryItemMultiLineButtonEdit.ScrollBars - gets or sets a value indicating which scrollbars are displayed.

See also:
Custom Editors.

How to create a ButtonEdit descendant that can show a multi-line text like MemoEdit

Question Comments

Added By: Vernon Robinson at: 8/21/2015 4:12:08 AM    

I am trying to follow this example.  However, in my application, after I add the MultiLineButtonEdit Code and Bitmap to my project, the following happens:

1. The ellipsis do not show on the control in the designer like the example does.
2. The graphic does not show in the RepositoryItem toolbox dropdown when selecting the columnedit.

Other than those two cosmetic issues, the button does function.  Any idea on what I can do to fix these two minor issues?

Added By: Vernon Robinson at: 8/21/2015 4:13:03 AM    

When leaving a comment, How can I attach a document to illustrate a point?

Added By: Uriah (DevExpress Support) at: 8/21/2015 5:36:55 AM    

Hello Vernon,

To process your recent post more efficiently, I created a separate ticket on your behalf: T280958: E5150 - How to fix two minor design-time issues. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.


How to customize information shown in the group row

$
0
0
This example demonstrates how to customize the group row text. One of the ways to do this is to handle the GridView.CustomDrawGroupRow event and set the GridGroupRowInfo.GroupText property to a required value.
See code in the Form.cs (Form.vb) file. 

Drag & Drop - Copying rows instead of moving them when the CTRL key is pressed

$
0
0

This example demonstrates how to allow a user to copy dragged rows on the modifier key press. A custom attached property is used to determine whether or not the user wants to copy rows. You can adjust this property in the PreviewKeyDown and PreviewKeyUp event handlers. Then, use it in the DragElementTemplate to modify the drag element appearance accordingly. At last, replace data objects within the DraggedRows collection in the Drop event handler with newly created items.

Using ColorPickEdit popup in PopupContainerControl and PopupControlContainer

$
0
0

This example illustrates how to use the ColorPickEdit popup with PopupContainerControl and PopupControlContainer.

Question Comments

Added By: Marcin Kosieradzki at: 8/22/2015 9:52:06 AM    

Thank you very much for keeping examples up to date. Saved me a lot of time when migrating 2013.2 -> 2015.1.

How to hide a side component's properties from the End-User Designer Properties window

$
0
0
This example demonstrates how to hide connection (ConnectionName and ConnectionParameter) properties of the SqlDataSource component set as a a report's data source.

How to implement a custom Edit Row form

How to apply Conditional Formatting in code behind

$
0
0

This example demonstrates how to change Conditional Formatting rules in code behind

 DashboardDesigner - How to customize data source wizard to display only predefined data connections

$
0
0

This example demonstrates how to use the DashboardDesigner.DataSourceWizardCustomization to replace the default pages of the data source wizard with custom ones:

[C#]
dashboardDesigner1.DataSourceWizardCustomization=newDataSourceWizardCustomization();

 

We use following code to skip first page which allows selecting the data source type, and specify custom a wizard page that allows selecting one of the predefined connections. This custom page does not allow establishing a new connection:

[C#]
publicclassDataSourceWizardCustomization:IDashboardDataSourceWizardCustomization{publicvoidCustomizeDataSourceWizard(IWizardCustomization<DashboardDataSourceModel>customization){customization.StartPage=typeof(ChooseConnectionPage<DashboardDataSourceModel>);customization.Model.DataSourceType=DashboardDataSourceType.Xpo;customization.RegisterPageView<IChooseConnectionPageView,CustomChooseConnectionPageView>();}}

 

To specify default connections in code behind, use the DashboardDesigner.CustomDataConnections Property.  

See Also:
How to define a custom IConnectionStorageService in DashboardDesigner to filter out unnecessary connections from an app.config file  

Question Comments

Added By: mori khazaei 1 at: 7/29/2015 9:23:35 PM    

Hi,

I run this example. first no references is known and I add all again and then this error appear when I compile it:
'WizardCustomizationExample1.DataSourceWizardCustomization' does not implement interface member 'DevExpress.DashboardWin.ServiceModel.IDashboardDataSourceWizardCustomization.CustomizeDataSourceWizzard(DevExpress.DataAccess.UI.Wizard.IWizardCustomization<DevExpress.DashboardCommon.DashboardDataSourceModel>)'

The error is from DataSourceWizardCustomization1.cs line 49 column 18

how can I resolve this error?

Added By: Constant (DevExpress Support) at: 7/30/2015 12:39:46 AM    

The problem likely appears because you use the Dashboard Suite version, which does not support this functionality. This interface and other required members were introduced only in version 15.1.5. If you use an older version, it is necessary to upgrade it to use this functionality. 


How to define a custom IConnectionStorageService in DashboardDesigner to filter out unnecessary connections from an app.config file  

$
0
0

This example demonstrates how to implement a custom IConnectionStorageService and use it instead of the default one in the data source wizard. This service implementation allows only getting connection parameters from the DashboardDesigner.CustomDataConnection collection. To load the custom service instead of the default one, execute the following code:

[C#]
dashboardDesigner1.ServiceContainer.RemoveService(typeof(IConnectionStorageService));dashboardDesigner1.ServiceContainer.AddService(typeof(IConnectionStorageService),newCustomConnectionStorageService(dashboardDesigner1));

ASPxCardView - How to handle the ASPxCardView.AfterPerformCallback event

How to customize the Ribbon toolbar in the Banded End-User Report Designer for WPF

$
0
0

This example demonstrates how add two custom items to the Ribbon toolbar of the Banded End-User Report Designer. These custom items allows you to manage the designer's side panel's and toolbox's visibility.


To customize the WPF Banded End-User Report Designer's Ribbon toolbar use it's RibbonTemplate: Get the original RibbonTemplate XAML code from our source files, add it to your application, customize it according to your requirements and assign it to the ReportDesigner.RibbonTemplate property.

In this example, I have added the RibbonPageGroup with two BarCheckItems to the Report Designer's RibbonTemplate and bound these items to the CustomizedRibbonCommands class properties. This class object (CustomRibbonCommands) is assigned to the MainWindow and realizes the side panel and toolbox showing/hiding logic:

[XAML]
<DataTemplatex:Key="CustomizedRibbonTemplate"><dxr:RibbonControl...><dxr:RibbonDefaultPageCategory><dxr:RibbonPageCaption="Report Designer"> ...<dxr:RibbonPageGroupCaption="View"><dxb:BarCheckItemContent="Toolbox"IsChecked="{Binding CustomRibbonCommands.IsToolboxVisible, RelativeSource={RelativeSource FindAncestor, AncestorType=local:MainWindow}}"LargeGlyph="{dx:DXImage Image=IDE_32x32.png}"Glyph="{dx:DXImage Image=IDE_16x16.png}"/><dxb:BarCheckItemContent="Side Panel"IsChecked="{Binding CustomRibbonCommands.IsSidePanelVisible, RelativeSource={RelativeSource FindAncestor, AncestorType=local:MainWindow}}"LargeGlyph="{dx:DXImage Image=Technology_32x32.png}"Glyph="{dx:DXImage Image=Technology_16x16.png}"/></dxr:RibbonPageGroup></dxr:RibbonPage></dxr:RibbonDefaultPageCategory> ...</dxr:RibbonControl></DataTemplate>

ASPxMemo - How to limit the text length in the ASPxMemo using the HTML5 maxLength attribute

How to implement the Copy/Paste feature

$
0
0

This example demonstrates how to parse the clipboard's data to paste rows into the grid.
For more information, please see the following KB article: A1266

See Also:

How to implement the paste from clipboard feature

Question Comments

Added By: Joe Isaac at: 2/12/2015 10:23:53 AM    

Is this still the method I should follow for the latest version of the winforms gridcontrol?

Added By: Sasha (DevExpress Support) at: 2/13/2015 12:00:59 AM    

Hello Joe,
Yes, use this example to implement the copy/paste feature.

Added By: Chris D at: 7/31/2015 12:37:04 AM    

Dear,

i need to do this with all my gridviews with datasource XPCOLLECTION, what do i have to do ?
Thanks for your support!

Added By: Svetlana (DevExpress Support) at: 7/31/2015 2:12:24 AM    

Hello,

To process your recent post more efficiently, I created a separate ticket on your behalf: T273510: How to implement the Copy/Paste feature with XPCollection in a grid. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Added By: Balnur Duisenbayeva at: 8/25/2015 3:19:25 AM    

Hi, support team!

1) Some of my columns are binded to another tables in a datasource with lookup edit, where it gets its values. While copying and pasting a row, there is a FormatException, because columns valuemember is int, display member is string. How can it be solved?

2) It also throws exception ArgumentException, when pasting empty cell of type DateTime. It is not leaving empty Datetime cell as empty in pasted row, says "String was not recognized as a valid Datetime.."

Thank you very much!

Added By: Nadezhda (DevExpress Support) at: 8/25/2015 4:56:30 AM    

Hello,

To process your recent post more efficiently, I created a separate ticket on your behalf: While copying and pasting a row, there is a FormatException, because columns valuemember is int, display member is string. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Viewing all 7205 articles
Browse latest View live


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