PropertyGridBuilder
Methods
Model(System.Object)
Sets the object to which the PropertyGrid is bound.
Parameters
value - System.Object
Items(System.Action)
Additional configuration options for the properties of the model.
Parameters
configurator - System.Action<PropertyGridItemFactory>
The action that configures the items.
Columns(System.Action)
The configuration of the PropertyGrid columns which allows for setting the field and value column configuration options.
Parameters
configurator - System.Action<PropertyGridColumnsSettingsBuilder>
The action that configures the columns.
ContextMenu()
Configures the ContextMenu of the PropertyGrid. If set to true enables the default ContextMenu.
ContextMenu(System.Boolean)
Configures the ContextMenu of the PropertyGrid. If set to true enables the default ContextMenu.
Parameters
enabled - System.Boolean
Enables or disables the contextmenu option.
ContextMenu(System.Action)
Configures the ContextMenu of the PropertyGrid. If set to true enables the default ContextMenu.
Parameters
configurator - System.Action<PropertyGridContextMenuSettingsBuilder>
The action that configures the contextmenu.
EditMode(System.Boolean)
If set to true, the user will be able to edit the values of the object's properties to which the PropertyGrid is bound. By default, editing is enabled. can also be set to a string (which specifies the edit mode).The supported string values are: (Default) incell.
Parameters
value - System.Boolean
The value that configures the editmode.
Excel(System.Action)
Configures the Excel export settings of the PropertyGrid.
Parameters
configurator - System.Action<PropertyGridExcelSettingsBuilder>
The action that configures the excel.
Groupable(System.Boolean)
Enables the grouping of properties. Set this configuration to false to disable grouping.
Parameters
value - System.Boolean
The value that configures the groupable.
Height(System.Double)
Sets the height of the PropertyGrid. Numeric values are treated as pixels.
Parameters
value - System.Double
The value that configures the height.
Messages(System.Action)
Defines the text of the command buttons that are shown within the PropertyGrid. Used primarily for localization.
Parameters
configurator - System.Action<PropertyGridMessagesSettingsBuilder>
The action that configures the messages.
Navigatable(System.Boolean)
If set to true, the user can navigate the component with the keyboard. By default, keyboard navigation is disabled.
Parameters
value - System.Boolean
The value that configures the navigatable.
Pdf(System.Action)
Configures the PDF export settings of the PropertyGrid.
Parameters
configurator - System.Action<PropertyGridPdfSettingsBuilder>
The action that configures the pdf.
Resizable(System.Boolean)
When set to true the user will be able to resize columns via the context menu. When set to false the ContextMenu Resize command will not be available.
Parameters
value - System.Boolean
The value that configures the resizable.
ShowDetails(System.Boolean)
Use this configuration to disable the ToggleDetails command button on the toolbar and to prevent the rendering of the Details/Info box.
Parameters
value - System.Boolean
The value that configures the showdetails.
Scrollable(System.Boolean)
If set to true, the PropertyGrid will display a scrollbar when the total row height or width exceeds the PropertyGrid height or width. By default, scrolling is enabled.
Parameters
value - System.Boolean
The value that configures the scrollable.
Toolbar(System.Action)
If a String value is assigned to the toolbar configuration option, it will be treated as a single string template for the whole PropertyGrid toolbar and the string value will be passed as an argument to a kendo.template() function.; If a Function value is assigned (it may be a kendo.template() function call or a generic function reference), then the return value of the function will be used to render the contents of the PropertyGrid toolbar. or If an Array value is assigned, it will be treated as the list of commands which are displayed in the PropertyGrid toolbar. Commands can be custom or built-in. The supported built-in commands are:search—Adds a Search input to the ToolBar of the PropertyGrid. Search is performed by property name.sort—Adds a DropDownList with sorting options. Properties are sorted by property name.group—Renders a button for toggling between List and Group layout.details—Renders a button for toggling the Details/Info box.separator—Renders a separator element.spacer—Renders a spacer element.excel—Exports the data in MS Excel format.pdf—Exports the data in PDF format..
Parameters
configurator - System.Action<PropertyGridToolbarFactory>
The action that configures the toolbar.
Width(System.Double)
Sets the width of the PropertyGrid. Numeric values are treated as pixels.
Parameters
value - System.Double
The value that configures the width.
Events(System.Action)
Configures the client-side events.
Parameters
configurator - System.Action<PropertyGridEventBuilder>
The client events action.
Example
@(Html.Kendo().PropertyGrid()
.Name("PropertyGrid")
.Events(events => events
.BeforeEdit("onBeforeEdit")
)
)
ToComponent()
Returns the internal view component.
Name(System.String)
Sets the name of the component.
Parameters
componentName - System.String
The name of the component.
Example
@(Html.Kendo().Grid<OrderViewModel>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.OrderID).Filterable(false);
columns.Bound(p => p.Freight);
})
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Read(read => read.Action("Orders_Read", "Grid"))
)
)
Deferred(System.Boolean)
Suppress initialization script rendering. Note that this options should be used in conjunction with
Parameters
deferred - System.Boolean
ModelMetadata(System.Web.Mvc.ModelMetadata)
Uses the Metadata of the Model.
Parameters
modelMetadata - System.Web.Mvc.ModelMetadata
The metadata set for the Model
HtmlAttributes(System.Object)
Sets the HTML attributes.
Parameters
attributes - System.Object
The HTML attributes.
HtmlAttributes(System.Collections.Generic.IDictionary)
Parameters
attributes - System.Collections.Generic.IDictionary<String,Object>
AsModule(System.Boolean)
Specifies whether the initialization script of the component will be rendered as a JavaScript module.
Parameters
value - System.Boolean
Render()
Renders the component.
Example
@(@Page Inherits="System.Web.Mvc.ViewPage<IEnumerable<Product>>" )
@( Html.Kendo().Grid(Model)
.Name("grid")
.DetailTemplate(product => {
)
Product Details:
<div>Product Name: @( product.ProductName )</div>
<div>Units In Stock: @( product.UnitsInStock )</div>
@(
})
.Render();
)
ScriptAttributes(System.Object,System.Boolean)
Sets the JavaScript attributes to the initialization script.
Parameters
attributes - System.Object
The JavaScript attributes.
overrideAttributes - System.Boolean
Argument which determines whether attributes should be overriden.
ScriptAttributes(System.Collections.Generic.IDictionary,System.Boolean)
Sets the JavaScript attributes to the initialization script.
Parameters
attributes - System.Collections.Generic.IDictionary<String,Object>
The JavaScript attributes.
overrideAttributes - System.Boolean
Argument which determines whether attributes should be overriden.