Combo Question


Author
Message
Michael Reese
Michael Reese
StrataFrame User (403 reputation)StrataFrame User (403 reputation)StrataFrame User (403 reputation)StrataFrame User (403 reputation)StrataFrame User (403 reputation)StrataFrame User (403 reputation)StrataFrame User (403 reputation)StrataFrame User (403 reputation)StrataFrame User (403 reputation)
Group: StrataFrame Users
Posts: 235, Visits: 1.6K
I have a combo and I am able to successfully fill it utilizing a datatable. I also have it attache to a BO and Column. The problem is that I am not able to populating the bo?

*********************

Private Sub PopulateReminderCombo()

Dim loTable As New DataTable()

Dim loRow As DataRow

'-- Create the table structure

loTable.Columns.Add("Display", GetType(String))

loTable.Columns.Add("DropDown", GetType(String))

loTable.Columns.Add("Value", GetType(TimeSpan))

'-- Add some rows

loRow = loTable.NewRow()

loRow.Item("Display") = "0 minutes"

loRow.Item("DropDown") = "0 minutes"

loRow.Item("Value") = (New TimeSpan(0, 5, 0))

loTable.Rows.Add(loRow)

loRow = loTable.NewRow()

loRow.Item("Display") = "5 minutes"

loRow.Item("DropDown") = "5 minutes"

loRow.Item("Value") = (New TimeSpan(0, 5, 0))

loTable.Rows.Add(loRow)

*******************************************

' Me.cboReminder.Items.Clear()

'-- Associate the table with the combos data source

cboReminder.DataSource = loTable

cboReminder.DisplayMember = "Display"

cboReminder.ValueMember = "Value"

 

 


Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
The problem is that I am not able to populating the bo?

Well, let's dig a little deeper...this is the ONLY way I generally ever populate a combo, so give me some more details or post a quick sample so we can see what you might be doing that is not working for you.  Also, there are quite a few samples throughout the different samples that does this, so you might want to look at these as well.

Michael Reese
Michael Reese
StrataFrame User (403 reputation)StrataFrame User (403 reputation)StrataFrame User (403 reputation)StrataFrame User (403 reputation)StrataFrame User (403 reputation)StrataFrame User (403 reputation)StrataFrame User (403 reputation)StrataFrame User (403 reputation)StrataFrame User (403 reputation)
Group: StrataFrame Users
Posts: 235, Visits: 1.6K
Sure,

In a nutshell, when  I update the form, the column value attached to the timespan combo is not being saved? I have a ton of combos enums, and others in the application which are fine. This one is just not getting the timespan value?

Michael

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
This one is just not getting the timespan value?

Gothca....so do you have the value member field in the BO coming back as a time span?  You might consider creating a custom property on the BO from which you are populating which returns a TimeSpan value like you are doing in your manual sample, this way you are ensured that it is typed as a TimeSpan.

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