码迷,mamicode.com
首页 > Web开发 > 详细

aspxgridview 实现单选

时间:2019-12-16 19:12:22      阅读:131      评论:0      收藏:0      [点我收藏+]

标签:nan   change   length   com   lead   sid   col   ade   als   

<dxwgv:ASPxGridView ID="ASPxGridView1" runat="server" 
            AutoGenerateColumns="False" DataSourceID="SqlDataSource1" 
            KeyFieldName="Customer_ID" ClientInstanceName="grid">
            <ClientSideEvents SelectionChanged="function(s, e) {OnGridSelectionChanged();}" />
            <Columns>
            <dxwgv:GridViewCommandColumn ShowSelectCheckbox="True" VisibleIndex="0"></dxwgv:GridViewCommandColumn>
                <dxwgv:GridViewDataTextColumn FieldName="Customer_ID" ReadOnly="True" 
                    VisibleIndex="1">
                    <EditFormSettings Visible="False" />
                </dxwgv:GridViewDataTextColumn>
                <dxwgv:GridViewDataTextColumn FieldName="CustomerAbbreviation" VisibleIndex="2">
                </dxwgv:GridViewDataTextColumn>
                <dxwgv:GridViewDataTextColumn FieldName="ChinaName" VisibleIndex="3">
                </dxwgv:GridViewDataTextColumn>
                <dxwgv:GridViewDataTextColumn FieldName="EnglishName" VisibleIndex="4">
                </dxwgv:GridViewDataTextColumn>
                <dxwgv:GridViewDataTextColumn FieldName="Leader" VisibleIndex="5">
                </dxwgv:GridViewDataTextColumn>
                <dxwgv:GridViewDataTextColumn FieldName="Address" VisibleIndex="6">
                </dxwgv:GridViewDataTextColumn>
                <dxwgv:GridViewDataTextColumn FieldName="Tel" VisibleIndex="7">
                </dxwgv:GridViewDataTextColumn>
                <dxwgv:GridViewDataTextColumn FieldName="Email" VisibleIndex="8">
                </dxwgv:GridViewDataTextColumn>
                <dxwgv:GridViewDataTextColumn FieldName="Fax" VisibleIndex="9">
                </dxwgv:GridViewDataTextColumn>
                <dxwgv:GridViewDataTextColumn FieldName="Area" VisibleIndex="10">
                </dxwgv:GridViewDataTextColumn>
                <dxwgv:GridViewDataTextColumn FieldName="Nature" VisibleIndex="11">
                </dxwgv:GridViewDataTextColumn>
                <dxwgv:GridViewDataTextColumn FieldName="MainBrand" VisibleIndex="12">
                </dxwgv:GridViewDataTextColumn>
                <dxwgv:GridViewDataTextColumn FieldName="MainProduct" VisibleIndex="13">
                </dxwgv:GridViewDataTextColumn>
                <dxwgv:GridViewDataTextColumn FieldName="ScaleLevel" VisibleIndex="14">
                </dxwgv:GridViewDataTextColumn>
                <dxwgv:GridViewDataTextColumn FieldName="CreditLevel" VisibleIndex="15">
                </dxwgv:GridViewDataTextColumn>
                <dxwgv:GridViewDataTextColumn FieldName="CooperationLevel" VisibleIndex="16">
                </dxwgv:GridViewDataTextColumn>
                <dxwgv:GridViewDataTextColumn FieldName="FK_ContactKey" VisibleIndex="17">
                </dxwgv:GridViewDataTextColumn>
                <dxwgv:GridViewDataTextColumn FieldName="Fakedelete" VisibleIndex="18">
                </dxwgv:GridViewDataTextColumn>
                <dxwgv:GridViewDataTextColumn FieldName="CreatePeople" VisibleIndex="19">
                </dxwgv:GridViewDataTextColumn>
                <dxwgv:GridViewDataDateColumn FieldName="CreateDate" VisibleIndex="20">
                </dxwgv:GridViewDataDateColumn>
                <dxwgv:GridViewDataTextColumn FieldName="ChangesPeople" VisibleIndex="21">
                </dxwgv:GridViewDataTextColumn>
                <dxwgv:GridViewDataDateColumn FieldName="ChangesDate" VisibleIndex="22">
                </dxwgv:GridViewDataDateColumn>
            </Columns>
        </dxwgv:ASPxGridView>

 

 

 aspxgridview的客户端事件

<ClientSideEvents SelectionChanged="function(s, e) {OnGridSelectionChanged();}" />

 

 

----js---

    function OnGridSelectionChanged() {
    grid.GetSelectedFieldValues(‘Customer_ID‘, OnGridSelectionComplete);
    }
    function OnGridSelectionComplete(values) {
    for(var i = 0; i < values.length-1; i ++) {
    grid.SelectRowsByKey(values[i],false);
    }    
    }

aspxgridview 实现单选

标签:nan   change   length   com   lead   sid   col   ade   als   

原文地址:https://www.cnblogs.com/wang_xy/p/12050613.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!