Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
45
RowEditorTemplate- WebDropdown valuechanged need to update other webdropdowns
posted

Hello, I have a webdatagrid with a RowEditorTemplate.

In the template, I have a WebDropDown wich will be selected by the user.

While editing, I need that the valuechanged of the WebDropdown fire an event wich will update 4 other objects (label or textfield or webdoropdown disabled, same type for all)  to update specific informations about the new value selected in the webdropDown. 

I tried to use 4 webdropdown (enable = false).

I thought that this would update by coding selectedvalue=e.NewSelection but there is not effect.

They could all be binded to the same table, same id.

The event is fired, while debugging I see the values has been changed, but the description fileds are not updated in the rowEditorTemplate.

Here is the code:

Protected Sub MAJSelect(sender As Object, e As Infragistics.Web.UI.ListControls.DropDownSelectionChangedEventArgs)
On Error Resume Next
Dim ControlA
Dim ControlB
Dim ControlC
Dim ControlD

Dim CAChoisi As Integer

CAChoisi = e.NewSelection

If CAChoisi <> 0 Then

ControlA = WebDataGrid1.Behaviors.EditingCore.Behaviors.RowEditTemplate.TemplateContainer.FindControl("WDD_UniteA")
ControlB = WebDataGrid1.Behaviors.EditingCore.Behaviors.RowEditTemplate.TemplateContainer.FindControl("WDD_UniteB")
ControlC = WebDataGrid1.Behaviors.EditingCore.Behaviors.RowEditTemplate.TemplateContainer.FindControl("WDD_UniteC")
ControlD = WebDataGrid1.Behaviors.EditingCore.Behaviors.RowEditTemplate.TemplateContainer.FindControl("WDD_UniteD")


ControlA.ClearSelection
ControlB.ClearSelection
ControlC.ClearSelection
ControlD.ClearSelection


ControlA.selectedvalue = e.NewSelection
ControlB.selectedvalue = e.NewSelection
ControlC.selectedvalue = e.NewSelection
ControlD.selectedvalue = e.NewSelection


End If
End Sub

Thanks for your help!

Parents
No Data
Reply
  • 16210
    Verified Answer
    Offline posted

    Hi,

    I see what you are trying to achieve here. I will have the chance to look at this and replicate the code later., though it looks ok.

    Meanwhile, I suggest that you try updating the cell value directly, instead of working with the editor. In this approach, it will be easier to find the corresponding row if you execute the code in the RowUpdating event, through the event args for the event.

    Please let me know if this helped you resolve your issue.

Children