﻿<?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?)  » CurrentRowIndex</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Wed, 16 Sep 2026 09:30:05 GMT</lastBuildDate><ttl>20</ttl><item><title>CurrentRowIndex</title><link>http://forum.strataframe.net/FindPost9319.aspx</link><description>When I use the Add() method to add a new row to a BO that has a Sort defined, the CurrentRowIndex is being set to zero rather than the actual index of the new row. If a Filter is added to the BO rather than a sort, the CurrentRowIndex is maintained correctly.&lt;/P&gt;&lt;P&gt;I'm on v1.61 pre-release.&lt;/P&gt;&lt;P&gt;-Larry</description><pubDate>Sun, 04 Jan 2009 23:22:02 GMT</pubDate><dc:creator>Larry Caylor</dc:creator></item><item><title>RE: CurrentRowIndex</title><link>http://forum.strataframe.net/FindPost21391.aspx</link><description>[quote][b]Chan (01/04/2009)[/b][hr]May I know what is the "workaround"?[/quote]&lt;P&gt;Hi Chan,&lt;/P&gt;&lt;P&gt;I guess it is to reset the filter prior adding then set the filter again, here is a pseudo code:&lt;/P&gt;&lt;P&gt;[codesnippet][code]&lt;/P&gt;&lt;P&gt;DIM strTempFilter as String&amp;nbsp;= MyBO.Filter&lt;/P&gt;&lt;P&gt;MyBO.Filter = String.Empty&lt;/P&gt;&lt;P&gt;MyBO.Add()&lt;/P&gt;&lt;P&gt;MyBO.Filter = strTempFilter&lt;/P&gt;&lt;P&gt;[/code][/codesnippet]</description><pubDate>Sun, 04 Jan 2009 23:22:02 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: CurrentRowIndex</title><link>http://forum.strataframe.net/FindPost21390.aspx</link><description>Hi,&lt;br&gt;
May I know what is the "workaround"?&lt;br&gt;
&lt;br&gt;
Thank you</description><pubDate>Sun, 04 Jan 2009 22:16:30 GMT</pubDate><dc:creator>Chan</dc:creator></item><item><title>RE: CurrentRowIndex</title><link>http://forum.strataframe.net/FindPost9333.aspx</link><description>Thanks for the explanation. It must have been right after&amp;nbsp;lunch when we went over that in class:doze: Conceptually I can see how you could handle a sorted BO since a Sort would never remove a row from the CurrentView, but a Filter would present some issues.&lt;P&gt;-Larry</description><pubDate>Tue, 05 Jun 2007 17:35:46 GMT</pubDate><dc:creator>Larry Caylor</dc:creator></item><item><title>RE: CurrentRowIndex</title><link>http://forum.strataframe.net/FindPost9326.aspx</link><description>No, we actually try to handle the situations where a new row might be filtered out or sorted, however, the following code is called right before the SetDefaultValues() is raised, so it will be right up until you set a field within the SetDefaultValues().&amp;nbsp; The problem with having a sort or filter set when you're adding rows is that the record might change each time you set another column on the business object, causing the view to resort or refilter the row.&lt;/P&gt;&lt;P&gt;&lt;FONT size=1&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Start from the back of the list and cycle through the rows to find the row index&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For lnCnt = Me.Count - 1 To 0 Step -1&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If _CurrentDataTable.DefaultView(lnCnt).Row Is loRow Then&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- We've found our row index&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lnRowIndex = lnCnt&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit For&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=1&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Set the row index to the index of the new row&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _CurrentRowIndex = lnRowIndex&lt;/FONT&gt;&lt;FONT size=1&gt;&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Tue, 05 Jun 2007 13:19:03 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: CurrentRowIndex</title><link>http://forum.strataframe.net/FindPost9325.aspx</link><description>Yup....if you recall, we actually touched on this briefly during class because I too have been there before.&amp;nbsp; When you add the new record the filter is immediately applied.</description><pubDate>Tue, 05 Jun 2007 13:17:05 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: CurrentRowIndex</title><link>http://forum.strataframe.net/FindPost9323.aspx</link><description>After a little more testing I found my original tests were incorrect and that a Filter causes the same&amp;nbsp;behavior as a Sort:blush:&amp;nbsp; I'm assuming that this is probably by design and you can't add rows to sorted or filtered BOs.&lt;P&gt;-Larry</description><pubDate>Tue, 05 Jun 2007 12:33:30 GMT</pubDate><dc:creator>Larry Caylor</dc:creator></item></channel></rss>