﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » BO does not navigates to the new row for editing</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Wed, 15 Apr 2026 04:34:21 GMT</lastBuildDate><ttl>20</ttl><item><title>BO does not navigates to the new row for editing</title><link>http://forum.strataframe.net/FindPost26526.aspx</link><description>Hi,&lt;br&gt;
In my baseclass I try to add new row.&lt;br&gt;
1) I have an Treeview with DataSource as BBS&lt;br&gt;
2) I get reference to BO over BBS.BusinessObject&lt;br&gt;
3) Try to add new record with BO.add()&lt;br&gt;
4) Try to update some properties of BO&lt;br&gt;
&lt;br&gt;
As result - I update properties of row, where currently cursor located. and after .Add() pointer does not navigates new row. Why?&lt;br&gt;
&lt;br&gt;
Here is completed code for this&lt;br&gt;
&lt;br&gt;
      If Not IsNothing(Pmks_treeview) Then&lt;br&gt;
            If Not IsNothing(Pmks_treeview.DataSource) Then&lt;br&gt;
                Dim loBBS As MicroFour.StrataFrame.Business.BusinessBindingSource = TryCast(Pmks_treeview.DataSource, MicroFour.StrataFrame.Business.BusinessBindingSource)&lt;br&gt;
                If Not IsNothing(loBBS) Then&lt;br&gt;
                    Dim loBO As MicroFour.StrataFrame.Business.BusinessLayer = TryCast(loBBS.BusinessObject, MicroFour.StrataFrame.Business.BusinessLayer)&lt;br&gt;
                    Dim lcParentId_Field As String = Pmks_treeview.ParentFieldName&lt;br&gt;
                    If Not String.IsNullOrEmpty(lcParentId_Field) Then&lt;br&gt;
                        loBO.Add()&lt;br&gt;
                        loBO.GetType().GetProperty(lcParentId_Field).SetValue(loBO, tnParentId, Nothing)&lt;br&gt;
                        If Not String.IsNullOrEmpty(Pmks_treeview.pmks_group_caption_fieldname) Then&lt;br&gt;
                            loBO.GetType().GetProperty(Pmks_treeview.pmks_group_caption_fieldname).SetValue(loBO, Pmks_treeview.pmks_default_group_caption, Nothing)&lt;br&gt;
                        End If&lt;br&gt;
                        loBO.Save()&lt;br&gt;
                    End If&lt;br&gt;
                End If&lt;br&gt;
            End If&lt;br&gt;
        End If&lt;br&gt;
&lt;br&gt;
Thanks&lt;br&gt;
Denis</description><pubDate>Thu, 18 Mar 2010 13:49:22 GMT</pubDate><dc:creator>dgsoft</dc:creator></item><item><title>RE: BO does not navigates to the new row for editing</title><link>http://forum.strataframe.net/FindPost26534.aspx</link><description>Not sure if this applies in your case but be aware that filters in effect can cause this behavior.  If you have one set (including the filter implicit in automatically filtering child records against the parent) under some cirumstances this can get weird results in moving to the current row.)</description><pubDate>Thu, 18 Mar 2010 13:49:22 GMT</pubDate><dc:creator>Charles R Hankey</dc:creator></item><item><title>RE: BO does not navigates to the new row for editing</title><link>http://forum.strataframe.net/FindPost26530.aspx</link><description>Hi Trent,&lt;br&gt;
Thanks for response,&lt;br&gt;
About BO.item(Fieldname) Ok :))) I see...&lt;br&gt;
&lt;br&gt;
About Add new row..&lt;br&gt;
&lt;br&gt;
loBO.Add&lt;br&gt;
loBO.MoveLast()&lt;br&gt;
&lt;br&gt;
Then update Data - it works perfect.. but just Add - does not navigate row.&lt;br&gt;
&lt;br&gt;
Denis</description><pubDate>Thu, 18 Mar 2010 11:10:19 GMT</pubDate><dc:creator>dgsoft</dc:creator></item><item><title>RE: BO does not navigates to the new row for editing</title><link>http://forum.strataframe.net/FindPost26528.aspx</link><description>Well, first, I cannot give you a straight answer about the tree view as I don't know what control you are using nor how they interpret the IBindingList implementation.  So the first thing that you need to do is remove the tree view from the formula altogether and just add a new row through the BBS.  Another option is to just drop on a DataGridView and see if it works.  This will tell you if the issue is the tree view or some other code.&lt;br&gt;
&lt;br&gt;
Second, I don't understand why you are using reflection to set the parent field.  You are talking to a BO, so if lcParentId_Field is a column in the underlying data table, then you most definitely don't want to use reflection.  You should do this instead:&lt;br&gt;
&lt;br&gt;
[codesnippet]loBO.CurrentRow.Item(lcParentId_Field)[/codesnippet]&lt;br&gt;
&lt;br&gt;
And if the field is a custom property only, then you could possibly do this depending on how the custom property is defined (GetCustomBindablePropertyDescriptors must know about the property to do this):&lt;br&gt;
&lt;br&gt;
[codesnippet]loBO.Item(lcParentId_Field)[/codesnippet]</description><pubDate>Thu, 18 Mar 2010 10:12:07 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>