2016-01-07 1 views
0

У меня есть вопрос о сетке компонентов.Выбор одной строки в сетке компонентов не работает

Кто-нибудь боролся с выбором одной строки, где ваш атрибут AllowMultipleSelect = "false", но вы все еще можете выбрать несколько строк.

Я просто не могу обойти это, потому что я хочу, чтобы выбранная строка была подсвечена цветом, который когда-либо был выбран для цвета выделенного цвета RowCssClass.

Вот мой передний конец код:

<%@ 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>

ответ

0

У меня была аналогичная проблема, которая оказалась бы потому, что значения DataKeyField имели места в них.

Смежные вопросы