@@ -1727,7 +1727,11 @@ public int SelectedRowIndex
17271727 get { return this . TheActiveGrid . SelectedIndex ; }
17281728 set {
17291729 this . TheActiveGrid . SelectedIndex = value ;
1730- this . TheActiveGrid . ScrollIntoView ( this . TheActiveGrid . SelectedItem ) ;
1730+ var selected = this . TheActiveGrid . SelectedItem ;
1731+ if ( selected != null )
1732+ {
1733+ this . TheActiveGrid . ScrollIntoView ( selected ) ;
1734+ }
17311735 }
17321736 }
17331737
@@ -2017,20 +2021,23 @@ internal void ViewTransactionsForPayee(Payee p, long selectedRowId)
20172021 using ( PerformanceBlock . Create ( ComponentId . Money , CategoryId . View , MeasurementId . ViewTransactions ) )
20182022 {
20192023#endif
2020- // make sure it's real payee
2024+ string caption = "Payments" ;
20212025 p = this . myMoney . Payees . FindPayee ( p . Name , false ) ;
2026+ IList < Transaction > transactions = new List < Transaction > ( ) ;
20222027 if ( p != null )
20232028 {
2024- this . FireBeforeViewStateChanged ( ) ;
2025- this . fixedList = null ;
2026- this . lastQuery = null ;
2027- this . SwitchLayout ( "TheGrid_TransactionFromDetails" ) ;
2028- this . SetActiveAccount ( null , null , p , null , null ) ;
2029- IList < Transaction > transactions = this . myMoney . Transactions . GetTransactionsByPayee ( p , this . GetTransactionIncludePredicate ( ) ) ;
2030- var data = new TransactionCollection ( this . myMoney , null , transactions , true , false , this . QuickFilter ) ;
2031- this . Display ( data , TransactionViewName . ByPayee , "Payments to " + p . Name , selectedRowId ) ;
2032- this . FireAfterViewStateChanged ( selectedRowId ) ;
2029+ caption = "Payments to " + p . Name ;
2030+ transactions = this . myMoney . Transactions . GetTransactionsByPayee ( p , this . GetTransactionIncludePredicate ( ) ) ;
20332031 }
2032+ var data = new TransactionCollection ( this . myMoney , null , transactions , true , false , this . QuickFilter ) ;
2033+ this . FireBeforeViewStateChanged ( ) ;
2034+ this . fixedList = null ;
2035+ this . lastQuery = null ;
2036+ this . SwitchLayout ( "TheGrid_TransactionFromDetails" ) ;
2037+ this . SetActiveAccount ( null , null , p , null , null ) ;
2038+ this . Display ( data , TransactionViewName . ByPayee , caption , selectedRowId ) ;
2039+ this . FireAfterViewStateChanged ( selectedRowId ) ;
2040+
20342041#if PerformanceBlocks
20352042 }
20362043#endif
@@ -2042,13 +2049,10 @@ internal void ViewTransactionsForSecurity(Security s, long selectedRowId)
20422049 using ( PerformanceBlock . Create ( ComponentId . Money , CategoryId . View , MeasurementId . ViewTransactions ) )
20432050 {
20442051#endif
2052+ IList < Transaction > transactions = new List < Transaction > ( ) ;
20452053 if ( s != null )
20462054 {
2047- this . FireBeforeViewStateChanged ( ) ;
2048- this . fixedList = null ;
2049- this . lastQuery = null ;
2050- var transactions = this . RefreshViewBySecurity ( s , selectedRowId ) ;
2051- this . FireAfterViewStateChanged ( selectedRowId ) ;
2055+ transactions = this . RefreshViewBySecurity ( s , selectedRowId ) ;
20522056
20532057 // Async load of security info.
20542058 var mgr = ( StockQuoteManager ) this . site . GetService ( typeof ( StockQuoteManager ) ) ;
@@ -2062,6 +2066,11 @@ internal void ViewTransactionsForSecurity(Security s, long selectedRowId)
20622066 }
20632067 }
20642068 }
2069+
2070+ this . FireBeforeViewStateChanged ( ) ;
2071+ this . fixedList = null ;
2072+ this . lastQuery = null ;
2073+ this . FireAfterViewStateChanged ( selectedRowId ) ;
20652074#if PerformanceBlocks
20662075 }
20672076#endif
@@ -2174,18 +2183,21 @@ internal void ViewTransactionsForCategory(Category c, long selectedRowId)
21742183 using ( PerformanceBlock . Create ( ComponentId . Money , CategoryId . View , MeasurementId . ViewTransactions ) )
21752184 {
21762185#endif
2186+ string caption = "Transactions by Category" ;
2187+ IList < Transaction > transactions = new List < Transaction > ( ) ;
21772188 if ( c != null )
21782189 {
2179- this . FireBeforeViewStateChanged ( ) ;
2180- this . fixedList = null ;
2181- this . lastQuery = null ;
2182- this . SwitchLayout ( "TheGrid_TransactionFromDetails" ) ;
2183- this . SetActiveAccount ( null , c , null , null , null ) ;
2184- IList < Transaction > transactions = this . myMoney . Transactions . GetTransactionsByCategory ( c , this . GetTransactionIncludePredicate ( ) ) ;
2185- var data = new TransactionCollection ( this . myMoney , null , transactions , true , false , this . QuickFilter ) ;
2186- this . Display ( data , TransactionViewName . ByCategory , "Transactions by Category " + c . Name , selectedRowId ) ;
2187- this . FireAfterViewStateChanged ( selectedRowId ) ;
2190+ caption += " " + c . Name ;
2191+ transactions = this . myMoney . Transactions . GetTransactionsByCategory ( c , this . GetTransactionIncludePredicate ( ) ) ;
21882192 }
2193+ this . FireBeforeViewStateChanged ( ) ;
2194+ this . fixedList = null ;
2195+ this . lastQuery = null ;
2196+ this . SwitchLayout ( "TheGrid_TransactionFromDetails" ) ;
2197+ this . SetActiveAccount ( null , c , null , null , null ) ;
2198+ var data = new TransactionCollection ( this . myMoney , null , transactions , true , false , this . QuickFilter ) ;
2199+ this . Display ( data , TransactionViewName . ByCategory , caption , selectedRowId ) ;
2200+ this . FireAfterViewStateChanged ( selectedRowId ) ;
21892201#if PerformanceBlocks
21902202 }
21912203#endif
@@ -2197,17 +2209,20 @@ internal void ViewTransactionsForCategory(Category c, IEnumerable<Transaction> l
21972209 using ( PerformanceBlock . Create ( ComponentId . Money , CategoryId . View , MeasurementId . ViewTransactions ) )
21982210 {
21992211#endif
2212+ string caption = "Transactions by Category" ;
2213+ IList < Transaction > transactions = new List < Transaction > ( ) ;
22002214 if ( c != null )
22012215 {
2202- this . FireBeforeViewStateChanged ( ) ;
2203- this . fixedList = null ;
2204- this . lastQuery = null ;
2205- this . SwitchLayout ( "TheGrid_TransactionFromDetails" ) ;
2206- this . SetActiveAccount ( null , c , null , null , null ) ;
2207- var data = new TransactionCollection ( this . myMoney , null , list , true , false , this . QuickFilter ) ;
2208- this . Display ( data , TransactionViewName . ByCategoryCustom , "Transactions by Category " + c . Name , this . SelectedRowId ) ;
2209- this . FireAfterViewStateChanged ( this . SelectedRowId ) ;
2216+ caption += " " + c . Name ;
22102217 }
2218+ this . FireBeforeViewStateChanged ( ) ;
2219+ this . fixedList = null ;
2220+ this . lastQuery = null ;
2221+ this . SwitchLayout ( "TheGrid_TransactionFromDetails" ) ;
2222+ this . SetActiveAccount ( null , c , null , null , null ) ;
2223+ var data = new TransactionCollection ( this . myMoney , null , list , true , false , this . QuickFilter ) ;
2224+ this . Display ( data , TransactionViewName . ByCategoryCustom , caption , this . SelectedRowId ) ;
2225+ this . FireAfterViewStateChanged ( this . SelectedRowId ) ;
22112226
22122227#if PerformanceBlocks
22132228 }
@@ -2220,17 +2235,19 @@ internal void ViewTransactionsForPayee(Payee p, IEnumerable<Transaction> list)
22202235 using ( PerformanceBlock . Create ( ComponentId . Money , CategoryId . View , MeasurementId . ViewTransactions ) )
22212236 {
22222237#endif
2238+ string caption = "Transactions by Payee" ;
22232239 if ( p != null )
22242240 {
2225- this . FireBeforeViewStateChanged ( ) ;
2226- this . fixedList = null ;
2227- this . lastQuery = null ;
2228- this . SwitchLayout ( "TheGrid_TransactionFromDetails" ) ;
2229- this . SetActiveAccount ( null , null , p , null , null ) ;
2230- var data = new TransactionCollection ( this . myMoney , null , list , true , false , this . QuickFilter ) ;
2231- this . Display ( data , TransactionViewName . ByCategoryCustom , "Transactions by Payee " + p . Name , this . SelectedRowId ) ;
2232- this . FireAfterViewStateChanged ( this . SelectedRowId ) ;
2241+ caption += " " + p . Name ;
22332242 }
2243+ this . FireBeforeViewStateChanged ( ) ;
2244+ this . fixedList = null ;
2245+ this . lastQuery = null ;
2246+ this . SwitchLayout ( "TheGrid_TransactionFromDetails" ) ;
2247+ this . SetActiveAccount ( null , null , p , null , null ) ;
2248+ var data = new TransactionCollection ( this . myMoney , null , list , true , false , this . QuickFilter ) ;
2249+ this . Display ( data , TransactionViewName . ByCategoryCustom , caption , this . SelectedRowId ) ;
2250+ this . FireAfterViewStateChanged ( this . SelectedRowId ) ;
22342251
22352252#if PerformanceBlocks
22362253 }
0 commit comments