Hi,
When the page loads the WebDropDown is populated with a dataset which is then set to nothing.
When I select a value in the table in the dropdown I populate other textfields based on the values read from the selection in the table in the dropdown.
After that page is posted back, the values in the table in the webdropdown are no longer visible but when selected the values from the selected item do populate the textfields correctly.
It seems that the data is not visible but is there to select from.
Does anyone have any suggestions, I have pretty much exhausted my options?
Thanks!
And finally ... here is how the control is defined on the aspx page ...
<td align="left" valign="top" colspan="2"> <span class="value"> <label><asp:Literal id="ltlAddressBook" runat="server" />Address Book</label> </span> <ig:WebDropDown ID="wddRecipients" Width="100%" runat="server" EnableTheming="true" DropDownContainerWidth="375px" DropDownAnimationDuration="1000" AutoPostBack="true" OnSelectionChanged="wddRecipients_SelectionChanged" OnValueChanged="wddRecipients_ValueChanged" StyleSetName="Appletini" CurrentValue=""> </ig:WebDropDown> </td>
In addition to that I am calling the PopRecipients() Sub when it is not a postback. This calls a Business and then Data Layer FilesLogic.GetRecipients(these values don't matter here) and populates a dataset which in turn is used to set the datasource of the control.
Private Sub PopRecipients() ' Retrieve all the Recipients from the Recipients table and populate the Recipient dropdown. wddRecipients.Items.Clear() Dim dsRecipients As New DataSet dsRecipients = FilesLogic.GetRecipients(123, "vip21") If dsRecipients.Tables.Count > 0 Then If dsRecipients.Tables(0).Rows.Count > 0 Then wddRecipients.DataSource = dsRecipients.Tables(0).DefaultView wddRecipients.ValueField = "rowid" wddRecipients.TextField = "LastName" wddRecipients.DataBind() End If End If dsRecipients = Nothing End Sub
I am not using <Item Template> at this point and when I add the line of code wddRecipients.DataBind() at the very end of Page_Load just before the End Sub, I get the following error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
[NullReferenceException: Object reference not set to an instance of an object.] Veritext.VIP21.Web.SendNotices.RecipientChanged() +119 Veritext.VIP21.Web.SendNotices.wddRecipients_ValueChanged(Object sender, DropDownValueChangedEventArgs e) +70 Infragistics.Web.UI.ListControls.WebDropDown.OnValueChanged(DropDownValueChangedEventArgs e) +115 Infragistics.Web.UI.ListControls.DropDownBot.RaisePostDataChangedEvent() +2035 Infragistics.Web.UI.Framework.RunBot.HandleRaisePostDataChangedEvent() +213 Infragistics.Web.UI.Framework.Data.FlatDataBoundControl.RaisePostDataChangedEvent() +34 System.Web.UI.Page.RaiseChangedEvents() +165 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1485
Hi Jay,
Let Us know if you need further assistance.
Thanks
If you are using <ItemTemplate> you will have to rebind (call DataBind() on the control), after every postback. Data Items are not stored into ViewState , therefore your DataBinding expressions will not evaluate any data.
Thanks,
Angel