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

[Solved] Half selected row!!!!!!!!!!!!

10 Answers 342 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Medac
Top achievements
Rank 1
Medac asked on 23 Jul 2009, 07:39 AM
Hi,

I have a Radgrid for which I am setting background color of the row to differnet colors according to the need. Here when I select a row then selected row color is half colored.  Row height is more than the normal. Content of the row is displayed like two rows in a single row.

how to fix this selection issue.

Regards,
Medac










10 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 23 Jul 2009, 08:29 AM
Hi Medac,

I guess the default  SelectedItemStyle-BackColor is not getting applied properly while you select a row. If so you may try the following approach.

Style.Css:
 
<head runat="server"
    <title>Untitled Page</title> 
    <style type="text/css" > 
    .RadGrid_Default .rgSelectedRow  
    {  
        background:#828282 0 -3900px repeat-x url('Grid/sprite.gif'!important
    color:#fff
    }  
 
    </style> 
</head> 

If this does not help please specify the Skin Name that you have used for the Grid.

Thanks
Princy.
0
Medac
Top achievements
Rank 1
answered on 23 Jul 2009, 11:18 AM
Hey Princy thanks. It is working fine.

Regards,
Medac
0
Eduardas
Top achievements
Rank 1
answered on 15 Sep 2009, 07:31 AM
Hi,
I have the same problem as Medac described: I set different background color to some rows in codebehind on itemdatabound. Some of the rows have double height. When I select rows, that I have changed background color on, selected row color is half colored. I've tried with the solution that you describe, but it didn't work out for me. Can you help me, please.
Regards,
Ed
0
Dimo
Telerik team
answered on 15 Sep 2009, 07:36 AM
Hi Eduardas,

Please refer to

http://www.telerik.com/community/forums/community-forums/design/conditional-formatting-skews-all-the-skin-format-once-applied-to-a-row-in-radgrid.aspx#601248

All the best,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Eduardas
Top achievements
Rank 1
answered on 15 Sep 2009, 08:16 AM
Dimo, thank you for the quick answer.
I've done as you advise, but the problem now is that those rows that should have different colors are not selected at all.  I can not apply AlternatnigRowStyle on them, as these rows should change background color depending on some values from the DB. So I still have the same problem. If I declare

e.Item.BackColor = somecolor - only half of the row is marked when selected

if I write

e.Item.CssClass =

"MyRowClass"  and

 

.RadGrid_Default

 

tr.MyRowClass

 

 

 { 

background: yellow; }  - these rows are not mared as selected at all.

 

 

 

 

Regards,
Ed.

0
Dimo
Telerik team
answered on 15 Sep 2009, 09:12 AM
Hi Eduardas,

When you set a custom item background color with a CSS class, you also need to set a selected background color with a CSS class, as demonstrated in the forum post I provided in my previous message. This is required due to the rules of CSS inheritance.

Greetings,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Eduardas
Top achievements
Rank 1
answered on 16 Sep 2009, 08:03 AM
Hello,

The problem that I am experiencing is that the rows that have a custom style are not diisplayed correctly with hover effect (onmouseover/onmouseout).

I have the following setting defined in the grid:

<

 

ClientSettings EnableRowHoverStyle="true" />

 


The row style defined for specific rows is set as follows.

 

.RadGrid_Default tr.MyRowClass

 

{

 

background: yellow;

 

 

cursor: default;

 

}


I am trying to apply the standard hover effect on these rows, so that onmouseover/out would be the same as for the rest of the rows in the grid. Something like this:

 

.RadGrid_Default tr.MyRowClass .rgHoveredRow

 

{

 

background:#c5c5c5 0 -2900px repeat-x url('Grid/sprite.gif');

 

 

color:#333;

 

}


How can this effect be accomplished?

Regards,
/Eduardas
0
Dimo
Telerik team
answered on 16 Sep 2009, 09:12 AM
Hi Eduardas,

The following will not work:

.RadGrid_Default  tr.MyRowClass   .rgHoveredRow
{

}

because it means "hovered rows inside my_custom_rows" - such rows do not exist, as the hovered rows and your custom rows are the same elements. Please use:

.RadGrid_Default  .rgHoveredRow
{
        background-color: #c5c5c5 !important ;
}


Kind regards,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Eduardas
Top achievements
Rank 1
answered on 16 Sep 2009, 09:20 AM
Thank you,
Now it works. :)

Regards,
Eduardas
0
ciskomisko
Top achievements
Rank 1
answered on 18 Jan 2010, 11:51 AM

 

It works with this style sheet in page.


.RadGrid_Office2007
.rgSelectedRow

 

{

 

background:grey !important;

 

 

border-bottom:none;

 

}

Tags
Grid
Asked by
Medac
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Medac
Top achievements
Rank 1
Eduardas
Top achievements
Rank 1
Dimo
Telerik team
ciskomisko
Top achievements
Rank 1
Share this question
or