Click here to Skip to main content
15,903,201 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi all!

I'm trying to get the only one selected value (radio button) from an ASPxGridView control and followed the steps from the documentation on DevExpress.

The only thing I want is to retrieve one field and display into a label via button_click

Here goes the code...

VB
Protected Sub ASPxButton1_Click(sender As Object, e As EventArgs) Handles ASPxButton1.Click
        Dim oRowVal As List(Of Object)
        Dim oVal As Object
        oRowVal = ASPxGridView1.GetSelectedFieldValues({"No_"})
        oVal = oRowVal(0)
        Label1.Text = oVal.ToString
    End Sub


And this is the ASP code for the controls...
ASP.NET
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
    <br />
    <dx:ASPxButton ID="ASPxButton1"  runat="server" AutoPostBack="False" Text="ASPxButton" Theme="BlackGlass" Width="150px">
    </dx:ASPxButton>
    <dx:ASPxGridView ID="ASPxGridView1"  runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" EnableTheming="True" Theme="BlackGlass">
        <Columns>
            <dx:GridViewCommandColumn ShowSelectCheckbox="True" VisibleIndex="0">
                <ClearFilterButton Visible="True">
                </ClearFilterButton>
            </dx:GridViewCommandColumn>
            <dx:GridViewDataTextColumn Caption="GP" FieldName="No_" VisibleIndex="1">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn Caption="Description" FieldName="Descripción Grupo" VisibleIndex="2">
            </dx:GridViewDataTextColumn>
        </Columns>
        <SettingsBehavior AllowSelectSingleRowOnly="True" />
        <Settings ShowFilterRow="True" ShowGroupPanel="True" />
    </dx:ASPxGridView>


Many thanks in advance!!!
Posted

1 solution

C#
Dim fieldNames As String() = New String() {"<column name="">", "Column name>"}
               Dim columnValues As Object = grdMemberslist.GetRowValues(grdMemberslist.FocusedRowIndex, fieldNames)</column>





Put FocusIndex property true in HTML.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900