在组件艺术网格中选择单行不起作用

Selecting a single row in component art grid not working

我有关于组件艺术网格的问题。

有没有人在您的属性为 AllowMultipleSelect="false" 的单行中遇到 select 问题,但您仍然能够 select 多行。

我似乎无法解决这个问题,因为我只想用 selectedRowCssClass 颜色是什么颜色突出显示 selected 行。

这是我的前端代码:

<%@ Register Assembly="ComponentArt.Web.UI" Namespace="ComponentArt.Web.UI" TagPrefix="ComponentArt" %>

<!DOCTYPE html>
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <base target="_self" />
    <title>iView Trend Data</title>
    
    <link href="Assets/OldCss/gridStyle.css" rel="stylesheet" />

</head> 
<body>
    <form id="form1" runat="server">
    <asp:HiddenField ID="ParamA" runat="server" />
    <asp:HiddenField ID="ParamB" runat="server" />
    <table style="width:100%; Height:100%;" >
        <tr>
            <td>
                <ComponentArt:CallBack id="CallBack1" CacheContent="false" width="100%" Height="100%" runat="server">
                    <Content>
                        <ComponentArt:Grid ID="Grid1"
                            CssClass="Grid" 
                            runat="server"
                            RunningMode="Client"                          
                            ShowFooter="false" 
                            ImagesBaseUrl="~/Assets/Image/Grid/"
                            Sort="DateTime"
                            ScrollBar="Auto" 
                            ScrollTopBottomImagesEnabled="true"
                            ScrollTopBottomImageHeight="2" 
                            ScrollTopBottomImageWidth="16"
                            ScrollImagesFolderUrl="~/Assets/Image/Grid/"
                            ScrollButtonWidth="16" 
                            ScrollButtonHeight="17"
                            ScrollBarCssClass="ScrollBar"
                            ScrollGripCssClass="ScrollGrip" 
                            ScrollBarWidth="16"
                            ScrollPopupClientTemplateId="ScrollPopupTemplate"
                            Width="760" 
                            Height="618" 
                            AllowTextSelection="false" 
                            AllowHorizontalScrolling="True" 
                            AllowMultipleSelect="false" 
                            PageSize="30" 
                            ShowHeader="true"
                            ShowSearchBox="true"
                            SearchOnKeyPress="true"
                            Visible="true" 
                            AllowVerticalScrolling="False"
                            GroupingNotificationText="">
                                <Levels>
                                    <ComponentArt:GridLevel 
                                        DataKeyField="DateTime"
                                        ShowTableHeading="False" 
                                        ShowSelectorCells="False"
                                        HeadingCellCssClass="HeadingCell"
                                        HeadingCellHoverCssClass="HeadingCellHover"
                                        HeadingCellActiveCssClass="HeadingCellActive"
                                        HeadingTextCssClass="HeadingCellText"
                                        DataCellCssClass="DataCell" 
                                        RowCssClass="DataRow"
                                        SelectedRowCssClass="SelectedRow"
                                        SortAscendingImageUrl="asc.gif" 
                                        SortDescendingImageUrl="desc.gif"
                                        ColumnReorderIndicatorImageUrl="reorder.gif"
                                        SortedDataCellCssClass="SortedDataCell" 
                                        SortImageWidth="14"
                                        SortImageHeight="14"
                                        AllowGrouping="false"
                                        AlternatingRowCssClass="AlternatingRow">
                                        <Columns>
                                            <ComponentArt:GridColumn DataField="DateTime" Width="100" FormatString="yyyy-MM-dd HH:mm" Visible="false"/>
                                        </Columns>
                                    </ComponentArt:GridLevel>
                                 </Levels>   
                                <clienttemplates>
                                    <ComponentArt:ClientTemplate Id="ScrollPopupTemplate">
                                        <table cellspacing="0" cellpadding="2"
                                         border="0" class="ScrollPopup">
                                        <tr>
                                            <td style="width:50px;">
                                                <div style="font-size:10px;font-family:MS Sans Serif; text-overflow:ellipsis; overflow:visible;">
                                                    <nobr>## DataItem.GetMember("DateTime").Text ##</nobr>
                                                </div>
                                            </td>
                                        </tr>
                                        </table>
                                    </ComponentArt:ClientTemplate>
                                </clienttemplates>
                        </ComponentArt:Grid>  
                      
                        </Content>
                        <LoadingPanelClientTemplate>
                                <table width="100%" align="center" style="position:relative;top:250px">
                                    <tr>
                                        <td style="color:#cee820" align="right">Loading..</td>
                                     <td align="left">   <img src="./images/ajax-loader.gif" width="48" height="48" border="0"/></td>
                                    </tr>
                                </table>
                        </LoadingPanelClientTemplate>
                    </ComponentArt:CallBack>
            </td>
            </tr>
            </table>

    </form>
</body>
</html>

我遇到了类似的问题,原来是因为 DataKeyField 的值中有空格。