ListView Requery Failing
 
Home My Account Forum Try It! Buy It!
About Contact Us Site Map
StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



ListView Requery FailingExpand / Collapse
Author
Message
Posted 02/12/2008 5:36:23 PM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 2 days ago @ 6:32:47 PM
Posts: 349, Visits: 1,205
I am trying to setup another listview with a bunch of open orders for a specified customer.  Sounds simple.  The listview utilized a Fill method that takes the custindex.  If the current BO has data (including a custindex number) then I call the requery method of the listview.  Here is the error on the ListView.Requery(custindex):

FormatException
  Index (zero based) must be greater than or equal to zero and less than the size of the argument list.

Source     : mscorlib

Stack Trace:
   at System.Text.StringBuilder.AppendFormat(IFormatProvider provider, String format, Object[] args)
   at System.String.Format(IFormatProvider provider, String format, Object[] args)
   at MicroFour.StrataFrame.UI.Windows.Forms.ListView.CreateListViewItem(BusinessLayer BusinessObject)
   at MicroFour.StrataFrame.UI.Windows.Forms.ListView.PopulateListView(Object[] Parameters)
   at MicroFour.StrataFrame.UI.Windows.Forms.ListView.Requery(Object[] Parameters)
   at Aspire.Accounting.CreditApproval.mSalesOrderUnderReviewBO_Navigated(NavigatedEventArgs e) in C:\Aspire Projects\AspireSF\Aspire.Accounting\CreditApproval.cs:line 41
   at MicroFour.StrataFrame.Business.BusinessLayer.NavigatedEventHandler.Invoke(NavigatedEventArgs e)
   at MicroFour.StrataFrame.Business.BusinessLayer.raise_Navigated(NavigatedEventArgs e)
   at MicroFour.StrataFrame.Business.BusinessLayer.OnNavigated(NavigatedEventArgs e)
   at MicroFour.StrataFrame.Business.BusinessLayer.Navigate(BusinessNavigationDirection Direction, Int32 AbsoluteIndex, Object[] PrimaryKeyValues, Boolean AttemptToCheckRules, Boolean IsRefill)
   at MicroFour.StrataFrame.Business.BusinessLayer.OnCurrentDataTableRefilled()
   at MicroFour.StrataFrame.Business.BusinessLayer.ChangeCurrentDataTable(DataTable NewTable, Boolean AcceptChanges, Boolean IsSharedTable)
   at MicroFour.StrataFrame.Business.BusinessLayer.FillOrGetByPrimaryKey(Object[] PrimaryKeyValues, Boolean ReplaceCurrentDataTable)
   at MicroFour.StrataFrame.Business.BusinessLayer.FillByPrimaryKey(Int32 PrimaryKeyValue)
   at Aspire.Accounting.CreditApproval.NewOrderListView_DoubleClick(Object sender, EventArgs e) in C:\Aspire Projects\AspireSF\Aspire.Accounting\CreditApproval.cs:line 54
   at System.Windows.Forms.Control.OnDoubleClick(EventArgs e)
   at System.Windows.Forms.ListView.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativewindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativewindow.WndProc(Message& m)
   at System.Windows.Forms.Nativewindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


Where do I start looking to solve this one?

Thanks,
Bill

Post #14334
Posted 02/12/2008 7:09:50 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 11:54:01 AM
Posts: 4,104, Visits: 4,177
In line 41 of CreditApproval.cs you are calling a Requery and passing the parms. The first recommendation that I have is to use the ListPopulating event of the ListView instead of passing the parms in the Requery method so if you end up needing to requery from another location in code later you do not have to supply the parms....but this is not what is causing the probem.

The error is occuring when trying to create a list item.  This is a FormatException which means that it is more than likely coming from one of your properties that displays within the list.  Especially if you have a custom property.

The first thing I would do is make sure that I have a record in my BO and that all of the fields that are shown in the results of the list are valid (i.e. manually try to access each of the properties).  You can put a breakpoint in the Get of each of the properties that are used so you can see what is being return.  Finally, I am guessing that you may have typed in something wrong in the format of the column (i.e. the area where enter the display format {0}, {1}, etc).  You may have entered an illegal value not supported by the String.Format command.

Post #14335
Posted 02/13/2008 1:37:25 PM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 2 days ago @ 6:32:47 PM
Posts: 349, Visits: 1,205
Thanks, Trent,

That was the problem...one of the columns was not getting fed the proper data. 

Have a good day!
Bill

Post #14364
Posted 02/13/2008 1:41:37 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 11:54:01 AM
Posts: 4,104, Visits: 4,177
Glad you found your problem
Post #14368
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 7:54pm

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.109. 8 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.