GridView for editing function list

1 Answer 87 Views
GridView
Marian
Top achievements
Rank 2
Iron
Iron
Iron
Marian asked on 17 Dec 2022, 11:52 PM

Hello,

I want to make editor for editing function list, something like screenshot below. I would like to ask for an advice, what's the best approach to do this. I have idea to use GridView with self referencing, using some background class for representation of this structure, and massive cell parsing/formatting/validating for handling second column with parameters, validating different types of parameters, coloring of invalid values etc. Or, it's just two level structure, is it better to use "normal" hierarchy, main level for functions, and second level for different parameter? I haven't tried anything yet, just asking for advice for the best approach, I think it will take more time to do this.

And second question, I was playing a little with hierarchies some time ago, and most scenarios needed data binding for correct hierarchy. Is it possible to do self referencing without data binding?

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 19 Dec 2022, 05:42 AM

Hi, Marian,

Self-referencing hierarchy in RadGridView is a possible approach for building the hierarchy illustrated in the screenshot. However, note that the columns in RadGridView share common data types in the cells that belong to a particular column. Hence, if you need to contain and edit different data types in a column, I believe that a better option would be to use RadPropertyGrid.

It is possible to add unbound data by using a RadPropertyStore filled with the desired PropertyStoreItems:

https://docs.telerik.com/devtools/winforms/controls/propertygrid/populating-with-data/radpropertystore-adding-custom-properties 

However, please have in mind that currently, the ExpandableObjectConverter is the appropriate solution for adding nested properties in RadPropertyGrid. Using TypeConverters is quite a flexible mechanism that RadPropertyGrid offers: https://docs.telerik.com/devtools/winforms/controls/propertygrid/type-converters 

It would be nice to have a more flexible and easy approach, e.g. PropertyStoreItem.Items collection that allows you to add nested properties. We already have a feature request for similar functionality: https://feedback.telerik.com/winforms/1463121-radpropertygrid-add-possibility-to-add-child-items-for-a-propertystoreitem 

I hope that the following KB article would be quite useful about covering your scenario: https://docs.telerik.com/devtools/winforms/knowledge-base/show-nested-collections-in-propertygrid 

Please give it a try and see how it works for your case. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Marian
Top achievements
Rank 2
Iron
Iron
Iron
commented on 19 Dec 2022, 09:45 AM

Hello, thanks, also for the option with PropertyGrid. I will look on it. And yes, I know GridView column has the same type, I though I will use just string and do some formatting/validating/parsing on background data. PropertyGrid looks also good, maybe it would be really better option, I will try. Thanks.
Tags
GridView
Asked by
Marian
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or