This is a migrated thread and some comments may be shown as answers.

I Think I Broke It

2 Answers 28 Views
GridView
This is a migrated thread and some comments may be shown as answers.
John Simmons
Top achievements
Rank 1
John Simmons asked on 16 Jul 2009, 01:21 PM
I scraped the RadGridView style in expression blend, and then massaged it so that it had a titlebar that itself contains a toolbar.  In order to set the properties for those new elements, I derived a new class from RadGridView and added attached properties.  All of this seems to work well.

HOWEVER

When we instantiate the custom class, our existing databinding doesn't work.  I'm not aware of anythign I might have done to break this, but at the same time, I don't know exactly how to go about determining what's wrong.  I'm in the process of creating a sample project so you can see what I'm doing (in case you need it).

2 Answers, 1 is accepted

Sort by
0
Stefan Dobrev
Telerik team
answered on 16 Jul 2009, 03:54 PM
Hi John,

My advice is to prefer composition over inheritance. I think it is best to create a UserControl and encapsulate your behavior there. If you want to act against the GridView you can always expose a property of the UserContol that will return the GridView.

Despite my advice I'm waiting for your project, so that we can further assist you.

All the best,
Stefan Dobrev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
John Simmons
Top achievements
Rank 1
answered on 17 Jul 2009, 08:13 PM
I can't do the user control approach because we're going to have DOZENS of grids in the application and to create a user control for each one is - frankly - ludicrous.  The sad part of hat statement is that I spent a day and a half on the user control approach only to realize why we can't do it that way after I was done.

It MUST be an derived class.  I'll go ahead and do up a project for you so you can see what I'm seeing.
Tags
GridView
Asked by
John Simmons
Top achievements
Rank 1
Answers by
Stefan Dobrev
Telerik team
John Simmons
Top achievements
Rank 1
Share this question
or