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

Vertical gridline disappears

5 Answers 228 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ryan Emptage
Top achievements
Rank 1
Ryan Emptage asked on 12 Mar 2009, 10:32 AM
Hi

In my RadGrid I have one row that I do not want to be edited, so I wrote the following code:

protected void RadGridWaCssSettingsEditor_ItemDataBound(object sender, GridItemEventArgs e) 
        {    
            if (e.Item is GridDataItem) 
            { 
                GridDataItem dataItem = (GridDataItem)e.Item; 
 
                // Do not allow the CSS property "theme" to be edited 
                if (dataItem["CssProperty"].Text == "theme"
                { 
                    dataItem["Edit"].Controls[0].Visible = false
                }                 
 
            }  
 
        } 

The problem I have is that the vertical gridline between the item column and the edit command column has disappeared as shown here

Any ideas?
Thanks.





5 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 12 Mar 2009, 11:51 AM
Hi Ryan,

It would suggest you to try the following code snippet to prevent editing of the Grid row instead of hiding the Edit button.

CS:
protected void RadGridWaCssSettingsEditor_ItemDataBound(object sender, GridItemEventArgs e)  
        {     
            if (e.Item is GridDataItem)  
            {  
                GridDataItem dataItem = (GridDataItem)e.Item;  
  
                // Do not allow the CSS property "theme" to be edited  
                if (dataItem["CssProperty"].Text == "theme")  
                {  
                     dataItem.Edit = false
                }                  
  
            }   
  
        }  


Thanks
Shinu
0
Ryan Emptage
Top achievements
Rank 1
answered on 12 Mar 2009, 12:03 PM
Hi Shinu

Yes I had already tried that but not really what I wanted.
I think I have no choice but to implement it like you said.

Thanks anyway.
0
Shinu
Top achievements
Rank 2
answered on 13 Mar 2009, 03:43 AM
Hi Ryan,

Give a try with the following approach and see whether it helps.

CS:
protected void RadGridWaCssSettingsEditor_ItemDataBound(object sender, GridItemEventArgs e)  
        {     
            if (e.Item is GridDataItem)  
            {  
                GridDataItem dataItem = (GridDataItem)e.Item;  
  
                // Do not allow the CSS property "theme" to be edited  
                if (dataItem["CssProperty"].Text == "theme")  
                {  
                    dataItem["Edit"].Controls[0].Visible = false;  
                    dataItem["Edit"].Text = " "
                }                  
  
            }   
  
        } 


Regards
Shinu



0
Ryan Emptage
Top achievements
Rank 1
answered on 13 Mar 2009, 09:16 AM
Hi Shinu

Yes I was just thinking about that solution, because I found the problem was also happening for some data rows with no value.
Example shown here

A bug with the RadGrid perhaps?

Thanks for your suggestions.
0
Dimo
Telerik team
answered on 13 Mar 2009, 09:31 AM
Hi Ryan,

This is a limitation of Internet Explorer - borders are not shown for empty table cells. The CSS language provides a property, which controls this behavior, but IE does not support it.

Kind regards,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Ryan Emptage
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Ryan Emptage
Top achievements
Rank 1
Dimo
Telerik team
Share this question
or