ASPxGridView GetSelectedFieldValues不检索值 [英] ASPxGridView GetSelectedFieldValues not retrieving values

查看:134
本文介绍了ASPxGridView GetSelectedFieldValues不检索值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!



我正在尝试从ASPxGridView控件中获取唯一一个选定值(单选按钮),并按照DevExpress上的文档中的步骤操作。



我唯一想要的是通过button_click检索一个字段并显示到标签中



这里是代码...



 受保护  Sub  ASPxButton1_Click(发件人作为 对象,e  As  EventArgs)句柄 ASPxButton1.Click 
Dim oRowVal 作为列表( 对象
Dim oVal 作为 对象
oRowVal = ASPxGridView1.GetSelectedFieldValues({ No _})
oVal = oRowVal( 0
Label1.Text = oVal.ToString
结束 Sub





这是控件的ASP代码...

 <   asp:Label     ID   =  Label1     runat   = < span class =code-keyword> server   文本  = 标签 >  <   / asp:标签 >  
< br / >
< dx:ASPxButton ID = ASPxButton1 runat = 服务器 AutoPostBack = False 文字 = ASPxButton 主题 = BlackGlass 宽度 = 150px >
< / dx:ASPxButton >
< dx:ASPxGridView ID = ASPxGridView1 runat = server AutoGenerateColumns = 错误 DataSourceID = SqlDataSource1 EnableTheming = True 主题 = BlackGlass >
< >
< < span class =code-leadattribute> dx:GridViewCommandColumn
ShowSelectCheckbox = True VisibleIndex = 0 >
< ClearFilterButton 可见 = True >
< / ClearFilterButton >
< / dx:GridViewCommandColumn > ;
< dx:GridViewDataTextColumn 标题 = GP FieldName = No_ VisibleIndex = 1 >
< / dx:GridViewDataTextColumn >
< dx:GridViewDataTextColumn Caption = 描述 FieldName = DescripciónGrupo VisibleIndex = 2 >
< / dx:GridViewDataTextColumn >
< / Columns >
< SettingsBehavior AllowSelectSingleRowOnly = <跨度class =code-attribute> / >
< 设置 ShowFilterRow = True ShowGroupPanel = True / >
< span class =code-keyword>< / dx:ASPxGridView >





非常感谢提前!!!

解决方案

 Dim fieldNames As  String ()= New 字符串(){ < column name =  > 列名>} 
Dim columnValues As Object = grdMemberslist.GetRowValues(grdMemberslist.FocusedRowIndex,fieldNames)< / >











将FocusIndex属性设为true。


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...

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: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!!!

解决方案

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.


这篇关于ASPxGridView GetSelectedFieldValues不检索值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆