Custom Fields


Author
Message
Ian Hammond
Ian Hammond
StrataFrame Novice (81 reputation)StrataFrame Novice (81 reputation)StrataFrame Novice (81 reputation)StrataFrame Novice (81 reputation)StrataFrame Novice (81 reputation)StrataFrame Novice (81 reputation)StrataFrame Novice (81 reputation)StrataFrame Novice (81 reputation)StrataFrame Novice (81 reputation)
Group: Forum Members
Posts: 57, Visits: 277
Hi,

I am trying to populate a grid from 2 BO's by creating custom fields in the 'master' BO. My code for the custom field properties is :



#region " Custom Field Properties"

private const String constComputerName = "computerName";

private const String constLoggedIn = "loggedIn";

[
Browsable(false)]

[
BusinessFieldDisplayInEditor()]

[
Description("computerName")]

[
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]

public String computerName

{

get { return this.CurrentRow[constComputerName].ToString(); }

set { this.CurrentRow[constComputerName]= value; }

}

[
Browsable(false)]

[
BusinessFieldDisplayInEditor()]

[
Description("loggedIn")]

[
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]

public Boolean loggedIn

{

get { return (Boolean)this.CurrentRow[constLoggedIn]; }

set { this.CurrentRow[constLoggedIn] = value; }

}

#endregion



My form has the following event enabled:



private void hlsUserNamesBO1_ParentFormLoading()

{

this.hlsUserNamesBO1.FillUserNames();

this.hlsUserProfilesBO1.FillAllProfiles();

foreach (HLSUserNamesBO row in this.hlsUserNamesBO1.GetEnumerable())

{

this.hlsUserProfilesBO1.Filter= "userId = " + row.userId;

this.hlsUserNamesBO1.computerName = this.hlsUserProfilesBO1.computerName;

this.hlsUserNamesBO1.loggedIn = this.hlsUserProfilesBO1.loggedIn;

}

}



When I hit the assignment to computerName I get the exception

"Column 'computerName' does not belong to table HLSUserNames."

Can anyone please advise, many thanks
Replies
Ian Hammond
Ian Hammond
StrataFrame Novice (81 reputation)StrataFrame Novice (81 reputation)StrataFrame Novice (81 reputation)StrataFrame Novice (81 reputation)StrataFrame Novice (81 reputation)StrataFrame Novice (81 reputation)StrataFrame Novice (81 reputation)StrataFrame Novice (81 reputation)StrataFrame Novice (81 reputation)
Group: Forum Members
Posts: 57, Visits: 277
Thanks for the suggestion, I have decided to try the ListView route. I have used the ChildDialogFormSample as a guide. I have it partially functioning. The issues I have at the moment are:

1) My computer name and logged in values are not displayed.

2) My call to SeekToPrimaryKey(list.SelectedItems[0].Tag) seems to generate an exception, it seems that it can't find the record with the index value, which I have confirmed is in the table.

I would appreciate a shove in the right direction on this, many thanks.
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Iam,

The listview has a property named AutoNavigateToSelectedRecord, if you set this to True, you can then just reference the BO and no need to seek the record.

Here are the settings I use for the ListView:

  1. I drop an instance of the BO I will use in the ListView in the fom.  I do this so I can manipulate the data in the BO instead of the ListView where I may not have all the fields I need to work with.
  2. PopulationDataSourceSettings (Method to Execute) CopyDataFrom(BusinessLayerBase,BusinessCloneDataType).  Make sure the "Tag Field" is the PK of your table.
  3. When using the population type in #2, you must tell the ListView to use the BO in step 1, so do this in the ListPopulating event using code like this (sorry VB)

e.Parameters(0).Value = Me.BizTransactionItems1
e.Parameters(1).Value = MicroFour.StrataFrame.Business.BusinessCloneDataType.ClearAndFillFromDefaultView
  • AutoNavigateToSelectedRecord = True
  • BusinesObject = the one dropped in step 1.
  • ChildForm =  whatever childformdialog you will be using.
Make sure you populate your BO either manually or at the form load.

Edhy Rijo

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