0

我在我的解决方案中使用了 radgrid。我使用此 radgrid 拖放数据,但无需选择任何内容。因此,当用户单击一行时,该行不应将其布局更改为选定的行。但是当我禁用选择时,拖放将不再起作用。这不是那种问题,但它必须至少对用户来说是不可见的,因为有些用户可能会感到困惑。

有没有办法禁用选择但继续拖放或覆盖/删除选定行的css?

先感谢您!

亲切的问候,韦斯利

例子

<telerik:RadGrid ID="rgData" runat="server" AutoGenerateColumns="False" AllowMultiRowSelection="false" CellSpacing="0" GridLines="None" onrowdrop="rgData_RowDrop">
    <ClientSettings AllowRowsDragDrop="True" EnablePostBackOnRowClick="true">
        <Selecting AllowRowSelect="true" EnableDragToSelectRows="true" />
    </ClientSettings>
</telerik:RadGrid>
4

1 回答 1

0

你有两个选项可以解决你的问题。您认为应该更改 CSS 而不是尝试禁用选择是正确的。

方法 1(如果您不使用皮肤)是使用 itemStyle 和 SelectedItemStyle 元素,它们具有您需要设置的所有属性。

<telerik:RadGrid ID="rgData" runat="server" AutoGenerateColumns="False" AllowMultiRowSelection="false" CellSpacing="0" GridLines="None" onrowdrop="rgData_RowDrop">
    <SelectedItemStyle BackColor="AliceBlue" />
    <ItemStyle BackColor="AliceBlue"  />
    <ClientSettings AllowRowsDragDrop="True" EnablePostBackOnRowClick="true">
        <Selecting AllowRowSelect="true" EnableDragToSelectRows="true" />
    </ClientSettings>
</telerik:RadGrid>

或者,如果您正在使用皮肤,请在 radGrid 集上将EnableEmbeddedSkins="false"皮肤目录复制到您的项目中,并为您正在使用的皮肤修改以下样式:

该文件应类似于:RadControls/Grid/Skins/[SkinName]/Styles.css 文件。

    .RadGrid_[SkinName] .rgSelectedRow
    {
        background: #e5e5e5 !important;
        height: 22px;
        border: solid 1px #e5e5e5;
        border-top: solid 1px #e9e9e9;
        border-bottom: solid 1px white;
        padding-left: 4px;
    }
于 2012-04-17T13:29:35.247 回答