Adding a dropdown as a column in asp.net core Kendo Grid

1 Answer 725 Views
DropDownList Grid
Vaibhav
Top achievements
Rank 1
Vaibhav asked on 10 Mar 2023, 10:29 PM

Hi,

How do we take a drop down with a list of values and put it on a gridview. and save the chosen values as text.

What would be the best way and easiest way ? 

For Example 

I have Table A which is bound to the Grid View. I want to show values from one of the column from Table B as a dropdown list of values in one of the column of the grid view.  There is no foreign key relationship between the tables.

2 EXAMPLE FOR IDEA:

 1) For Example : https://demos.telerik.com/aspnet-core/grid/custom-datasource

How can you add a dropdown list in the product name column, product list is coming from another table where there is no foreign key relationship

2) Another example : https://demos.telerik.com/aspnet-core/grid/foreignkeycolumnbinding  : How can we achieve category binding without a foreign key. 

1 Answer, 1 is accepted

Sort by
0
Aleksandar
Telerik team
answered on 13 Mar 2023, 10:20 AM

Hello Vaibhav,

I would suggest reviewing the Custom Editing Demo for the Grid, as it demonstrates how to achieve the desired result. Make sure to click on the View Source tab to review the source code behind the demo:

Here are the key requirements:

  • Define the desired editor and pace it in the  ~Views\Shared\EditorTemplates folder (check the ClientCategory.cshtml for an example),
  • Decorate the model property with the [UIHint] attribute - inspect the ProductViewModel.cs for details
  • Specify a default value that will be used initially when an item will be created.

For further details, refer to the Custom editing section of the documentation.

Regards,
Aleksandar
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
DropDownList Grid
Asked by
Vaibhav
Top achievements
Rank 1
Answers by
Aleksandar
Telerik team
Share this question
or