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

Remove border from RadListBox inside of GridTemplateColumn

3 Answers 243 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Casey
Top achievements
Rank 1
Casey asked on 05 Mar 2010, 06:15 PM
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);  
        }  
 
 

3 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 08 Mar 2010, 08:52 AM

Hello,

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

CSS:

.rlbGroup  
{  
    bordernone !important;  

-Shinu.

0
Casey
Top achievements
Rank 1
answered on 08 Mar 2010, 07:57 PM
Thank you Shinu!!! That did the trick!
0
Phil
Top achievements
Rank 2
answered on 08 Dec 2010, 10:48 AM

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; }

Tags
Grid
Asked by
Casey
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Casey
Top achievements
Rank 1
Phil
Top achievements
Rank 2
Share this question
or