Live Chat Icon For mobile
Live Chat Icon

How can I add my custom columnstyles to the designer so I can use them in my DataGrid at design time

Platform: WinForms| Category: Datagrid

To use custom columnstyles in the designer, you need to do three things.

1) Derive a CustomColumnStyle to implement the functionality you want.
2) Derive a DataGridTableStyle class and add a new GridColumnStyles property that uses this derived CollectionEditor. This GridColumnStyle hides the baseclass member.
3) Derive a DataGrid and add a new TableStyles collection that uses your derived tablestyle.

Both steps 2 and 3 will require you to derive a CollectionEditor and override CreateNewItemTypes to use the derived classes from each step in the designer.

Here is a sample project showing how you might do these things.

Share with

Share on twitter
Share on facebook
Share on linkedin

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.