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

Google-like suggestion dropdownlist

1 Answer 173 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Gábor
Top achievements
Rank 1
Gábor asked on 30 Jan 2019, 01:46 PM

Hello,

is there a way to achieve a google-like suggestion dropdown list in Grid?

I have a normal grid, with a "Create" function in its toolbar. The column accepts any strings, which are saved in the database.
I attached a screenshot of the grid.

Is it possible to have a dropdown list under the cell, where the cursor is active?
The cell got to accept any strings, in case a Company name is not saved earlier in the database.

What I'm trying to achieve is to suggest the user what strings were saved in the form in the past.

The grid is nothing fancy:

@Html.Label(WorkPermitLabels.NonContractedCompanyName, new { @class = "control-label" })
@Html.Hidden("NonContractedCompany", "")
@(Html.Kendo().Grid(Model.NonContractedCompanies)
        .Name("nonContractedCompanies")
        .Columns(col =>
        {
            col.Bound(v => v.Name);
            col.Command(v =>
            {
               v.Edit();
               v.Destroy();
            });
         })
        .Editable(e => e.Mode(GridEditMode.InLine))
        .HtmlAttributes(new { @class = "control-label col-sm-12 col-md-6" })
        .Sortable()
        .ToolBar(toolbar => toolbar.Create())
        .DataSource(datasource =>
            datasource
               .Custom().Schema(schema => schema
               .Model(mod =>
               {
                  mod.Id(v => v.NonContractedCompanyID);
                  mod.Field(v => v.Name);
               })
         )
        ))
@Html.ValidationMessageFor(m => m.NonContractedCompanies, "", new { @class = "text-danger" })

 

Thank you for your help.

Gábor


1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 01 Feb 2019, 06:34 AM
Hello ,

The browser's autocomplete is enabled/disabled through the "autocomplete" attribute placed in the INPUT elements, but this is applicable for form elements:
In the context of the Grid you could implement custom editor that could use an AutoComplete bound to a data with the available values for that column:
Hope this helps.


Regards,
Konstantin Dikov
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
Gábor
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or