0

I'm using a radgrid in my solution. I use this radgrid for dragging and dropping of data, but nothing needs to be selected. So when a user clicks a row, the row shouldn't change his lay-out to a selected row. But when i disable selecting, drag and drop won't work anymore. It's not that kind of a problem, but it must be at least invisible for the user because some users can get confused.

Is there a way to ether disable selection but keep dragging and dropping or overide/delete the css of a selected row?

Thank you in advance!

Kind regards, Wesley

example

<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>
Wesley Lalieu
  • 487
  • 2
  • 8
  • 22

1 Answers1

0

You have two options you can do that will solve your problem. You're right in thinking you should change the CSS Rather than attempt to disable the selection.

Method 1 (if you're not using skins) is to use the itemStyle and SelectedItemStyle elements which have all the properties you need to set.

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

Or if you are using skins, on the radGrid set EnableEmbeddedSkins="false" and copy the skins directory into your project, and modify the following styles for the skin you're using:

The file should be something like: RadControls/Grid/Skins/[SkinName]/Styles.css file.

    .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;
    }
Brian Garson
  • 1,160
  • 6
  • 11