Smart UI Components & Libraries – Grid, Scheduler, Gantt, Kanban for Angular, React, Next.js, Vue, Blazor, JavaScript › Forums › Data Grid › DropDown Editor
- This topic has 2 replies, 2 voices, and was last updated 2 years ago by
FerrisChamp.
-
AuthorPosts
-
October 23, 2023 at 9:06 pm #109060
FerrisChamp
ParticipantHello,
I am trying to recreate this
columns: [ { label: 'First Name', dataField: 'firstName', editor: 'input' }, { label: 'Last Name', dataField: 'lastName', editor: 'autoComplete' }, { label: 'Product', dataField: 'productName', template: 'dropDownList', editor: { template: 'dropDownList', dataSource: ["Black Tea", "Green Tea", "Caffe Espresso", "Doubleshot Espresso", "Caffe Latte", "White Chocolate Mocha", "Caramel Latte", "Caffe Americano", "Cappuccino", "Espresso Truffle", "Espresso con Panna", "Peppermint Mocha Twist"] } },which I found here: https://www.htmlelements.com/docs/grid-cell-edit/
in C#, but I can’t figure it out. This is what I have so far.new GridColumn() { DataField = field.FieldName, Label = field.AliasName, ColumnGroup = field.GroupName, ValidationRules = field.DataType.ValidationRules, DataType = field.DataType.GetSmartType(), CellsClassName = "font-change", ClassName = "ColumnHeaderName", Template = "dropdownlist", Editor = "dropDownist" });Thank you.
-
This topic was modified 2 years ago by
FerrisChamp.
October 24, 2023 at 6:28 pm #109067ivanpeevski
ParticipantHi FerrisChamp,
Here is an example of a GridColumn object with a dropDownList editor and custom dataSource:
new GridColumn()
{
DataField = “Product”,
Label = “Product Name”,
Template = “dropDownList”,
Editor = new Dictionary<string, object>()
{
{“template”, “dropDownList” },
{“dataSource”, new string[] {“Black Tea”, “Green Tea”,
“Caffe Espresso”, “Doubleshot Espresso”,
“Caffe Latte”, “White Chocolate Mocha”,
“Caramel Latte”, “Caffe Americano”,
“Cappuccino”, “Espresso Truffle”,
“Espresso con Panna”, “Peppermint Mocha Twist”} },
}
}Best Regards,
Ivan Peevski
Smart UI Team
https://www.htmlelements.com/October 25, 2023 at 4:55 pm #109069FerrisChamp
ParticipantThank you! This solved my problem!
-
This topic was modified 2 years ago by
-
AuthorPosts
- You must be logged in to reply to this topic.