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!
You can see an example on how to attach to the RowUpdating event in this sample. Note that you will need the Activation behavior enabled, so that the RowUpdating event is fired when clicking on another cell after editing. Otherwise, you will need to manually trigger a postback to the server, which postback will fire the RowUpdating. This manual trigger can be a Save button.
In the end, if this does not help you, please provide a working example demonstrating the issue that you have, so that I can investigate it and suggest accordingly.
Hello, I tried the rowupdating event but nothing is fired.
In the rowEditor Template, the 4 dropdowns that I am trying to update are not binded to any column of the grid.
Here is a simple schema of the tables:
Table Declaration (Id_declaration, ID_CA, ValueA, ValueB, ValueC, ValueD)
Table CA (id_CA, descriptionValueA, DescriptionValueB, DescriptionValueC, DescriptionValueD)
The WebDataGrid shows the table Description. In the row editing template, after choosing the good (ID_CA) from a dropdown, I need, in the row editor template itself, to display the 4 value descriptions from the table CA, according to the ID_CA selected.
Thank you
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.