This is a migrated thread and some comments may be shown as answers.

Grid / User Control Edit Form not working with combo boxes

1 Answer 56 Views
Grid
This is a migrated thread and some comments may be shown as answers.
regina
Top achievements
Rank 1
regina asked on 06 Oct 2011, 05:36 PM

Hi I started with your

Grid / User Control Edit Form

http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/usercontroleditform/defaultvb.aspx

I have altered it with comboboxes for form values to add or alter, they show up fine. but when I hit insert or update, the values are not nothing.

from user control
combo
<telerik:RadComboBox ID="rcbclient" runat="server" DataMember="id" DataTextField="client_name"
                             AutoPostBack="true" AllowCustomText="true" Width="275px">
                        </telerik:RadComboBox>
  
databind
rcbclient.DataSource = getClients()
        rcbclient.DataBind()
  
from Default.vb
 Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem)
        Dim userControl As UserControl = CType(e.Item.FindControl(GridEditFormItem.EditFormUserControlID), UserControl)
  
        'Prepare new row to add it in the DataSource
        Dim newRow As DataRow = Me.Staging.NewRow
  
        'Insert new values
        Dim newValues As Hashtable = New Hashtable
        newValues("id") = CType(userControl.FindControl("rcbclient"), RadComboBox).SelectedItem.Value
        newValues("client_id") = CType(userControl.FindControl("rcbclient"), RadComboBox).DataMember
        newValues("client_name") = CType(userControl.FindControl("rcbclient"), RadComboBox).SelectedValue.ToString


thank you.

1 Answer, 1 is accepted

Sort by
0
regina
Top achievements
Rank 1
answered on 06 Oct 2011, 10:44 PM
I figured it out. 
Tags
Grid
Asked by
regina
Top achievements
Rank 1
Answers by
regina
Top achievements
Rank 1
Share this question
or