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

Command row colspan browser dependent bug?

3 Answers 123 Views
Grid
This is a migrated thread and some comments may be shown as answers.
cheburek
Top achievements
Rank 1
cheburek asked on 24 Dec 2010, 01:48 PM
Hi
I've stuck with following problem.
I have a grid where I do use SetRenderMethodDelegate method to customize header row (build two-level header), i.e. following:
--------------------------------------------------------
|  col1 |  col2  |______col3________|_______col4_______|
|       |        |  col3.1 | col3.2 |  col4.1 | col4.2 |
--------------------------------------------------------
|       |        |         |        |         |        |


When Command row is visible it is rendered with different collspan count for IE 8 in compatibility mode and standard mode.
For the example above in IE8 standard mode and FF, Opera it renders:
<tr class="rgCommandRow"><td class="rgCommandCell" colspan="6">
for IE8 compatibility mode:
<tr class="rgCommandRow"><td class="rgCommandCell" colspan="4">

As a result when IE8 is in compatibility mode Command row does not fill all grid's width

I tried to set custom render method for command row and set manually Colspan property but it DOES NOT change for Compatibility mode (for FF/IE8standard renders as expected)
Below is code
Private Sub weldsGrid_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles weldsGrid.ItemCreated
        If e.Item.ItemType = GridItemType.CommandItem Then
            e.Item.SetRenderMethodDelegate(AddressOf RenderCommandDelegate)
        End If
        'If e.Item.ItemType = GridItemType.Header Then
        '   e.Item.SetRenderMethodDelegate(AddressOf RenderHeaderDelegate)
        'End If
    End Sub
 
    Private Sub RenderCommandDelegate(ByVal output As HtmlTextWriter, ByVal container As Control)
        Dim cell = DirectCast(container.Controls(0), System.Web.UI.WebControls.TableCell)      
        'IE7 or IE8 in compat mode fix  
        cell.ColumnSpan = 20
        cell.RenderControl(output)
    End Sub

Thank you

3 Answers, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 30 Dec 2010, 11:47 AM
Hello Cheburek,

To achieve the desired functionality you could try using template columns and create your own HeaderTemplate like is shown on the following example:
http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/columntypes/defaultcs.aspx

Also I am sending you a simple example which demonstrates the desired functionality. Please check it out and let me know if it helps you.

Best wishes,
Radoslav
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
cheburek
Top achievements
Rank 1
answered on 10 Jan 2011, 01:20 PM
Hello
I'd like to thank you for your response and example.

It assumes to use different tables for table header and body. This could cause complexity of columns aligning when there are many such columns with different data types inside cells. For complex grid it requires to set width property for each column (both header and body tables).

Is there other solution which use the same table to achive this functionality.
Could you please explain why solution with overriding SetRenderMethodDelegate does NOT work for IE7, is it a bug?
0
Accepted
Radoslav
Telerik team
answered on 13 Jan 2011, 10:54 AM
Sergiy,

No it is not a bug. It is not supported to modify the rendering of grid cell's. The approach used in my previous post is the only supported way for achieving the desired functionality.

Regards,
Radoslav
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.
Tags
Grid
Asked by
cheburek
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
cheburek
Top achievements
Rank 1
Share this question
or