Unplanned
Last Updated: 30 Apr 2019 15:17 by ADMIN
Anthony
Created on: 03 Apr 2019 13:43
Category: GridView
Type: Feature Request
3
GridView: Expose a property that allows to specify a DataTemplate, which will be displayed when the "Add New Row" element is clicked

Add a property to the RadGridView that provides a distinct template for adding a new row.

Sometimes you have classes with no default constructor. Those classes may have properties that are read-only after construction. This cannot be handled in the RadGridView, because you only have the choice of a CellEditTemplate. (I'm envisioning something akin to the RowDetailsTemplate.)

Example: I have a class that defines a invoice match for payment application. Once the invoice is set it cannot be changed. The user can still edit the match, but they're only allowed to edit the amount to be applied.

9 comments
ADMIN
Vladimir Stoyanov
Posted on: 30 Apr 2019 15:17
Hello Anthony,

Thank you for the taking the time to prepare a sample picture.

Regards,
Vladimir Stoyanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Anthony
Posted on: 24 Apr 2019 13:18
You're welcome. And thank you for your efforts pushing this forward. I've included a simple sketch with two options (implementing as a row template or cell add template similar to the cell edit template).
Attached Files:
ADMIN
Vladimir Stoyanov
Posted on: 24 Apr 2019 12:34
Hello Anthony,

Thank you for the confirmation.

I will proceed with changing the status of this feature request to "Approved". I also updated the title of the item in order to follow our convention.

That said, if you find it possible, please send over a picture demonstrating the expected result. It will be helpful during the implementation.

Regards,
Vladimir Stoyanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Anthony
Posted on: 19 Apr 2019 21:51

Thank you Vladimir.

Your understanding is correct. It would be great if it supported non-default constructors, but it would be a huge benefit even if it required a default constructor (and set properties as usual).

I'm sure your designers can come up with a great layout, but I'd be happy to sketch it if there's still any uncertainty.

ADMIN
Vladimir Stoyanov
Posted on: 19 Apr 2019 15:03
Hello Anthony,

Thank you for the additional information.

I am sorry to hear that the previous suggestions were not helpful. Please, allow me to say that I wanted to make sure that there isn't already existing functionality that would be suitable for you. 

Before I continue with approving this feature request, may I ask you to confirm whether my understanding of it is correct? This will make sure that there isn't any misunderstanding and help during the development of the feature.

Currently, my understanding is that you want the option that specify a DataTemplate, which will be used when the "Add New Row" element is clicked. Feel free to let me know, if I am missing something.

I am looking forward to your reply.

Regards,
Vladimir Stoyanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Anthony
Posted on: 15 Apr 2019 13:55

No, that's not what I'm looking for. I feel like for some reason like I'm not being able to convey to you what seems like a simple ask.

Here's one example...

Each payment from the customer contains any number of detail lines - usually several hundred. These payment remittance details are based on how their system works, not ours. They aren't tied to invoices in the classical sense, and that makes it difficult and time consuming for accounting. My application matches them up and does all the work, but in some cases there are insufficient details. The user needs to match those remittance detail exceptions to invoices.

I have a class, it represents an invoice match and it contains a reference to an invoice and the amount to be applied as payment against the invoice. Using the RadGridView I want the user to be able to choose an invoice and an amount (it'll default to either the amount unmatched against the remittance or the full amount of the invoice whichever is less). However, after that match is made the user can only (1) change the amount or (2) delete the match entirely.

Right now, the RadGridView doesn't support #1 without allowing you to change the invoice too. It's worth noting that a NewRowTemplate (what I'm asking for), or even the equivalent at the cell level (a companion to the CellEditTemplate) would also allow me to pre-filter the contents of the ICollectionView backing the list of invoices that are displayed. This allows me to greatly narrow down the list of invoices based on things like item, shipment, document, and amount without affecting the display of anything that has already been matched.

I want to stress that I don't need or want a solution using an external component. I've already developed that for my example due to the RadGridView being deficient in this area. This would still be very useful for me, because this isn't the first time that the need for the feature has come up for me -- I have a few ideas of where I'd use it in an upcoming project.

ADMIN
Vladimir Stoyanov
Posted on: 15 Apr 2019 12:55
Hello Anthony,

Thank you for the additional information. 

My current understanding is that you want the user to be able to configure the properties of the object before it is added to the RadGridView. Feel free to correct me, if I am wrong and provide some more details about what you are trying to achieve.

If that is indeed the case, you should be able to benefit from the RadDataForm component. May I ask you to check out the ICollectionView Synchronization RadDataForm example from our demos? It shows how a RadDataForm can be synced with a RadGridView in order to modify and add entities. 

You can also check out the IntegrateWithRadGridView RadDataForm SDK example. It shows how the RadDataForm can be added to the RadGridView RowDetails.

Does the functionality demonstrated in the above examples correspond with your requirements? 

Looking forward to your reply.

Regards,
Vladimir Stoyanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Anthony
Posted on: 09 Apr 2019 16:20

Thank you for following-up. No, that won't solve the use case which is for the user to be able to provide the information with the data grid for the purpose of constructing the instance. Using that event presumes that the needed state is already known, or will be gathered in another way (which I'm forced to do now anyway).

Even if the grid couldn't technically handle the non-default constructor, the value is there in having a different template between adding and editing and keeping things controlled by the datagrid. I could see several instances where having this feature would be beneficial to me. I believe Infragistics had something like this (could've been their Windows Forms controls - it's been years since I used them).

ADMIN
Vladimir Stoyanov
Posted on: 09 Apr 2019 13:17
Hello Anthony,

May I ask you to check out the AddingNewDataItem event of the RadGridView? With its help, you can initialize a new object, when it does not have a default constructor. Even if the object has readonly properties, the control handles that by allowing the user to edit only the remaining ones.

I am attaching a sample project demonstrating what I have in mind. Please, check it out and let me know, if this is what you were going for.

I am looking forward to your reply.

Regards,
Vladimir Stoyanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Attached Files: