Oct 23, 2012, 2:19 PM
[CLOSED] Setting Store Datasource - MVC
I have a controller which is using the controller extensions and as such, I am using the GetCmp method for a store. After that I am trying to set the store's datasource from a list of a model:
The controller goes through a lot of rules to get the correct information, but in the end, it just provides string values to the email object. I have inspected the email object, and it is functioning as expected. I have inspected the Me.GetCmp(Of Store)("storeEmail") code and it is getting the correct component. However, after I set the DataSource property and inspect it, the value is "null" -even though I have one item in my list. The result is that nothing is being bound to my store. Is there anything obvious here I am missing on setting the datasource of a store?
Thanks in advance.
Dim emailData As New List(Of Email)
emailData.Add(New Email() With {.Subject = "Test Email", _
.Sender = sample.CorrespondentInfo.EmailAddress, _
.CarbonCopy = Me.MakeRecipient(sample.BrokerInfo), _
.Body = Me.MakeBody(sample), _
.Recipient = Me.MakeRecipient(sample.Documents(0).Cedent) _
+ Me.MakeRecipient(sample.Documents(0).Reinsurers)})
Me.GetCmp(Of Store)("storeEmail").DataSource = emailData
Me.GetCmp(Of Store)("storeEmail").DataBind()
The controller goes through a lot of rules to get the correct information, but in the end, it just provides string values to the email object. I have inspected the email object, and it is functioning as expected. I have inspected the Me.GetCmp(Of Store)("storeEmail") code and it is getting the correct component. However, after I set the DataSource property and inspect it, the value is "null" -even though I have one item in my list. The result is that nothing is being bound to my store. Is there anything obvious here I am missing on setting the datasource of a store?
Thanks in advance.
Last edited by Daniil; Oct 26, 2012 at 5:55 PM.
Reason: [CLOSED]