Data not save in grid and how to hide Key field during new entry

Hi,


I have 2 questions

Is there any way to hide ID during adding a new record?

data is not saved in the table but is displayed in the grid with ID is 0 and disappears when reload the page


Attached are screenshots for your reference.


Best regards


SAM


Attachment: Grid_Question_ecae5c9e.rar

7 Replies 1 reply marked as answer

SP Sarveswaran Palani Syncfusion Team June 7, 2022 12:46 PM UTC

Hi Sao,


Greetings from Syncfusion support.


Query: “Data not save in grid and how to hide Key field during new entry


We have analyzed your query and suggest you to assign Visible property value as false. So, You can hide the data of any particular column in the DataGrid. We have already discussed about this topic Visibility in our UG documentation. Kindly refer the documentation link shared.


Refer our UG Documentation: https://blazor.syncfusion.com/documentation/datagrid/columns#visibility


Please get back to us, If you have any further queries


Regards,

Sarveswaran PK



SA Sao replied to Sarveswaran Palani June 7, 2022 10:03 PM UTC

Hello,


You have answered one of the questions. The other issue I faced was not able to save data to the SQL server due to the ID always having the value of 0.

Could you please address that




SP Sarveswaran Palani Syncfusion Team June 8, 2022 05:32 PM UTC

Hi Sam,

Thanks for contacting Syncfusion Support.

We have analyzed your query and found that you have defined the ID column as IsIdentity and IsPrimaryKey. IsIdentity property must be enabled to column whose values are auto incremented in database. However, the value is still 0 to that column in your sample. So we need some more details about the issue you are facing.


Kindly share the following details to validate the reported query further at our end.


  1. Is the ID column is auto incremented column in your database?
  2. Please mention if you are facing any exception or script errors while inserting a record.
  3. Share the Video demo of the issue you are facing.
  4. Share simple issue reproducible sample.


Above requested details will be helpful for us to validate the reported query at our end and provide solution as early as possible. 


Regards,

Sarveswaran PK



SA Sao June 9, 2022 01:44 AM UTC

Hello,


I would like to provide the following

  1. Is the ID column is auto incremented column in your database? Yes
  2. Please mention if you are facing any exception or script errors while inserting a record. No scrip exception displayed
  3. Share the Video demo of the issue you are facing. (See attached)
  4. Share simple issue reproducible sample (Please check DBContet and DB services in the attachment)


Regards
SAM

Attachment: Presentation1_22cba0c.rar


VN Vignesh Natarajan Syncfusion Team June 9, 2022 12:43 PM UTC

Hi Sam,


Thanks for sharing the details.


The reported issue will occur when newly inserted records do not get updated in the database properly. We couldn’t find any video demo in the attachments, so kindly share the video demo of the issue. Also, we could find some changes in the CRUD method
in the LibraryService. Previously they were named as InsertGL, UdpateGl, and DeleteGl. But in the recently shared code example, they were defined as InsertImportantData, UpdateImportantData etc. .So kindly ensure the same that the records were properly updated in the database in the OnActionBegin event handler.


Kindly ensure the reported issue by defining the OnActionFailure event of Grid. If you are facing any exceptions, kindly share the error details which will be very helpful for us to analyze the issue further at our end.


Regards,

Vignesh Natarajan



SA Sao June 9, 2022 01:40 PM UTC

Hello,


Video is on slide 3 of the powerpoint attachment, kindly play it.


Regards


Samnang



VN Vignesh Natarajan Syncfusion Team June 10, 2022 08:44 AM UTC

Hi Sam,


Sorry for the inconvenience caused.


We have reviewed the video demonstration shared in the PPT and from the video demo, we understand that newly inserted records do not get inserted into your database properly using the OnActionBegin event. Hence on refreshing the page, the inserted record does not exist. We suspect some issues occur while inserting the records into your database using the LibraryService method.


Note: When IsIdentity is enabled, that particular column will be disabled from inserting and editing. so that column value will be auto-updated while inserted into the database. Hence 0 will be the default value. but once inserted, it will be refreshed properly in the OnActionComplete event.


So kindly confirm that newly inserted records get inserted properly into your database in the OnActionBegin event using LibraryService.InsertGL(Args.Data) method. If you are still facing the reported issue, kindly get back to us with more details about the issue you are facing.


Regards,

Vignesh Natarajan


Marked as answer
Loader.
Up arrow icon