Click here to Skip to main content
15,313,293 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey can you please tell me how to edit multiple checkbox values
for create i use

public void ChangeCheckbox(int id)
{
var feature = FeaturesList.FirstOrDefault(x => x.FeatureId == id);

product.FeaturesList.Add(feature);
}
this code while adding and its successfully run
but when i use to edit it
System.NullReferenceException: 'Object reference not set to an instance of an object.' CrudWith Radzen.ViewModel.Product ViewModel.Features List.get returned null. this type of error occur

What I have tried:

public void ChangeCheckbox(int id)
    {
        var feature = FeaturesList.FirstOrDefault(x => x.FeatureId == id);
       
        product.FeaturesList.Add(feature);
}
Posted
Comments
Richard MacCutchan 31-Mar-21 9:48am
   
Which reference is Null?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900