maintenance toolstrip browse button and ShowDialog(true)


Author
Message
Marcel Heitlager
Marcel Heitlager
StrataFrame User (276 reputation)StrataFrame User (276 reputation)StrataFrame User (276 reputation)StrataFrame User (276 reputation)StrataFrame User (276 reputation)StrataFrame User (276 reputation)StrataFrame User (276 reputation)StrataFrame User (276 reputation)StrataFrame User (276 reputation)
Group: StrataFrame Users
Posts: 84, Visits: 835
I like to have the result prefilled.  When I call showdialog(true) in the ItemClicked event I naturally get a 2nd instance of the BrowseDialog. How do I override the default PopulateOnShow Property?

Also (side question), has anyone tried to paginate the browse dialog results, if there more results you care to show on one page?

Thanks,

Marcel

Reply
Marcel Heitlager
Marcel Heitlager
StrataFrame User (276 reputation)StrataFrame User (276 reputation)StrataFrame User (276 reputation)StrataFrame User (276 reputation)StrataFrame User (276 reputation)StrataFrame User (276 reputation)StrataFrame User (276 reputation)StrataFrame User (276 reputation)StrataFrame User (276 reputation)
Group: StrataFrame Users
Posts: 84, Visits: 835
Thanks for the reply.

I don't see how I can override the PopulateOnShow property since it is set in the ShowDialog() method to False (and that's called from the toolbar(i think).

I tried to inherit from the BrowseDialogClass with the following code overriding showdialog (since it is overridable)

[codesnipper]

Namespace UI.Windows.Forms

<DefaultEvent("RowPopulating")> _

Public Class PrefilledBrowseDialog

Inherits MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialog

''' <summary>

''' Override the ShowDialog function of browseDialog class

'''

''' </summary>

''' <remarks></remarks>

Public Overrides Function ShowDialog(ByVal PopulateOnShow As Boolean) As System.Windows.Forms.DialogResult 

'''-- above is line 19

Return MyBase.ShowDialog(True, Nothing)

End Function

End Class

End Namespace

[/codesnippet]

This keeps on throwing an exception though:

System.ArgumentOutOfRangeException was unhandled by user code
  Message="Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index"
  ParamName="index"
  Source="mscorlib"
  StackTrace:
       at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
       at System.ThrowHelper.ThrowArgumentOutOfRangeException()
       at System.Collections.Generic.List`1.get_Item(Int32 index)
       at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogwindow.SetGroupBoxDimensions()
       at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogwindow..ctor(BrowseDialog BrowseDialogSettings, Boolean PopulateOnShow)
       at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialog.ShowDialog(Boolean PopulateOnShow, IWin32Window ResultsWindowOwner)
       at mhControlLibrary.UI.Windows.Forms.PrefilledBrowseDialog.ShowDialog(Boolean PopulateOnShow) in D:\_VS2005Projects\SHARED\mhControlLibrary\mhControlLibrary\PrefilledBrowseDialog.vb:line 19 +++++Which is overrides line above +++++
       at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialog.ShowDialog()
       at PPM_New.it.llblManagePlans_LinkClicked(Object sender, LinkLabelLinkClickedEventArgs e) in D:\_VS2005Projects\DEV\PPM_New\PPM_New\forms\it.vb:line 77
       at System.Windows.Forms.LinkLabel.OnLinkClicked(LinkLabelLinkClickedEventArgs e)
       at System.Windows.Forms.LinkLabel.OnMouseUp(MouseEventArgs e)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.Label.WndProc(Message& m)
       at System.Windows.Forms.LinkLabel.WndProc(Message& msg)
       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)
 

Crazy I'm probably missing something obvious here. Any thoughts?

Marcel

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search