StrataFrame Forum

Which record selected in browsedialog?

http://forum.strataframe.net/Topic8649.aspx

By Chan - 5/2/2007

Hi,

How could I know which record is selected in browsedialog?

Thank you

By StrataFrame Team - 5/2/2007

You can use a BrowseDialogInfoPanel on the BrowseDialog and there is a RowChanged event that tells you the row that is currently selected within the business object.  However, if you want to know the row that was selected when the BrowseDialog was exited, then the BusinessObjectToPopulate will be filled with the results of the search, and the selected record will be the CurrentRow within the business object.
By Chan - 5/2/2007

Hi,

I tested with the code below, but it always point to first row.

if (this.browsedialog.ShowDialog() == DialogResult.OK)
{
    this.lookupEdit.EditValue = this.mybrowsedialogBO.myField;
}

Any ideas?

Thank you

By Chan - 5/3/2007

Hi

I double check the SF.NET, I only see code to copydatafrom but couldnt see any code that set currentrowindex.

Please advice.

By StrataFrame Team - 5/4/2007

There is a NavigateToPrimaryKey() call within the BrowseDialog.ShowDialog() method on line 1676.  Put a break point on that line and see if it's trying to move to that record.  It might be that there is something wrong with the business object and it just won't navigate to the primary key...
By Chan - 5/4/2007

Hi,

Thank you for info.

After debugging, I found that PrimaryFields is not set. It is because I map my BO to view.

I have set override primary key specification

Thank you

By StrataFrame Team - 5/4/2007

Excellent, glad you figured it out Smile