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

[Solved] ComboBox in DataGrid value changes before I can access the value

1 Answer 122 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Steve Napurano
Top achievements
Rank 1
Steve Napurano asked on 14 Nov 2009, 07:05 AM
Hi. I am trying to access the value in a combobox. When the user clicks a LinkButton in the grid, I fire a command. Before the breakpoint i reached, I see the combobox resort back to the SelectedIndex of 0. Therefore, when the breakpoint is hit, the value is not the value selected by the user...

I tried both below, the grid is reloading PRIOR to me having a chance to retrieve the value and the combo value is already reset

Dim

 

dataItem As GridDataItem

 

dataItem =

DirectCast(e.Item, GridDataItem)

 

 

Dim ddl As Telerik.Web.UI.RadComboBox

 

ddl =

DirectCast(dataItem.FindControl("ddlTest"), Telerik.Web.UI.RadComboBox)

 

 

Dim qty As String = ddl.SelectedItem.Text

 

 

Dim qty2 As String = ddl.Text

 

 

Dim ddlQty As DropDownList

 

ddlQty =

DirectCast(dataItem.FindControl("ddlQuantity"), DropDownList)

 

 

Dim value As String = ddlQty.SelectedItem.Text

 

 

Dim value2 As String = ddlQty.Text

 

1 Answer, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 17 Nov 2009, 04:47 PM
Hello Steve Napurano,

Generally this should not be happening unless you are explicitly re-binding the Grid or the ComboBox. Otherwise the SelectedValue should remain the same.

Please open a support ticket and send us your project there - we will inspect it and will fix it for you or provide a workaround if there is a bug in some of the controls.

Regards,
Simon
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
ComboBox
Asked by
Steve Napurano
Top achievements
Rank 1
Answers by
Simon
Telerik team
Share this question
or