views:

121

answers:

0

I am using context menu in Gridview control with vb.net 2.0. This context menu is added in last column of the Gridview control. When I use IE7 working fine, but when i upgraded IE7 to IE8 it is not working properly. This context menu is not coming left side of the page. I am thinking as of context menu property that should come left side because if right side have not enough page.

code:

Public Function RenderMenu(ByVal p as BasePage) As String

    Dim menuBuilder As New StringBuilder

    menuBuilder.Append("<div ")
    menuBuilder.Append("class=""ContextMenuGroup"" ")
    menuBuilder.Append("onselectstart=""return false;"" ")
    menuBuilder.Append(">")

    menuBuilder.Append("<table ")
    menuBuilder.Append("cellpadding=""0"" ")
    menuBuilder.Append("cellspacing=""0"" ")
    menuBuilder.Append("border=""0"" ")
    menuBuilder.Append(">")

    Dim item As ContextMenuItem
    For Each item In Me.Items
        menuBuilder.Append("<tr>")

        menuBuilder.Append("<td ")
        menuBuilder.Append(" nowrap ")

        If (Not item.ID Is Nothing AndAlso item.ID.Length > 0) Then
            menuBuilder.Append("id=""" & item.ID & """ ")
        End If

        menuBuilder.Append("class=""ContextMenuItem"" ")
        menuBuilder.Append("onmouseover=""this.className='ContextMenuItemHover';"" ")
        menuBuilder.Append("onmouseout=""this.className='ContextMenuItem';"" ")
        Dim sParams as String = item.ClientSideCallbackFunctionParameters
        menuBuilder.Append("onclick=""window.blur(); window.parent." & item.ClientSideCallbackFunctionName & "(" & sParams & ");"" ")
        menuBuilder.Append(">")

        menuBuilder.Append(HttpUtility.HtmlEncode(p.TranslateText(item.Text)))
        menuBuilder.Append("</td>")
        menuBuilder.Append("</tr>")
    Next

    menuBuilder.Append("</table>")
    menuBuilder.Append("</div>")

    Return menuBuilder.ToString()

End Function

This is one public class and using in gridview as custom control.It coming properly in IE7 browser but in IE8 not coming.