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

GridClientSelectColumn in Scrollable RadGrid

8 Answers 138 Views
FormDecorator
This is a migrated thread and some comments may be shown as answers.
simon chen
Top achievements
Rank 1
simon chen asked on 23 Aug 2010, 12:00 PM
When i use GridClientSelectColumn in a RadGrid and set it to allow scroll, it will get a scroll bar for the outer body.
Detail please see the attach.

Example code to get the issue:

<telerik:RadFormDecorator ID="formdecorator" runat="server" DecoratedControls="All"
        ControlsToSkip="Zone" />
        <telerik:RadGrid ID="rgFr" runat="server" PageSize="50">   
    <MasterTableView DataKeyNames="A">
        <Columns>
            <telerik:GridClientSelectColumn ItemStyle-Width="20" />           
        </Columns>
    </MasterTableView>
    <ClientSettings>
        <Selecting AllowRowSelect="true" />
        <Scrolling AllowScroll="true" ScrollHeight="300" />
    </ClientSettings>

In the code-behind:

 protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                var ds = new List<object>();
                for (int i = 0; i < 100; i++)
                {
                    ds.Add(new { A = "AA" });
                }
                this.rgFr.DataSource = ds;

                this.rgFr.DataBind();
            }
        }


8 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 26 Aug 2010, 11:18 AM
Hi simon chen,

This behavior comes from the way checkboxes are decorated. To avoid it, I would suggest to use the following style on the same page:
input.rfdRealInput
{
    display: none;
    display: block\9;
    position: static !important;
    float: right;
    outline: 0;
    width: 0;
}



Regards,
Georgi Tunev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
simon chen
Top achievements
Rank 1
answered on 27 Aug 2010, 03:36 AM
Thanks for you help.
When i use this style, it fix the scrollbar problem.But since i add the style, i can't check/uncheck it when i click on the checkbox.
0
simon chen
Top achievements
Rank 1
answered on 27 Aug 2010, 04:06 AM
i'm sorry. it's my mistake to make the checkbox disable, and the style you provide really work now.
but i still have a little confusion about the code:
display: none;
display: block\9;
what's the meaning of these 2 lines?
0
Georgi Tunev
Telerik team
answered on 27 Aug 2010, 07:04 AM
Hi simon chen,

The \9 string is an IE hack - this way all browsers will read display:none, while IE browsers will have display:block. More information on it is available on the Net.


Best wishes,
Georgi Tunev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Kevin
Top achievements
Rank 1
answered on 17 Sep 2010, 07:38 PM
I had this same issue (with the scrollbar in the main browser window).  In addition, I had an issue where if I scrolled down in the RadGrid and clicked on a checkbox in the GridClientSelectColumn, it would cause the entire page to jump down (so every time I'd check a checkbox, the page would be jumping around).  Both these issues were resolved when I added the input.rfdRealInput style you posted to my CSS file.

However, now my checkboxes are formatting strangely in IE 8 (they seem to have line breaks on top of the checkboxes).  In Firefox 3.5, the checkboxes don't display at all even though they're still there...if I click where the checkbox would be, it still selects the row.  I can select multiple rows by clicking where the checkbox should be on each line.  (The page behaved this way in Firefox even before I added the new style, so I wonder if it's a Firefox or CSS issue not necessarily caused by the rfdRealInput style.)  Please see attached screen snippets.

My GridClientSelectColumn looks like:
<telerik:GridClientSelectColumn HeaderStyle-Width="20px" HeaderStyle-VerticalAlign="Top" ItemStyle-VerticalAlign="Top"></telerik:GridClientSelectColumn>

Do you know how I can fix it so the checkboxes appear normally (vertically aligned to the top with no extra line breaks)?  My biggest focus is getting it to work in IE.  However, it'd be nice to get it working in Firefox, too.

Thanks!
0
Georgi Tunev
Telerik team
answered on 23 Sep 2010, 08:38 AM
Hello Kevin,

Here is an updated version of the CSS that works on our side when we tested your case - I hope this helps:

input.rfdRealInput
{
    display: none;
    display: block\9;
    position: static !important;
    float: right;
    outline: 0;
    width: 0;
    height: 0;
    margin-top: -5px;
}


Sincerely yours,
Georgi Tunev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Amir
Top achievements
Rank 2
answered on 07 Dec 2010, 09:48 AM
Did you check the solution in opera?

the checkboxes does not work in opera when add the given style. everything ok in internet explorer but the checkboxes not checked in opera!
0
Amir
Top achievements
Rank 2
answered on 08 Dec 2010, 05:55 AM
I found a solution for all browsers

input.rfdRealInput

 

 

{
    display:block;
    position: static !important;
    float: right;
    outline: 0;
    width: 0;
    height: 0;
    margin-top: -5px;
    FILTER: alpha(opacity=0)
    -moz-opacity: 0
    opacity: 0;
}

 

Tags
FormDecorator
Asked by
simon chen
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
simon chen
Top achievements
Rank 1
Kevin
Top achievements
Rank 1
Amir
Top achievements
Rank 2
Share this question
or