Hi John,
Greetings from Syncfusion support.
Query: “I am able to select the Data Source, Model Class, Set Primary Key, and Columns but the Data Context is dropdown list is empty. Why is that”
We have analyzed your query and we would like to inform you that Data Context dropdown will have list of DbContext inherited class that has been defined in the project application. It is used to fetch datasource from database file using Microsoft EntityFramework. If you have not defined any such classes, then that dropdown will be empty.
Refer the below code example
|
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using DataGrid_Code.Data;
namespace DataGrid_Code.Data
{
public class OrderContext : DbContext
{
public virtual DbSet<Order> Orders { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (!optionsBuilder.IsConfigured)
{
optionsBuilder.UseSqlServer(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename='D:\Native support\F170426 - EF Grid\EFGrid\EFGrid\App_Data\NORTHWND.MDF';Integrated Security=True;Connect Timeout=30");
}
}
}
}
|
If are facing this issue even after defining the DbCOntext class, kindly share the following details to validate the reported query further at our end.
- Share your Visual Studio Version details.
- Share details about your DbContext class / file.
- Are you facing any compilation error / warning while opening the code generator.
- If possible share your model class and test project to validate the reported query at our end.
Above requested details will be very helpful for us to validate the reported query at our end and provide solution as early as possible.
Regards,
Vignesh Natarajan