Remove border from RadListBox inside of GridTemplateColumn

4 posts, 1 answers
  1. Casey
    Casey avatar
    299 posts
    Member since:
    Jul 2009

    Posted 05 Mar 2010 Link to this post

    Hello,

    I'm having trouble removing the border from RadListBoxes inside of my RadGrid's GridTemplateColumn. If anybody knows how to achieve this, please let me know. The below code is what I have tried - it worked to alter the height of the listbox, but not the border style or color.

    Any assistance would be appreciated!

    Thanks,
    Casey

    GridTemplateColumn definitions:
    <telerik:GridTemplateColumn HeaderText="Assigned Departments" UniqueName="TemplateColumn">  
                                    <ItemTemplate> 
                                        <telerik:RadListBox ID="rlbMyDepts" runat="server" Width="250px" BorderStyle="None" 
                                            DataKeyField="DEPT_CD" DataTextField="DESC">  
                                        </telerik:RadListBox> 
                                        <br /> 
                                        <asp:LinkButton ID="lbChangeAssignedDepts" runat="server" CommandName="ChangeAssignedDepts" 
                                                        OnClientClick='<%#Eval("USER_ID", "return ShowDeptsForm(\"{0}\")")%>'>Change</asp:LinkButton> 
                                    </ItemTemplate> 
                                </telerik:GridTemplateColumn> 
                                <telerik:GridTemplateColumn HeaderText="Assigned Object Classes" UniqueName="TemplateColumn1">  
                                    <ItemTemplate> 
                                        <telerik:RadListBox ID="rlbMyObjects" runat="server" Width="250px" BorderStyle="None" 
                                            DataKeyField="OBCL_CD" DataTextField="OBCL_CD">  
                                        </telerik:RadListBox> 
                                        <br /> 
                                        <asp:LinkButton ID="lbChangeAssignedObjects" runat="server" CommandName="ChangeAssignedObjects" 
                                                        OnClientClick='<%#Eval("USER_ID", "return ShowObjectsForm(\"{0}\")")%>' EnableViewState="True" BorderStyle="None">Change</asp:LinkButton> 
                                    </ItemTemplate> 
                                </telerik:GridTemplateColumn> 

    Code Behind in RadGrid's ItemDataBound event:
    if (e.Item is GridDataItem)  
            {    
                GridDataItem d = e.Item as GridDataItem;  
     
                RadListBox myDepts = d.FindControl("rlbMyDepts"as RadListBox;  
                myDepts.BorderStyle = BorderStyle.None;  
                myDepts.BorderColor = System.Drawing.Color.White;  
                myDepts.Height = Unit.Pixel(50);  
     
                RadListBox myObjects = d.FindControl("rlbMyObjects"as RadListBox;  
                myObjects.BorderStyle = BorderStyle.None;  
                myObjects.BorderColor = System.Drawing.Color.White;  
                myObjects.Height = Unit.Pixel(50);  
            }  
     
     

  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 08 Mar 2010 Link to this post

    Hello,

    Add the following CSS on page and see whether it helps.

    CSS:

    .rlbGroup  
    {  
        bordernone !important;  

    -Shinu.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Casey
    Casey avatar
    299 posts
    Member since:
    Jul 2009

    Posted 08 Mar 2010 Link to this post

    Thank you Shinu!!! That did the trick!
  5. Phil
    Phil avatar
    84 posts
    Member since:
    Apr 2005

    Posted 08 Dec 2010 Link to this post

    The above solutions didn't work for me, but I discovered (by judicious poking about using IE8 Developer Tools - F12) that the following CSS will do the trick:

    .RadListBox div.rlbTemplateContainer { border: none !important; }

Back to Top