I have a radcombobox that is following the examples on how to create one that has multiple columns.
The first issue I am having is that when I select an item and it does an autopostback, the selected item is not sticking. It just goes back to the first item in the list. What magic dust do I need to sprinkle to make the selected item stick?
Secondly, in the selectedIndexChanged event handler I look at ddl.SelectedItem.value and it shows it as a string that is set to "DataRowView". I have tried all kinds of ways to cast it to a datarow view with no luck. Below is the aspx code.
Do I need to parse the selectedtext property by hand?
Any help would be really appreciated.
Thanks ... Ed
The first issue I am having is that when I select an item and it does an autopostback, the selected item is not sticking. It just goes back to the first item in the list. What magic dust do I need to sprinkle to make the selected item stick?
Secondly, in the selectedIndexChanged event handler I look at ddl.SelectedItem.value and it shows it as a string that is set to "DataRowView". I have tried all kinds of ways to cast it to a datarow view with no luck. Below is the aspx code.
Do I need to parse the selectedtext property by hand?
Any help would be really appreciated.
Thanks ... Ed
| <telerik:RadComboBox ID="ddlVoucher" runat="server" Skin="Vista" Width="420" |
| HighlightTemplatedItems="true" AutoPostBack="true" CausesValidation="false" > |
| <HeaderTemplate> |
| <table style="width: 415px; text-align: left"> |
| <tr> |
| <td style="width: 60px;">Voucher #</td> |
| <td style="width: 250px;">Vendor/Staff</td> |
| <td style="width: 80px;">Due Date</td> |
| <td style="width: 80px;">Invoice #</td> |
| <td style="display:none">VoucherId</td> |
| </tr> |
| </table> |
| </HeaderTemplate> |
| <ItemTemplate> |
| <table style="width: 415px; text-align: left"> |
| <tr> |
| <td style="width: 60px;"> |
| <%#DataBinder.Eval(Container.DataItem, "VoucherNumber")%> |
| </td> |
| <td style="width: 250px;"> |
| <%#DataBinder.Eval(Container.DataItem, "VendorOrStaff")%> |
| </td> |
| <td style="width: 80px;"> |
| <%#DataBinder.Eval(Container.DataItem, "DueDate")%> |
| </td> |
| <td style="width: 80px;"> |
| <%#DataBinder.Eval(Container.DataItem, "InvoiceNumber")%> |
| </td> |
| <td style="width: 0px;"> |
| <%#DataBinder.Eval(Container.DataItem, "PaymentVoucherId")%> |
| </td> |
| </tr> |
| </table> |
| </ItemTemplate> |
| </telerik:RadComboBox> |
| Protected Sub ddlVoucher_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadComboBoxItemEventArgs) Handles ddlVoucher.ItemDataBound |
| e.Item.Text = _ |
| (DirectCast(e.Item.DataItem, DataRowView))("VoucherNumber").ToString() & "; " & _ |
| (DirectCast(e.Item.DataItem, DataRowView))("VendorOrStaff").ToString() & "; " & _ |
| (DirectCast(e.Item.DataItem, DataRowView))("DueDate").ToString() & "; " & _ |
| (DirectCast(e.Item.DataItem, DataRowView))("InvoiceNumber").ToString() & "; " & _ |
| (DirectCast(e.Item.DataItem, DataRowView))("PaymentVoucherId").ToString() |
| 'e.Item.Text = _ |
| '(DirectCast(e.Item.DataItem, DataRowView))("VoucherNumber").ToString() & "; " & _ |
| '(DirectCast(e.Item.DataItem, DataRowView))("VendorOrStaff").ToString() |
| End Sub |