How to receive cell changed value in ASPxGridView with different cell types in a same column?

I have a VB.NET web project where I use DevExpress 20.1 version

I’m creating a grid which is empty in the first time and when a line is added grdVariablesFiltro_HtmlDataCellPrepared function is launched.

Depending of the type, the cell type od the columns VALOR and CONDICION are also changing.

<dx:ASPxGridView ID="grdVariablesFiltro" 
    ClientInstanceName="grdVariablesFiltro" Visible="true" 
    EnableCallBacks="true" SettingsResizing-ColumnResizeMode="Control" 
    KeyFieldName="ID_VARIABLE"  runat="server" EnableViewState="true" 
    OnHtmlDataCellPrepared="grdVariablesFiltro_HtmlDataCellPrepared">
    <Settings HorizontalScrollBarMode="Auto" 
              VerticalScrollBarMode="Auto" 
              VerticalScrollBarStyle="Standard" 
              ShowFilterBar="Visible" ShowFilterRow="true" 
              ShowFilterRowMenu="true" ShowHeaderFilterButton="true"/>
    <SettingsPager PageSize="10">
        <PageSizeItemSettings Visible="true" ShowAllItem="true" />
    </SettingsPager>

    <SettingsBehavior AllowSort="true" AllowDragDrop="true" 
                      AllowSelectByRowClick="true" AllowSelectSingleRowOnly="false" 
                      EnableCustomizationWindow="false" /> 

    <Columns>
        <dx:GridViewCommandColumn HeaderStyle-BackColor="White" ShowSelectCheckbox="true" SelectAllCheckboxMode="AllPages" HeaderStyle-HorizontalAlign="Center" Width="60"/>
        <dx:GridViewDataTextColumn FieldName="ID_VARIABLE" Width="10%" meta:resourcekey="colIdVariable" CellStyle-HorizontalAlign="Left"/>
        <dx:GridViewDataTextColumn FieldName="SECCION" Width="10%" meta:resourcekey="colSeccion" CellStyle-HorizontalAlign="Left"/>
        <dx:GridViewDataTextColumn FieldName="APARTADO"  Width="10%" meta:resourcekey="colApartado" CellStyle-HorizontalAlign="Left"/>
        <dx:GridViewDataTextColumn FieldName="DESC_VARIABLE" Width="10%" meta:resourcekey="colDescVariable" CellStyle-HorizontalAlign="Left"/>
        <dx:GridViewDataTextColumn FieldName="CLAVERO" Width="10%" meta:resourcekey="colClavero" CellStyle-HorizontalAlign="Left"/>
        <dx:GridViewDataTextColumn FieldName="CONDICION" Width="10%" meta:resourcekey="colCondicion" CellStyle-HorizontalAlign="Left"/>
        <dx:GridViewDataTextColumn FieldName="VALOR" Width="10%" meta:resourcekey="colValor" CellStyle-HorizontalAlign="Left" >
            <EditItemTemplate>
                <dx:ASPxTextBox ID="txtValor" runat="server" Width="100%" Text='<%# Bind("VALOR") %>'>
                </dx:ASPxTextBox>
            </EditItemTemplate>
        </dx:GridViewDataTextColumn>
    </Columns>
</dx:ASPxGridView>
Protected Sub grdVariablesFiltro_HtmlDataCellPrepared(sender As Object, e As ASPxGridViewTableDataCellEventArgs)
        If e.DataColumn.FieldName = "ID_VARIABLE" Then 'Obtenemos la variable al que le estamos asignando el tipo de celda
            If e IsNot Nothing Then
                If e.CellValue IsNot Nothing Then
                    variableAAnadir = e.CellValue.ToString()
                End If
            End If
        ElseIf e.DataColumn.FieldName = "VALOR" Or e.DataColumn.FieldName = "CONDICION" Then
            Dim tipoVariable As Integer = VariablesDAL.GetTipoUsuarioVariable(variableAAnadir)

            If e.DataColumn.FieldName = "VALOR" Then
                gestionarColumnaValor(e, tipoVariable)
            Else
                gestionarColumnaCondicion(e, tipoVariable) 'Segun el tipo de dato ponemos unas condiciones u otras
            End If
        End If
    End Sub

    'Gestiona la columna de valor segun el tipo
    Protected Sub gestionarColumnaValor(e As ASPxGridViewTableDataCellEventArgs, tipoVariable As Integer)
        If tipoVariable = 3 Then 'TEXTO
            Dim textBox As New ASPxTextBox()
            textBox.Text = e.CellValue.ToString()
            e.Cell.Controls.Add(textBox)
        ElseIf tipoVariable = 1 Or tipoVariable = 2 Then 'NUMERO
            Dim spinEdit As New ASPxSpinEdit()
            'spinEdit.Value = Convert.ToDecimal(e.CellValue)

            spinEdit.ReadOnly = False

            e.Cell.Controls.Add(spinEdit)
        ElseIf tipoVariable = 101 Then 'SI NO
            Dim comboBox As New ASPxComboBox()
            comboBox.Items.Add("SI")
            comboBox.Items.Add("NO")
            'comboBox.SelectedItem = comboBox.Items.FindByText(e.CellValue.ToString())
            e.Cell.Controls.Add(comboBox)
        Else 'TIPOS DE USUARIO
            Dim listaValores As List(Of String) = New List(Of String)()
            'Leemos la lista de tipos 
            listaValores = VariablesDAL.GetValoresTipoUsuario(tipoVariable)

            If listaValores.Count > 0 Then
                Dim comboBox As New ASPxComboBox()

                'Recorremos la lista para rellenar el combo
                For Each valor In listaValores
                    comboBox.Items.Add(valor)
                Next

                e.Cell.Controls.Add(comboBox)
            End If

        End If
    End Sub

    'Gestiona la columna de condicion segun el tipo.
    Protected Sub gestionarColumnaCondicion(e As ASPxGridViewTableDataCellEventArgs, tipoVariable As Integer)
        Dim comboBox As New ASPxComboBox()
        If tipoVariable = 1 Or tipoVariable = 2 Then 'NUMERICO
            comboBox.Items.Add("=")
            comboBox.Items.Add("!=")
            comboBox.Items.Add("<")
            comboBox.Items.Add(">")
            e.Cell.Controls.Add(comboBox)
        Else
            comboBox.Items.Add("=")
            comboBox.Items.Add("!=")
            e.Cell.Controls.Add(comboBox)
        End If

        comboBox.SelectedIndex = 0 ' Esto selecciona el primer elemento que es "="
        e.Cell.Controls.Add(comboBox)
    End Sub

Then when the user changes the value of some of the editing columns, I want to receive the changed value. Can be at the moment or also when pressing a button.

How I can achieve this?

I have tried using onrowupdating and some other event launchers but I can’t achieve to go to VB.

New contributor

Oier is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật