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

Radgrid highlighted row height problem

7 Answers 177 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Meng
Top achievements
Rank 1
Meng asked on 11 May 2011, 10:30 PM
Hi,  I met a problem when using radgrid displaying a highlighted row. It is working fine if the height of the row is regular, however, it shows a blue section at the bottom when the height is exceeded the regular size. Please take a look at the attached image. The top screen shot shows the problem. Could anyone please give me some suggestions to solve the problem? Thanks a lot. 

Regards,
Meng  

7 Answers, 1 is accepted

Sort by
0
Gimmik
Top achievements
Rank 1
answered on 12 May 2011, 04:25 PM
Hi Meng,

I use the row select feature all the time and I've never seen it do that before. Can you post the code you use to create the RadGrid? I'm curious to see if I can replicate the issue on my side.

Thanks,
-Gimmik
0
Meng
Top achievements
Rank 1
answered on 12 May 2011, 06:07 PM
Hi Gimmik,

Thanks for your reply. Here is my code,

<telerik:RadGrid ID="gv_vendor" runat="server" Width="460" CssClass="RadGrid" GridLines="None" Skin="Office2007" AutoGenerateColumns="false" AllowPaging="True" PageSize="5" AllowSorting="True" OnSortCommand="gvVendor_SortCommand"  OnItemCommand="gvVendor_RowCommand" OnPreRender="gvVendor_PreRender" OnPageIndexChanged="gvVendor_PageIndexChanged" CellSpacing="0" >
        <PagerStyle Mode="NextPrev"></PagerStyle>
        <SelectedItemStyle BackColor="Blue"  /> 
        <MasterTableView DataKeyNames="VendorID">
             <Columns>
               <telerik:GridTemplateColumn HeaderStyle-Width="160"  HeaderText="Vendor Name" SortExpression="VendorName">
                    <ItemTemplate>
                        <asp:LinkButton ID="lbl_dlr" runat="server" Text='<%#Eval("VendorName")%>' CommandArgument='<%#Eval("VendorID")%>' CommandName="SingleClick" Visible="true"/>
                    </ItemTemplate>
               </telerik:GridTemplateColumn>
               <telerik:GridTemplateColumn HeaderStyle-Width="300" HeaderText="Vendor Type">
                    <ItemTemplate>
                        <asp:Label ID="lbl_vendortype" runat="server" Text='<%#Eval("DisplayVendorTypes")%>' Visible="true"/>
                    </ItemTemplate>
               </telerik:GridTemplateColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
protected void gvVendor_RowCommand(object sender, GridCommandEventArgs e)
        {
            string _commandName = e.CommandName;
  
            switch (_commandName)
            {
                case (Constants.SL_SingleClick):
                    GridDataItem dataItem = e.Item as GridDataItem;
                    string selectedVendor = Convert.ToString(e.CommandArgument);
                 
                    dataItem.Selected = true;
                    _presenter.SelectedVendor(selectedVendor);
                    break;
            }
        }
0
Accepted
Pavlina
Telerik team
answered on 16 May 2011, 12:14 PM
Hi Meng,

Please refer to:
http://www.telerik.com/community/code-library/aspnet-ajax/grid/how-to-preserve-the-original-radgrid-selected-hover-row-background-when-using-itemstyle-backcolor.aspx

Kind regards,
Pavlina
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Meng
Top achievements
Rank 1
answered on 16 May 2011, 03:21 PM
Great, Thanks so much for the help. Problem resolved after adding the following style to my css file
.RadGrid_Office2007 .rgSelectedRow
{
    background-color:#ffcb60 !important;
}
0
Pavlina
Telerik team
answered on 16 May 2011, 05:18 PM
Hi Meng,

I am glad that the provided link helps to resolve the problem. Please do not hesitate to contact us if other questions or problems arise.

Best wishes,
Pavlina
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Zafar
Top achievements
Rank 1
answered on 16 May 2011, 09:38 PM
Hello, I am having a similar issue with a little bit different scenario. I tried this solution but it does not seem to solve my issue. I have two columns with a background color and the selection is giving me different behavior based on if I access the page using "localhost" in the url versus the actual server name.

When I access the page using localhost in the url, the selected row is highlighted nicely with the two columns which have the background color still showing the background color. Please see the attached image.

But when I access the same page with the server name in the url instead of the local host, the slected row hides the background color of the two columns and actually the bad part is that it hides only half of that. Please see the attached file.

Your help in this regard woudl be appreciated.

Thanks!

Zafar

0
Zafar
Top achievements
Rank 1
answered on 16 May 2011, 11:10 PM
I kept looking and finally was able to resolve this based on the following post.

http://www.telerik.com/community/forums/aspnet-ajax/grid/half-selected-row.aspx

Thanks!

Zafar
Tags
Grid
Asked by
Meng
Top achievements
Rank 1
Answers by
Gimmik
Top achievements
Rank 1
Meng
Top achievements
Rank 1
Pavlina
Telerik team
Zafar
Top achievements
Rank 1
Share this question
or