﻿<?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?)  » Listview</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 07:02:00 GMT</lastBuildDate><ttl>20</ttl><item><title>Listview</title><link>http://forum.strataframe.net/FindPost18749.aspx</link><description>I have two TabControl. &lt;/P&gt;&lt;P&gt;In second tabControl have a listview&lt;/P&gt;&lt;P&gt;In first tabControl have a textbox where will&amp;nbsp;to be&amp;nbsp;a code for populate listview, how i do for listview populate&amp;nbsp;whith :&lt;/P&gt;&lt;P&gt;Select * from tabpedidocompraitem where&amp;nbsp;code = (&amp;nbsp;is here a value of textbox&amp;nbsp;)</description><pubDate>Wed, 27 Aug 2008 10:26:48 GMT</pubDate><dc:creator>Rafael</dc:creator></item><item><title>RE: Listview</title><link>http://forum.strataframe.net/FindPost18798.aspx</link><description>If your "Method to Execute" on the ListView is set to the BO fill method as I outlined above (FillByTextBoxValue(&lt;FONT color=#0000ff size=2&gt;string&lt;/FONT&gt;&lt;FONT size=2&gt; pTextBoxValue)&lt;/FONT&gt;), then all you need in the ListPopulating event is the following:&lt;/P&gt;&lt;P&gt;[codesnippet]&lt;BR&gt;private void lvPedidoCompraItem_ListPopulating(ListPopulatingEventArgs e)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; e.Parameters[0].Value = for_cod.Text;&lt;BR&gt;}&lt;BR&gt;[/codesnippet]&lt;/P&gt;&lt;P&gt;On the leave focus event of the textbox (or whereever you need it), all you have to do is:&lt;/P&gt;&lt;P&gt;[codesnippet]&lt;BR&gt;lvPedidoCompraItem.Requery();&lt;BR&gt;[/codesnippet]</description><pubDate>Wed, 27 Aug 2008 10:26:48 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Listview</title><link>http://forum.strataframe.net/FindPost18772.aspx</link><description>[quote][b]Rafael (08/26/2008)[/b][hr]The error is first post this topic :)&lt;P&gt;&lt;A href="http://forum.strataframe.net/Topic18700-6-1.aspx[/quote"&gt;http://forum.strataframe.net/Topic18700-6-1.aspx[/quote&lt;/A&gt;]&lt;P&gt;Rafael, you could not be getting the same error:[quote]BusinessLayerException&lt;BR&gt;&lt;BR&gt;&amp;nbsp; The ParentBusinessObject property must be set before FillByParent can be called with no parameters supplied.[/quote]&lt;P&gt;since the method to populate the BO could not be FillByParent. Can you post an screenshot of the List View Population Settings, I would like to see what you have in the Method to Execute.&amp;nbsp;&lt;P&gt;Here is an example of what I use in one of my forms:&lt;P&gt;&lt;IMG src="http://forum.strataframe.net/Uploads/Images/a8a51632-e39e-4e43-b017-3e98.png"&gt;&lt;P&gt;In this case I use the CopyDataFrom(BusinesLayerBase,BusinessCloneDataType) because I have an instance of the bizBuildings BO in the form and I simply update that BO instance and the listview will copy all records to the ListView internal BO.&amp;nbsp; I find this method easier to maintain.&lt;P&gt;P.S&lt;P&gt;I'll be online for a couple of hours in case you want to pursue with this issue.</description><pubDate>Tue, 26 Aug 2008 16:54:54 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Listview</title><link>http://forum.strataframe.net/FindPost18771.aspx</link><description>The error is first post this topic :)&lt;/P&gt;&lt;P&gt;&lt;A href="http://forum.strataframe.net/Topic18700-6-1.aspx"&gt;http://forum.strataframe.net/Topic18700-6-1.aspx&lt;/A&gt;</description><pubDate>Tue, 26 Aug 2008 16:43:42 GMT</pubDate><dc:creator>Rafael</dc:creator></item><item><title>RE: Listview</title><link>http://forum.strataframe.net/FindPost18770.aspx</link><description>Ok, even though I use VB your code looks good, all you have to do now is just requery the ListView control in one of the places mentioned by Bill, in the Textbox control or in the Page's Activate.&lt;/P&gt;&lt;P&gt;Are you getting any specific error? or just the listview is not being populated?</description><pubDate>Tue, 26 Aug 2008 16:37:18 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Listview</title><link>http://forum.strataframe.net/FindPost18769.aspx</link><description>no</description><pubDate>Tue, 26 Aug 2008 16:32:28 GMT</pubDate><dc:creator>Rafael</dc:creator></item><item><title>RE: Listview</title><link>http://forum.strataframe.net/FindPost18768.aspx</link><description>So it is now working for you?</description><pubDate>Tue, 26 Aug 2008 16:31:40 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Listview</title><link>http://forum.strataframe.net/FindPost18765.aspx</link><description>For population in Load Form, i configured populationDataSourceSetings and implemnt this code:&lt;/P&gt;&lt;P&gt;[code]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void lvPedidoCompraItem_ListPopulating(ListPopulatingEventArgs e)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&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; e.Parameters[0].Value = this.sysPedidoCompraItemBO1;&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; e.Parameters[1].Value = MicroFour.StrataFrame.Business.BusinessCloneDataType.ClearAndFillFromDefaultView;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void lvPedidoCompraItem_RowPopulating(RowPopulatingEventArgs e)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&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; //-- Establish Locals&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; sysPedidoCompraItemBO loBO = ((sysPedidoCompraItemBO)e.BusinessObject);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //-- Set the not count&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; //e.Values[1].DisplayValue = CustomerNotes.GetNoteCount(loBO.cust_pk).ToString("n0");&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }[/code]&lt;/P&gt;&lt;P&gt;But i use&amp;nbsp;&amp;nbsp;&amp;nbsp;[code]e.Parameters[0].Value = for_cod.Text;[/code] and delete [code]sysPedidoCompraItemBO loBO = ((sysPedidoCompraItemBO)e.BusinessObject);[/code], when initialize form with error.&lt;BR&gt;</description><pubDate>Tue, 26 Aug 2008 15:43:53 GMT</pubDate><dc:creator>Rafael</dc:creator></item><item><title>RE: Listview</title><link>http://forum.strataframe.net/FindPost18763.aspx</link><description>[quote]What is a bether method to used populate of listview ?&lt;P&gt;Please say me a method that used in populate listview&amp;nbsp;and i search in documentation.[/quote]&lt;/P&gt;&lt;P&gt;You could pass the parameter in the &lt;STRONG&gt;Requery method&lt;/STRONG&gt; of the ListView:&lt;P&gt;MyListView.Requery(myCoolParameter);&lt;P&gt;But, as I found out over time, it is better to pass the parameter in the &lt;STRONG&gt;ListPopulating event&lt;/STRONG&gt; of the ListView (from docs using VB):&lt;P&gt;[codesnippet]&lt;BR&gt;Private Sub ListView1_ListPopulating(ByVal e As MicroFour.StrataFrame.UI.ListPopulatingEventArgs) Handles ListView1.ListPopulating&lt;BR&gt;&amp;nbsp; &amp;nbsp; '-- Pass the search text to the FillByLastName() method&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; e.Parameters(0).Value = Me.txtSearch.Text&lt;BR&gt;End Sub&lt;BR&gt;[/codesnippet]&lt;P&gt;Then, whenever you need to refresh the ListView control, it is a simple call to its Requery method:&lt;P&gt;MyListView.Requery();&lt;P&gt;No need to remember to pass a parameter since it is handled in the event.&amp;nbsp; Good stuff.&amp;nbsp; A "set it and forget it" type of approach.</description><pubDate>Tue, 26 Aug 2008 13:33:27 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Listview</title><link>http://forum.strataframe.net/FindPost18761.aspx</link><description>[quote]You do...scroll down and open the last 10 posts in descending order section.[/quote]&lt;/P&gt;&lt;P&gt;Whoa. :blink:&lt;/P&gt;&lt;P&gt;Thanks! :w00t:</description><pubDate>Tue, 26 Aug 2008 13:26:09 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Listview</title><link>http://forum.strataframe.net/FindPost18760.aspx</link><description>[quote]You do...scroll down and open the last 10 posts in descending order section.[/quote]&lt;br&gt;
&lt;br&gt;
Wow, never noticed that!  That's cool!  :w00t: &lt;br&gt;
&lt;br&gt;
Thanks for asking Bill...I've often done the quoting thing myself.  The last 10 posts is much better.  I also noticed that you can also open the complete topic in a new &amp;#119;indow...even better for those lonnnnng posts.</description><pubDate>Tue, 26 Aug 2008 13:22:12 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Listview</title><link>http://forum.strataframe.net/FindPost18759.aspx</link><description>Rafael,&lt;br&gt;
&lt;br&gt;
Not sure what your asking, if anything.  Do you still have a question?</description><pubDate>Tue, 26 Aug 2008 13:19:13 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Listview</title><link>http://forum.strataframe.net/FindPost18757.aspx</link><description>I understand and very very thanks.&lt;/P&gt;&lt;P&gt;I&amp;nbsp;will do in event Leave of textbox, but i have a question.&lt;/P&gt;&lt;P&gt;What is a bether method to used populate of listview ?&lt;/P&gt;&lt;P&gt;Please say me a method that used in populate listview&amp;nbsp;and i search in documentation.&lt;/P&gt;&lt;P&gt;If&amp;nbsp;i have&amp;nbsp;doubt, question in the forum.</description><pubDate>Tue, 26 Aug 2008 13:13:17 GMT</pubDate><dc:creator>Rafael</dc:creator></item><item><title>RE: Listview</title><link>http://forum.strataframe.net/FindPost18756.aspx</link><description>[quote](note to forum admins: it would be nice to have a view of the post to which&amp;nbsp;we are replying...thanks!)[/quote]&lt;/P&gt;&lt;P&gt;You do...scroll down and open the last 10 posts in descending order section.</description><pubDate>Tue, 26 Aug 2008 13:12:09 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Listview</title><link>http://forum.strataframe.net/FindPost18755.aspx</link><description>The other part of the picture is to setup the listview appropriately.  This would be a two parter...&lt;br&gt;
&lt;br&gt;
1. Obviously you'd set the ListView to use the custom method that Bill mentioned and you'd handle the ListPopulating event of the listview to get the value from the textbox.&lt;br&gt;
&lt;br&gt;
2. You'd then need to set the listview to load manually (rather than on form load), by setting the PopulateOnFormLoad property to Manual.  Of course then you need to manually fill it. To do this you'd call .Requery() as appropriate. Likely in either the TextBox.Leave event or perhaps when the tab page is activated.&lt;br&gt;
&lt;br&gt;
Hope that helps! :D</description><pubDate>Tue, 26 Aug 2008 12:53:46 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Listview</title><link>http://forum.strataframe.net/FindPost18754.aspx</link><description>:blush:&amp;nbsp; Sorry...didn't mean to quote your whole post...I was using that as a guide and forgot to delete it before I posted.&lt;/P&gt;&lt;P&gt;Bill&lt;/P&gt;&lt;P&gt;(note to forum admins: it would be nice to have a view of the post to which&amp;nbsp;we are replying...thanks!)</description><pubDate>Tue, 26 Aug 2008 12:46:55 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Listview</title><link>http://forum.strataframe.net/FindPost18751.aspx</link><description>[quote][b]Rafael (08/26/2008)[/b][hr]I have two TabControl. &lt;P&gt;In second tabControl have a listview&lt;/P&gt;&lt;P&gt;In first tabControl have a textbox where will&amp;nbsp;to be&amp;nbsp;a code for populate listview, how i do for listview populate&amp;nbsp;whith :&lt;/P&gt;&lt;P&gt;Select * from tabpedidocompraitem where&amp;nbsp;code = (&amp;nbsp;is here a value of textbox&amp;nbsp;)[/quote]&lt;P&gt;You would use a custom fill method in the tabpedidocompraitem business object.&amp;nbsp; Like this:&lt;P&gt;[codesnippet]&lt;BR&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;FONT size=2&gt; FillByTextBoxValue(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;string&lt;/FONT&gt;&lt;FONT size=2&gt; pTextBoxValue)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;SqlCommand&lt;/FONT&gt;&lt;FONT size=2&gt; cmd = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;SqlCommand&lt;/FONT&gt;&lt;FONT size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"SELECT * FROM tabpedidocompraitem WHERE code = @textboxvalue"&lt;/FONT&gt;&lt;FONT size=2&gt;);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cmd.CommandType = &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;CommandType&lt;/FONT&gt;&lt;FONT size=2&gt;.Text;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cmd.Parameters.AddWithValue(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"@textboxvalue"&lt;/FONT&gt;&lt;FONT size=2&gt;, pTextBoxValue).SqlDbType = &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;SqlDbType&lt;/FONT&gt;&lt;FONT size=2&gt;.VarChar;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FillDataTable(cmd);&lt;BR&gt;}&lt;BR&gt;&lt;/FONT&gt;[/codesnippet]&lt;P&gt;Follow the SF documentation under "ListView Population".&amp;nbsp; Marvelous step-by-step to help you with the whole setup.&lt;P&gt;Hope that helps,&lt;BR&gt;Bill</description><pubDate>Tue, 26 Aug 2008 12:43:25 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item></channel></rss>