xtrareports-devexpress-dot-aspnetcore-dot-reporting-dot-reportdesigner-dot-reportdesignerclientsideeventsbuilder-dot-customizeparameterproperties-x28-system-dot-string-x29.md
Sets the name of the JavaScript function or the entire code that will handle the Web Report Designer‘s CustomizeParameterProperties client-side event.
Namespace : DevExpress.AspNetCore.Reporting.ReportDesigner
Assembly : DevExpress.AspNetCore.Reporting.v25.2.dll
NuGet Package : DevExpress.AspNetCore.Reporting
public ReportDesignerClientSideEventsBuilder CustomizeParameterProperties(
string callback
)
Public Function CustomizeParameterProperties(
callback As String
) As ReportDesignerClientSideEventsBuilder
| Name | Type | Description |
|---|---|---|
| callback | String |
The name of the JavaScript function or the entire JavaScript function code used to handle the CustomizeParameterProperties event.
|
| Type | Description |
|---|---|
| ReportDesignerClientSideEventsBuilder |
A ReportDesignerClientSideEventsBuilder object that can be used to further configure the Report Designer’s client-side events.
|
The CustomizeParameterProperties event allows you to customize the following elements in the Web Report Designer UI: parameters, parameter groups, parameter separators, and property editors. Your customizations apply to the Properties Panel, Field List and Parameter Editor. The event fires when you add a new parameter, open a report, invoke/close the Parameter Editor, or expand the Data group in the Properties Panel.
The handler function receives two arguments. The first is the event sender (a ClientReportDesigner object). The second is an object with the following structure:
parameterAn object that stores information about a report parameter. This object implements the IParameterDescriptor interface.parameterPanelLayoutItemAn object that stores information about parameter panel layout items. This object contains the item name and its type (parameter/group/separator).editorsAn array of objects that store information required to serialize a property editor. This object implements the ISerializationInfoArray interface.getEditorA function that gets serialization information for a property editor by its property name or model name.editOptions
An object that contains options used to specify the editing settings of parameters, groups, and separators:
Review the following parameter customization scenarios.
Set the editOptions.allowDelete property to false to hide delete buttons for specified items.
The following snippet hides delete actions for all parameters in the Properties Panel, Field List, and Parameter Editor. Note that users can still remove parameter groups and separators:
function customizeParameterProperties(sender, args) {
if (args.parameter) {
args.editOptions.allowDelete = false;
}
}
@{
var designerRender = Html.DevExpress().ReportDesigner("reportDesigner")
.Height("100%")
.ClientSideEvents(configure => {
configure.CustomizeParameterProperties("customizeParameterProperties");
})
.Bind(Model);
@designerRender.RenderHtml()
}
The following snippet hides delete actions only for the parameter1 parameter in the Properties Panel, Field List, and Parameter Editor:
function customizeParameterProperties(sender, args) {
if (args.parameter) {
const name = args.parameter.name;
if (name === 'parameter1') {
args.editOptions.allowDelete = false;
}
}
}
@{
var designerRender = Html.DevExpress().ReportDesigner("reportDesigner")
.Height("100%")
.ClientSideEvents(configure => {
configure.CustomizeParameterProperties("customizeParameterProperties");
})
.Bind(Model);
@designerRender.RenderHtml()
}
You can hide Add and Delete buttons for all parameters, groups, or separators. Use properties of the ParameterEditingSettings class.
The following code snippet hides all property editors for the parameter1 parameter:
function customizeParameterProperties(sender, args) {
if (args.parameter) {
const name = args.parameter.name;
if (name === 'parameter1'){
args.editors.forEach(i => {
// Hide editors.
i.visible = false;
// Disable editors.
//i.disabled = true;
});
}
}}
@{
var designerRender = Html.DevExpress().ReportDesigner("reportDesigner")
.Height("100%")
.ClientSideEvents(configure => {
configure.CustomizeParameterProperties("customizeParameterProperties");
})
.Bind(Model);
@designerRender.RenderHtml()
}
The parameter1 parameter has no visible property editors:
Parameter Editor: Properties Panel
Use the AllowEditProperties property to disable all property editors for parameters and parameter groups.
Use the getEditor function to get serialization information about the property editor by its name. The use of the function is necessary because the display names of the same editors may differ in the Properties Panel and Parameter Editor.
The code snippet below does the following:
Hides the Allow null value checkbox for all parameters.
Disables the Description editor for parameter3.
Disables the Title editor for all parameter groups.
function customizeParameterProperties(sender, args) {
if (args.parameter) {
const allowNullInfo = args.getEditor('allowNull');
if (allowNullInfo) {
// Hide the Allow null value checkbox.
allowNullInfo.visible = false;
}
const name = args.parameter.name;
if (name === 'parameter3') {
const descriptionEditor = args.getEditor('description');
if (descriptionEditor) {
// Disable the Description editor.
descriptionEditor.disabled = true;
}
}
}
if (args.parameterPanelLayoutItem.layoutItemType === 'Group') {
const titleEditor = args.getEditor('title')
// Disable the Title editor.
titleEditor.disabled = true;
}
}
@{
var designerRender = Html.DevExpress().ReportDesigner("reportDesigner")
.Height("100%")
.ClientSideEvents(configure => {
configure.CustomizeParameterProperties("customizeParameterProperties");
})
.Bind(Model);
@designerRender.RenderHtml()
}
The property editors for parameter3 look as follows (the Allow Null Value checkbox is hidden and the Description editor is disabled):
Parameter Panel Properties Panel See Also
Specify Parameter Editing Settings in ASP.NET Core Applications
ReportDesignerClientSideEventsBuilder Class