ListView Problems


Author
Message
Marcia G Akins
Marcia G Akins
Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
After filling the BO, call the listview.requery() and that should do it.

I changed the PopulateOnFormLoad property to Manual and added your code and still no joy. If I could just step through the framework code I know I would be able to figure this out w00t

Marcia G Akins
Marcia G Akins
Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Hi Charles

If you are sure the BO has a record in it, you probably are not handling the listpopulating event of the listview - or not requerying it after filling the BO (this was a hard one for me to wrap my brain around)

I set the ListView's PopulateOnLoad property to FormLoad. The documentation says that this automagically populates the list when the form loads. I have another ListView used in a different project set up exacrly the same way and it works fine. Just for grin and giggles, I tried substituting a ListBox - no joy - same behavior.

One of my problems is that ever since I upgraded to version 1.0.7.1, I can no longer step throught he framework source code, so I am having even bigger problems trying to figure out what is wrong. If I could get that problem resolved, I could probabaly figure this one out too Sad


Charles R Hankey
Charles R Hankey
StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)
Group: Forum Members
Posts: 524, Visits: 30K
If you are sure the BO has a record in it, you probably are not handling the listpopulating event of the listview - or not requerying it after filling the BO (this was a hard one for me to wrap my brain around)



Private Sub slvpdfs_ListPopulating(ByVal e As MicroFour.StrataFrame.UI.ListPopulatingEventArgs) Handles slvPDFs.ListPopulating

e.Parameters(0).Value = Me.StaticPDFsBO1

e.Parameters(1).Value = MicroFour.StrataFrame.Business.BusinessCloneDataType.ClearAndFillFromCompleteTable

End Sub




After filling the BO, call the listview.requery() and that should do it.

Marcia G Akins
Marcia G Akins
Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Hi All.

This should be dead simple - I have a BO called boAllPeople with a data access method called GetAllPeople():

public void GetAllPeople()

{

SqlCommand loCommand = new SqlCommand();

loCommand.CommandType = CommandType.StoredProcedure;

loCommand.CommandText = "prcListAllPeople";

this.FillDataTable(loCommand);

}

Here is the code in prcListAllPeople:

ALTER PROCEDURE [dbo].[prcListAllPeople]

AS

BEGIN TRY

DECLARE @RetVal INT

SET @RetVal = 1

SELECT first_nme, last_nme, contact_dtl, people_id

FROM dbo.vw_AllPeople

ORDER BY last_nme, First_nme

END TRY

BEGIN CATCH

/* Get the details of the error*/

EXEC prcLogError

SET @RetVal = -1

END CATCH

IF @RetVal < 0

BEGIN

DECLARE @ErrText VARCHAR(1000)

SET @ErrText = 'Unable to Retrieve People List'

RAISERROR( @ErrText, 16, 1 )

END

RETURN @RetVal

There are no records in my error_log table.

This is how my listview is configured

Columns collection has 3 columns: 1 for first name, last name and primary phone.

PopulationDataSource = boAllPeople.GetAllPeople()

Display fields are

{0} - last_nme

{1} - first_nme

{2} - contact_dtl

Tag is people_id

Columns are the same as what is in the columns collection and population type is formatted string.

PopulateOnFormLoad = FormLoad

I have verified that the view does have a record in it. However, when my form comes up, the list view contains the column headings in the first row where the single record in the view should be.

Can anyone tell me what I am doing wrong?

Thanks!

 


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