This is a migrated thread and some comments may be shown as answers.

Radgrid selected item style

11 Answers 1194 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ron
Top achievements
Rank 1
Ron asked on 14 Sep 2011, 05:57 PM
Hi,

can you tell me  how to change radgrid selected item style? When I use the following css, it appears that there's a grey overlay and blow there's the red background i'm looking for. I attached a photo to give you an example.
.SelectedStyle
{
 background-color: red !important;
}
<telerik:RadGrid ID="grdClients" runat="server" Width="100%" AutoGenerateColumns="false"
       AllowMultiRowEdit="false" ShowHeader="false" DataSourceID="objClients"
           CssClass="RadGrid_Default" SelectedItemStyle-CssClass="SelectedStyle">

Thanks

11 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 14 Sep 2011, 06:19 PM
Hello,

<style>
    .RadGrid .rgSelectedRow
    {
        background-image : none !important;
        background-color: red !important;
    }
</style>


let me know if any concern.

Thanks,
Jayesh Goyani
0
Ron
Top achievements
Rank 1
answered on 14 Sep 2011, 08:04 PM
Thanks a lot, that worked. Can you tell me how to apply a hover style to rad grid. Apparently what I'm doing is not working.
.RadGrid .rgHoveredRow
            {
                background-color:blue;
            }
0
Jayesh Goyani
Top achievements
Rank 2
answered on 14 Sep 2011, 08:22 PM
Hello,

If you want to overwrite existing css then add "!important;" after every css property.

Thanks,
Jayesh Goyani
0
Ron
Top achievements
Rank 1
answered on 14 Sep 2011, 09:31 PM
I tried that but still did not work, I wonder if im using the correct style.
0
Accepted
Princy
Top achievements
Rank 2
answered on 15 Sep 2011, 05:34 AM
Hello Ron,

To enable the hover style for the grid rows, set the ClientSettings  EnableRowHoverStyle property of RadGrid to True. For further information check the following help documentation.
Set style on mouse over

Thanks,
Princy.
0
Prabhu
Top achievements
Rank 1
answered on 10 Feb 2012, 07:27 AM
Hi,
    As Jayesh Goyani suggested I've used the CSS for hightlighting my RadGrid. it works fine but I am able to see Green border for the seleted item eventhough ive mentioned the Border Style in my CSS. Please let me know where the Problem is. Ive attached the CSS and the image for your references.

.RadGrid .rgSelectedRow
{
    background-image : none !important;
    background-color: #cee2ff !important;
    height: 19px !important;
    border:solid 1px #0e4b7d !important;
}

For better viewable, ive zoom in my page to 200%.
0
Shinu
Top achievements
Rank 2
answered on 10 Feb 2012, 07:48 AM
Hello,

Try the following CSS.
CSS:
.RadGrid_Default .rgSelectedRow td
{
    border-bottom-color:transparent !important;
}

-Shinu.
0
Vishu
Top achievements
Rank 1
answered on 28 May 2014, 09:32 PM
Can I disable mouse hovering on grid first row and let it be enable for other rows? I am displaying first row as footer total and do not wan't to let user to hover over it. See screen shot.
0
Shinu
Top achievements
Rank 2
answered on 29 May 2014, 04:17 AM
Hi Vishu,

Please try to attach the client side OnRowMouseOver event of the RadGrid and cancel the event only for the first row of the RadGrid.

ASPX:
...
<
ClientSettings>
    <ClientEvents OnRowMouseOver="RowMouseOver" />
</ClientSettings>
...

JavaScript:
function RowMouseOver(sender, args) {
    if (args._itemIndexHierarchical == 0) {
        args._domEvent.preventDefault();
    }
}

Thanks,
Shinu.
0
Vishu
Top achievements
Rank 1
answered on 29 May 2014, 02:34 PM
Thanks Shinu. 
This did not fix the issue. Still mouse hover change the half of the row color.Please see attached screenshot.
It seems when the text is wrapped to down then issue arises. Somehow mouse hover event not identifying the first row.

In code behind Implementation, first row has been created with an empty object of list and bind to radgrid. Other columns are being hidden on _prerender event.
0
Shinu
Top achievements
Rank 2
answered on 30 May 2014, 04:19 AM
Hi Vishu,

Another approach is that on mouse over of first row in RadGrid you can change the background color as follows. From the attached screenshots I have noticed that footer is showing at the top of the RadGrid , such a behavior is not expected. Please share your code if it doesn't help.

JavaScript:
function RowMouseOver(sender, args) {
    if (args._itemIndexHierarchical == 0) {
        sender.get_masterTableView().get_dataItems()[0]._element.bgColor = "White";
    }
}

​Thanks,
Shinu.
Tags
Grid
Asked by
Ron
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Ron
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Prabhu
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Vishu
Top achievements
Rank 1
Share this question
or