Dropdown list in modal Grid edit : value not persisting

In the attached file there is a drop down for Employee.Designation.  It is set for 2-way binding, but the value does not persist when the modal dialog closes:

                        <div class="form-row">

                            <div class="form-group col-md-12">

                                <label class="e-label-top">Designation:</label>

                                <SfDropDownList TItem="string"

                                                TValue="string"

                                                Text="@Employee.Designation"

                                                @bind-Value="@Employee.Designation"

                                                Placeholder="Designation"

                                                DataSource="@EmployeeDesignations">

                                </SfDropDownList>

                            </div>

                        </div>


Attachment: EmployeeComponent.razor_aa793cd2.zip

3 Replies 1 reply marked as answer

RS Renjith Singh Rajendran Syncfusion Team September 8, 2021 11:26 AM UTC

Hi Scot, 

We have analyzed your shared codes and we could see that you have not defined IsPrimaryKey for any of the GridColumn in Grid. We suspect that this might be causing the reported problem. When perform editing in Grid, it is a must to set IsPrimaryKey as true for any of the unique valued column in Grid to perform CRUD in grid. Please refer the below documentation for more details, 

Kindly check this by setting a unique valued column as primary key. If you are still facing difficulties, then the following details wold be helpful for us to proceed further. 

  1. Share a video demo showing the problem you are facing.
  2. Share the details of any exception/error occurred in the browser console.
  3. Bind OnActionFailure event to grid, and share the details you get in the args of this event handler.

The provided information will help us analyze the problem, and provide you a solution as early as possible. 

Regards, 
Renjith R 


Marked as answer

SW Scot Woodyard replied to Renjith Singh Rajendran September 8, 2021 05:28 PM UTC

That did it - thank you!



RS Renjith Singh Rajendran Syncfusion Team September 9, 2021 04:33 AM UTC

Hi Scot, 

Thanks for your update. Please get back to us if you need further assistance. 

Regards, 
Renjith R 


Loader.
Up arrow icon