This is a migrated thread and some comments may be shown as answers.

How to set the grid's selection mode using tag helpers

4 Answers 425 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Catherine
Top achievements
Rank 1
Catherine asked on 27 Jul 2019, 09:54 PM
Hi,

How do you select the selection mode (single vs. multiple and cell vs. row) using tag helpers to create a grid?

Thanks!

4 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 29 Jul 2019, 09:23 AM
Hello Catherine,

To enable the Selectable configuration, using the tag-helper for ASP.NET Core Grid, you need to set the attribute in the "kendo-grid" tag.

e.g.

<kendo-grid name="grid" height="550" selectable="multiple, cell">
    <datasource type="DataSourceTagHelperType.Custom" custom-type="odata" page-size="20">
        <transport>
        </transport>
        <schema>
            <model>
                <fields>
                    <field name="OrderDate" type="Date"></field>
                </fields>
            </model>
        </schema>
    </datasource>
    <groupable enabled="true" />
    <sortable enabled="true" />
    <filterable enabled="true" />
    <pageable button-count="5" refresh="true" page-sizes="new int[] { 5, 10, 20 }">
    </pageable>
    <columns>
        <column field="OrderID" width="120" />
        <column field="OrderDate" title="Order Date" format="{0:MM/dd/yyyy}" />
        <column field="ShipName" title="Ship Name" width="300" />
        <column field="ShipCity" title="Ship City" width="250" />
    </columns>
</kendo-grid>

By default selection is disabled. Accepted values are:

"row" - the user can select a single row.
"cell" - the user can select a single cell.
"multiple, row" - the user can select multiple rows.
"multiple, cell" - the user can select multiple cells.

If there is anything else we could help, please do not hesitate to contact us back.

Regards,
Nikolay
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Catherine
Top achievements
Rank 1
answered on 30 Jul 2019, 12:11 AM
Thank you, this is very helpful. Just to be clear - "true" and "false" are not acceptable values.
0
Catherine
Top achievements
Rank 1
answered on 30 Jul 2019, 12:48 AM
Just updating that "true" is an value as found [here.](https://demos.telerik.com/kendo-ui/grid/selection)
0
Nikolay
Telerik team
answered on 30 Jul 2019, 01:29 PM
Hello Catherine,

Thank you for the feedback. That is correct - setting selectable to "true" enables row selection of the Grid.

Should you have any other questions or concerns, please do not hesitate to contact us back.

Regards,
Nikolay
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Catherine
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Catherine
Top achievements
Rank 1
Share this question
or