Custom Edit Dialog when adding new row

1 Answer 81 Views
GridView
Marc Simkin
Top achievements
Rank 2
Iron
Veteran
Iron
Marc Simkin asked on 10 Aug 2021, 07:53 AM

Hi.

I found an old posting (KB, forum, ??) about how to use a custom dialog to edit an existing data row in the grid.

That required the GridCellDoubleClick and GridCommandCellClick events to be intercepted.

I need to have the same dialog appear when adding a new row.  What is the best way to get this done?  Should I intercept the DefaultValuesNeeded event or the CreateRow event?

If I use the DefaultValuesNeeded event, if I have the underlying record created when the add operation starts, will any changes to that underlying record be reflected in the grid view automatically?

Thanks

-marc

 

 

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 10 Aug 2021, 01:20 PM
Hello, Marc,

According to the provided information, I suppose that you are referring to this KB article:
https://docs.telerik.com/devtools/winforms/knowledge-base/edit-a-cell-in-gridview-with-a-dialog 

I have modified the sample project in a way to handle editing the new row as well. The attached gif file illustrates the achieved result. Please give it a try and see how it works for your scenario.

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Marc Simkin
Top achievements
Rank 2
Iron
Veteran
Iron
commented on 10 Aug 2021, 01:28 PM

Hi Dess:

Thank you. 

At first glance that is close to what I want.

I was able to get this to work without the need for an edit button.  I need to dig into the sample code to see if it is possible to do the same thing when adding a new row.

Please give me a couple of days to confirm.

Thanks

-marc

Dess | Tech Support Engineer, Principal
Telerik team
commented on 10 Aug 2021, 01:39 PM

Hi, Marc,

I am glad that the suggested solution seems to be applicable for your case. Take as much time as you need to perform the necessary tests.

Marc Simkin
Top achievements
Rank 2
Iron
Veteran
Iron
commented on 25 Aug 2021, 04:20 AM

My apologies for taking so long to follow up.  Once I dug into the provided example and adapted to to work without the need to click into a cell of the new row.  It failed.

I get various errors from within the grid code.  I've seen null reference exceptions about mouse click events, issues with row binding, etc.

I have decided at this point, to find a different approach.

Thanks

-marc

Dess | Tech Support Engineer, Principal
Telerik team
commented on 25 Aug 2021, 07:48 AM

Hi, Marc,

I am really sorry to hear that you are experiencing any further difficulties with the custom edit dialog approach. Since it is not clear what are the exact changes that you have made on your end, it would be difficult to conclude what causes the undesired behavior and errors.

In case you decide to give another chance of this approach, feel free to submit a support ticket from your Telerik account and provide a sample project demonstrating the undesired behavior. Thus, we would be able to make an adequate analysis of the precise case and think about a suitable solution. Thank you in advance.

Tags
GridView
Asked by
Marc Simkin
Top achievements
Rank 2
Iron
Veteran
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or