Print Page | Close Window

GridViewPresenter

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=470
Printed Date: 14-Sep-2025 at 8:31am


Topic: GridViewPresenter
Posted By: orcities
Subject: GridViewPresenter
Date Posted: 04-Oct-2007 at 2:06pm
I am trying to override the grid view presenter, being used on a PageView, So that I can catch the current item changed.
 
Unfortunately it is not working.
 
I have placed the: mGridBindingManager.CurrencyManager.CurrentChanged += new System.EventHandler(CurrentChanged); in the Constructor. But it is never called.
 
I also can not see any events for the binding manager.
 
Can someone help.



Replies:
Posted By: Linguinut
Date Posted: 04-Oct-2007 at 2:17pm
Is this grid on the summaryview created by the wizard?  If so, I overrode the OnBindingContextChanged event in the view.  I may have cheated here, but I set the bindingsource of my gridmanager to the bindingsource of my controlmanager.  A hack, perhaps, but, at the moment, it works.
 
protected override void OnBindingContextChanged(System.EventArgs e)
{
    base.OnBindingContextChanged(e);
    mGridBindingManager.BindingSource = mControlBindingManager.BindingSource;
    mGridBindingManager.BindingSource.ResetBindings(false);
}


Posted By: orcities
Date Posted: 04-Oct-2007 at 2:27pm
I ended up using the PageControllers MainBindingManager to check for change in current.
 
So I got it to work.
 
Bill,
 
If you get a chance what would be the best way to do this.


Posted By: Linguinut
Date Posted: 04-Oct-2007 at 2:29pm
How'd you wire up the grid?


Posted By: orcities
Date Posted: 04-Oct-2007 at 2:31pm
When I create the view for that section I also created the MainBindingSource.CurrentChanged += ....
 
 


Posted By: Linguinut
Date Posted: 04-Oct-2007 at 2:37pm

So this is not the summaryview of the main page, then.  I think I misunderstood.  Are you working on a control/grid view in the detail tabs (or some other smartpart workspace)?  My example wouldn't quite fit, then.



Posted By: orcities
Date Posted: 04-Oct-2007 at 2:52pm

I placed a gridview in one of my smartpartplaceholders for a pageview that I created. So it was not a tab.

But I did do something similiar for tab controller.



Print Page | Close Window