Basic FK data populate on Maintenance Forms


Author
Message
Alex M. Lana
Alex M. Lana
StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)
Group: Forum Members
Posts: 20, Visits: 264
Thanks Ben, exactly this I'm trying to acomplish, but it seems that SF C# classes miss some methods present in VB.

I can't find anything to send as:

MicroFour.StrataFrame.Business.BusinessNavigatedPosition NavigatedPositionArg

and

IsCurrentDataTableRefilled

this.sysProdutoBO1.Navigated += new MicroFour.StrataFrame.Business.NavigatedEventArgs(

??? this.SysProdutoBO1.NavigatedPositionArg ???,

this.sysProdutoBO1.CurrentRowIndex,

??? this.sysProdutoBO1.IsCurrentDataTableRefilled ???);



namespace MicroFour.StrataFrame.Business

{

public class NavigatedEventArgs : EventArgs

{

// Summary:

// Initializes a new instance of the NavigatedEventArgs class.

//

// Parameters:

// NavigatedPositionArg:

//

// CurrentRowIndexArg:

public NavigatedEventArgs(BusinessNavigatedPosition NavigatedPositionArg, int CurrentRowIndexArg, bool IsCurrentDataTableRefilled);



// Summary:

// Gets the absolute index of the newly selected record within the business

// object.

public int CurrentRowIndex { get; }

//

// Summary:

// Gets a value that indicates whether this navigation was the result of the

// CurrentDataTable being refilled.

public bool IsCurrentDataTableRefilled { get; }

//

// Summary:

// Gets a value that indicates where the newly selected record is in relation

// to the entire visible recordset.

public BusinessNavigatedPosition NavigatedPosition { get; }

}

}





Hope you can help me, I think it may be pretty simple.

I only need a simple C# version of this VB code:

Private Sub sysProdutoBO1_Navigated(ByVal e As MicroFour.StrataFrame.Business.NavigatedEventArgs) Handles sysProdutoBO1.Navigated



End Sub




Thanks,



Alex
StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Aha, you don't want to add a new NavigatedEventArgs to the handler, you want to add a new method delegate to the handler... like this:

using MicroFour.StrataFrame.Business;

namespace SomeNamespace
{
   
    public class SomeClassHandlingTheNavigatedEvent
    {
         private void AddHandlerToBusinessObject(BusinessLayer bo)
         {
             bo.Navigated += new BusinessLayer.NavigatedEventHandler(this.MyNavigatedHandlingMethod);
         }

         private void MyNavigatedHandlingMethod(NavigatedEventArgs e)
         {
             //-- Do whatever you want with the e.[properties]
             //   as they will contain the indexes and such
         }
    }
}

The difference here is that you use the constructor of the event handler and pass the name of the method you want to execute.  Then, when the business object wants to fire it's Navigated event, it will call your method.

Also, if you've dropped a business object on a form, you can easily add a new event handler by going to the property sheet for the business object and clicking the events tab (the little lightning bolt at the top of the property sheet).  Scroll down to the Navigated event and double-click it.  The designer will add the handler and take you to the code file to the method that it created for you.

Alex M. Lana
Alex M. Lana
StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)
Group: Forum Members
Posts: 20, Visits: 264
Smile

Thanks for the example Ben, it was exactly that.



Alex
StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Glad you got it working.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search