I'm trying to use a grid with an existing db table that can't be altered.
There's no key, just a CAR_CD and CAR_DESC, both defined as strings.
In my datasource, when I don't specify a model.Id (like below), I get an error "There is no DataSource Model Id property specified." in the Visual Studio debugger. It's looking for an Id.
.DataSource(dataSource =>
dataSource.Ajax()
.PageSize(50)
.Batch(true) // Enable batch updates
.Model(model =>
{
model.Field(car => car.CAR_CD).Editable(true);
model.Field(car => lob.CAR_DESC).Editable(true);
})
SO... I change the CAR_CD to an Id (see below) and then get "CS1660: Cannot convert lambda expression to type 'string' because it is not a delegate type".
{
model.Id(car => car.CAR_CD).Editable(true);
model.Field(car => lob.CAR_DESC).Editable(true);
})
Is there an easy way to use a natural key (CAR_CD + CAR_DESC)? I can test them for uniqueness in the .net code, but I need to get the grid to function.
Thanks.