<e-grid-column field="TaskName" headerText="TaskName" editType="dropdownedit" dataSource="ViewBag.tasks"></e-grid-column>

Hi I am have a hard time adding data source to <e-grid-column field="TaskName" headerText="TaskName" editType="dropdownedit" dataSource="ViewBag.tasks"></e-grid-column>

My ViewBag is as follows:

var tasks = _context.TechTrackTasksViewModels.ToList();

            var taskList = new List<object>();

            foreach (var tsk in tasks)
            {
               taskList.Add(new {value = tsk.TaskName,text = tsk.TaskName });
            }

            ViewBag.tasks = taskList;

Not working using ASp Net core 3.1 and latest Syncfusion Lib and Grid control

Your help would be appreciated

Regards

Edmund Herbert



3 Replies 1 reply marked as answer

MS Manivel Sellamuthu Syncfusion Team November 23, 2020 06:52 AM UTC

Hi Edmund, 

Greetings from Syncfusion support. 

From the shared code example, we could see that you want to bind the custom dataSource for the dropdown. You can provide data source to the DropDownList by using the params of edit property of e-grid-column. Please refer the below documentation for more information. 


Please let us know, if you need further assistance. 

Regards, 
Manivel 


Marked as answer

EH Edmund Herbert November 23, 2020 07:01 AM UTC

Thank you for your prompt reply

Regards

Edmund Herbert


MS Manivel Sellamuthu Syncfusion Team November 24, 2020 05:18 AM UTC

Hi Edmund, 

Thanks for your update. 

Please let us know, if you need further assistance on this. 

Regards, 
Manivel 


Loader.
Up arrow icon