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

RowDouble Click on ServerSide doesnot work in firefox

5 Answers 187 Views
Grid
This is a migrated thread and some comments may be shown as answers.
sathies
Top achievements
Rank 1
sathies asked on 19 Mar 2009, 10:33 AM

Hi,
I am using Dynamic grid created in pageinit and i tried the following code for rowdoublclik of grid which works in IE and not in Firefox.
But when I use alert() function in the javascript its works . The grid is placed on the multipage(Tabstrip).



<script language="javascript" type="text/javascript"
    function RowDblClick(sender, args) 
    { 
        sender.get_masterTableView().fireCommand("RowDblClickServer", args._itemIndexHierarchical); 
          alert();
    } 
</script>




protected void RadGrid1_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) 
    if (e.CommandName == "RowDblClickServer"
    { 
        string targetItemNumber = e.CommandArgument; 
    } 


please help me ...

regards,
sathies

5 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 19 Mar 2009, 01:21 PM
Hello Sathies,

I tried to reproduce the mentioned behavior but unfortunately without avail.  Please find my test project attached to this post. Let me know whether it works as expected on your end.

Regards,
Daniel
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.
0
sathies
Top achievements
Rank 1
answered on 20 Mar 2009, 07:49 AM
Hi Daniel,

I tried your sample its work fine.
In my application  I have three panel  pnlSitesSecond,tblSiteSearch,pnlSiteGrid and a grid . Intially pnlSitesSecond visibility is false and other two are visible. when I double click the grid row the tblSiteSearch and the grid will disappear then shows the pnlSitesSecond.

In my scenario it works for the frist time and after refreshing the page it doesnot work. I am attaching the code below. please find what goes wrong.

<div> 
        <asp:ScriptManager ID="ScriptManager1" runat="server">  
        </asp:ScriptManager> 
        <telerik:RadAjaxManager ID="AjaxManager" runat="server">  
        </telerik:RadAjaxManager> 
        <telerik:RadTabStrip ID="RadTabStrip1" MultiPageID="RadMultiPage1" runat="server">  
         <Tabs> 
        <telerik:RadTab Text="General" Value="0"  runat="server">  
         
                            </telerik:RadTab> 
                              
                            </Tabs> 
        </telerik:RadTabStrip> 
          
        <telerik:RadMultiPage ID="RadMultiPage1" runat="server">  
            <telerik:RadPageView ID="radPageViewSites" runat="server" > 
                    <table width="99%" align="center" cellpadding="0" cellspacing="0">  
                        <tr> 
                            <td> 
                                <asp:Panel ID="pnlSitesTab" runat="server" Width="100%">  
                                    <asp:Panel ID="pnlSiteFirst" runat="server" Width="100%" GroupingText="List of Sites" > 
                                        <table width="100%" cellpadding="0" cellspacing="0">  
                                            <tr> 
                                                <td> 
                                                    <asp:Panel ID="tblSiteSearch" Width="100%" runat="server">  
                                                        <table cellpadding="0" cellspacing="0">  
                                                            <tr> 
                                                                <td style="width: 220px" align="left">  
                                                                    &nbsp;<asp:Label ID="lblSiteNameSearch" Text="Site Name" runat="server"   
                                                                         /> 
                                                                    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> 
                                                                </td> 
                                                                  
                                                            </tr> 
                                                             
                                                        </table> 
                                                    </asp:Panel> 
                                                </td> 
                                            </tr> 
                                            <tr> 
                                                <td colspan="2">  
                                                    <table width="100%">  
                                                        <tr> 
                                                            <td> 
                                                                <div> 
                                                                    <asp:Panel ID="pnlSiteGrid" runat="server" > 
                                                                    </asp:Panel> 
                                                                </div> 
                                                            </td> 
                                                        </tr> 
                                                    </table> 
                                                </td> 
                                            </tr> 
                                            <tr> 
                                                <td colspan="2">  
                                                    <asp:Panel ID="pnlSitesSecond" runat="server" Width="100%"    
                                                     Visible="false"   > 
                                                        <table width="100%">  
                                                            <tr> 
                                                                <td> 
                                                                    <asp:Panel ID="pnlSite" runat="server" GroupingText="Site General Details" Width="100%" 
                                                                         > 
                                                                        <table width="100%" border="0">  
                                                                            <tr> 
                                                                                <td align="left" width="15%">  
                                                                                    &nbsp;  
                                                                                    <asp:Label ID="lblSiteNameSite" runat="server" Text="second"   
                                                                                      /><asp:TextBox ID="TextBox2" runat="server"></asp:TextBox> 
                                                                                </td> 
                                                                                <td> 
                                                                                   <%-- <asp:Button ID="Button1" runat="server" Text="Back" onclick="Button1_Click" /></td>--%> 
                                                                            </tr> 
                                                                             
                                                                        </table> 
                                                                    </asp:Panel> 
                                                                </td> 
                                                            </tr> 
                                                             
                                                        </table> 
                                                    </asp:Panel> 
                                                </td> 
                                            </tr> 
                                        </table> 
                                    </asp:Panel> 
                                  </asp:Panel>    
                            </td> 
                        </tr> 
                        <tr height="4px">  
                            <td> 
                            </td> 
                        </tr> 
                    </table> 
                      
                </telerik:RadPageView> 
        </telerik:RadMultiPage> 
         <asp:SqlDataSource ID="SqlDataSource1"   
ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>" 
            ProviderName="System.Data.SqlClient" 
            SelectCommand="SELECT * FROM Customers" runat="server"></asp:SqlDataSource> 
    </div> 

public partial class firefox : System.Web.UI.Page  
{  
    RadGrid RadGrid1;  
 
    protected void Page_Init(object sender, System.EventArgs e)  
    {  
        ArrayList d1 = new ArrayList() { "SqlDataSource1" };  
        ArrayList d2 = new ArrayList() { "CustomerID""ContactName" };  
        RadGrid1 = CreateGrid(d1, d2);  
        RadGrid1.ID = "Sites";  
        RadGrid1.ClientSettings.ClientEvents.OnRowDblClick = "RowDblClick";  
        RadGrid1.ItemCommand += new GridCommandEventHandler(RadGrid1_ItemCommand);  
 
        //.Controls.Add(RadGrid1);  
        pnlSiteGrid.Controls.Add(RadGrid1);  
 
    }  
 
    protected void Page_Load(object sender, EventArgs e)  
    {  
 
        AjaxManager.AjaxSettings.AddAjaxSetting(RadTabStrip1, RadMultiPage1,null);  
        RadGrid radGrid = (RadGrid)pnlSiteGrid.FindControl("Sites");  
 
 
        AjaxManager.AjaxSettings.AddAjaxSetting(radGrid, pnlSitesSecond, null);  
        AjaxManager.AjaxSettings.AddAjaxSetting(radGrid, tblSiteSearch, null);  
        //AjaxManager.AjaxSettings.AddAjaxSetting(Button1, pnlSitesSecond, null);  
        //AjaxManager.AjaxSettings.AddAjaxSetting(Button1, tblSiteSearch, null);  
        //AjaxManager.AjaxSettings.AddAjaxSetting(Button1, radGrid, null);  
 
    }  
 
    void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)  
    {  
        if (e.CommandName == "RowDblClickServer")  
        {  
            pnlSitesSecond.Visible = true;  
            RadGrid radGrid = (RadGrid)pnlSiteGrid.FindControl("Sites");  
            if (radGrid != null)  
                radGrid.Visible = false;  
            tblSiteSearch.Visible = false;  
 
            //Response.Redirect("~/hidegrid.aspx");  
        }  
    }  
     
 
      
 
    public GridBoundColumn CreateColumn(string column)  
    {  
 
        GridBoundColumn boundColumn = new GridBoundColumn();  
        boundColumn.DataField = column;  
        boundColumn.HeaderText = column;  
 
        return boundColumn;  
    }  
 
 
    public RadGrid CreateGrid(ArrayList dataSource, ArrayList columns)  
    {  
        RadGrid RadGrid1 = new RadGrid();  
 
        RadGrid1.ID = "RadGrid1";  
        RadGrid1.DataSourceID = dataSource[0].ToString();  
 
        RadGrid1.MasterTableView.DataKeyNames = new string[] { columns[0].ToString() };  
 
        RadGrid1.Skin = "Outlook";  
 
        RadGrid1.Width = Unit.Percentage(100);  
        // RadGrid1.PageSize = 3;  
        RadGrid1.AllowPaging = true;  
        RadGrid1.AllowSorting = true;  
        // RadGrid1.AllowFilteringByColumn = true;  
 
        RadGrid1.PagerStyle.Mode = GridPagerMode.NumericPages;  
        RadGrid1.AutoGenerateColumns = false;  
        RadGrid1.ShowStatusBar = true;  
 
        RadGrid1.MasterTableView.PageSize = 18;  
 
        int count = columns.Capacity;  
        foreach (string col in columns)  
        {  
            RadGrid1.MasterTableView.Columns.Add(CreateColumn(col));  
 
        }  
 
        return RadGrid1;  
    }  
    protected void Button1_Click(object sender, EventArgs e)  
    {  
        pnlSitesSecond.Visible = false;  
        RadGrid radGrid = (RadGrid)pnlSiteGrid.FindControl("Sites");  
        if (radGrid != null)  
            radGrid.Visible = true;  
        tblSiteSearch.Visible = true;  
    }  

In firebug of firefox i got the below error

[Exception... "'Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.' when calling method: [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)" location: "JS frame :: chrome://firebug/content/spy.js :: onHTTPSpyReadyStateChange :: line 497" data: no]

this._upperAbbrMonths = this...s.dateTimeFormat.AbbreviatedMonthNames);

please help me..

regards
sathies



0
Daniel
Telerik team
answered on 24 Mar 2009, 12:50 PM
Hello Sathies,

Thank you for the provided example.

Again, I'm unable to reproduce the problem. I attached my test project, together with a sample screenshot to this post.

I'm using the latest version of RadControls for ASP.NET AJAX.

Kind regards,
Daniel
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
sathies
Top achievements
Rank 1
answered on 25 Mar 2009, 04:46 AM
Hi Daniel,
Thanks for your time.
It also works now but now i am facing the following

In my application  I have three panel controls and grid as pnlSitesSecond, tblSiteSearch, pnlSiteGrid and RADGrid1 . Intially pnlSitesSecond visible property is set to false and for other two panel it was set to true.  When I double click a row in the grid the pnlSiteSearch and the grid should disappear and then shows the pnlSitesSecond.

I want to use both Rowclick and RowDoubleclick events of the grid. If I use only the RowDoubleclick then it works fine in firefox.
But when I use both the events RowDoubleclick event gets fired  and no changes are  reflected in the page. i.e.)  tblSiteSearch and the grid will not disappearing. The same thing works in IE. when I check the  flow, the following takes place in IE and Firefox

IE:                                             FireFox:
pageLoad                                 pageLoad
Rowclick                                    Rowclick
RowDoubleclick                        RowDoubleclick
                                                Rowclick

In firefox, Rowclick is called once again after RowDoubleclick. Please help me to avoid this.
I am attaching the code below . Please verify and give a solution.

 <telerik:RadScriptBlock ID="RadScriptBlock2" runat="server">  
      <script language="javascript" type="text/javascript">  
         function RowDblClick(sender, args)    
            {  
                sender.get_masterTableView().fireCommand("RowDblClickServer", args._itemIndexHierarchical);    
               
            }    
     </script>    
</telerik:RadScriptBlock> 
 
 <div> 
        <asp:ScriptManager ID="ScriptManager1" runat="server">  
        </asp:ScriptManager> 
        <telerik:RadAjaxManager ID="AjaxManager" runat="server">  
        </telerik:RadAjaxManager> 
        <telerik:RadTabStrip ID="RadTabStrip1" MultiPageID="RadMultiPage1" runat="server">  
         <Tabs> 
        <telerik:RadTab Text="General" Value="0"  runat="server">  
         
                            </telerik:RadTab> 
                              
                            </Tabs> 
        </telerik:RadTabStrip> 
          
        <telerik:RadMultiPage ID="RadMultiPage1" runat="server">  
            <telerik:RadPageView ID="radPageViewSites" runat="server" > 
                    <table width="99%" align="center" cellpadding="0" cellspacing="0">  
                        <tr> 
                            <td> 
                                <asp:Panel ID="pnlSitesTab" runat="server" Width="100%">  
                                    <asp:Panel ID="pnlSiteFirst" runat="server" Width="100%" GroupingText="List of Sites" > 
                                        <table width="100%" cellpadding="0" cellspacing="0">  
                                            <tr> 
                                                <td> 
                                                    <asp:Panel ID="tblSiteSearch" Width="100%" runat="server">  
                                                        <table cellpadding="0" cellspacing="0">  
                                                            <tr> 
                                                                <td style="width: 220px" align="left">  
                                                                    &nbsp;<asp:Label ID="lblSiteNameSearch" Text="Site Name" runat="server"   
                                                                         /> 
                                                                    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> 
                                                                </td> 
                                                                  
                                                            </tr> 
                                                             
                                                        </table> 
                                                    </asp:Panel> 
                                                </td> 
                                            </tr> 
                                            <tr> 
                                                <td colspan="2">  
                                                    <table width="100%">  
                                                        <tr> 
                                                            <td> 
                                                                <div> 
                                                                    <asp:Panel ID="pnlSiteGrid" runat="server" > 
                                                                    </asp:Panel> 
                                                                </div> 
                                                            </td> 
                                                        </tr> 
                                                    </table> 
                                                </td> 
                                            </tr> 
                                            <tr> 
                                                <td colspan="2">  
                                                    <asp:Panel ID="pnlSitesSecond" runat="server" Width="100%"    
                                                     Visible="false"   > 
                                                        <table width="100%">  
                                                            <tr> 
                                                                <td> 
                                                                    <asp:Panel ID="pnlSite" runat="server" GroupingText="Site General Details" Width="100%" 
                                                                         > 
                                                                        <table width="100%" border="0">  
                                                                            <tr> 
                                                                                <td align="left" width="15%">  
                                                                                    &nbsp;  
                                                                                    <asp:Label ID="lblSiteNameSite" runat="server" Text="second"   
                                                                                      /><asp:TextBox ID="TextBox2" runat="server"></asp:TextBox> 
                                                                                </td> 
                                                                                <td> 
                                                                                   <asp:Button ID="Button1" runat="server" Text="Back" onclick="Button1_Click" /></td>  
                                                                            </tr> 
                                                                             
                                                                        </table> 
                                                                    </asp:Panel> 
                                                                </td> 
                                                            </tr> 
                                                             
                                                        </table> 
                                                    </asp:Panel> 
                                                </td> 
                                            </tr> 
                                        </table> 
                                    </asp:Panel> 
                                  </asp:Panel>    
                            </td> 
                        </tr> 
                        <tr height="4px">  
                            <td> 
                            </td> 
                        </tr> 
                    </table> 
                      
                </telerik:RadPageView> 
        </telerik:RadMultiPage> 
         <asp:SqlDataSource ID="SqlDataSource1"   
ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>" 
            ProviderName="System.Data.SqlClient" 
            SelectCommand="SELECT * FROM Customers" runat="server"></asp:SqlDataSource> 
    </div> 


public partial class firefox : System.Web.UI.Page  
{  
    RadGrid RadGrid1;  
 
    protected void Page_Init(object sender, System.EventArgs e)  
    {  
        ArrayList d1 = new ArrayList() { "SqlDataSource1" };  
        ArrayList d2 = new ArrayList() { "CustomerID""ContactName" };  
        RadGrid1 = CreateGrid(d1, d2);  
        RadGrid1.ID = "Sites";  
        RadGrid1.ClientSettings.ClientEvents.OnRowDblClick = "RowDblClick";  
        RadGrid1.ItemCommand += new GridCommandEventHandler(RadGrid1_ItemCommand);  
        RadGrid1.ClientSettings.Selecting.AllowRowSelect = true;  
        RadGrid1.ClientSettings.EnablePostBackOnRowClick = true;  
 
        //.Controls.Add(RadGrid1);  
        pnlSiteGrid.Controls.Add(RadGrid1);  
 
    }  
 
    protected void Page_Load(object sender, EventArgs e)  
    {  
 
        AjaxManager.AjaxSettings.AddAjaxSetting(RadTabStrip1, RadMultiPage1,null);  
        RadGrid radGrid = (RadGrid)pnlSiteGrid.FindControl("Sites");  
 
 
        AjaxManager.AjaxSettings.AddAjaxSetting(radGrid, pnlSitesSecond, null);  
        AjaxManager.AjaxSettings.AddAjaxSetting(radGrid, tblSiteSearch, null);  
        AjaxManager.AjaxSettings.AddAjaxSetting(Button1, pnlSitesSecond, null);  
        AjaxManager.AjaxSettings.AddAjaxSetting(Button1, tblSiteSearch, null);  
        AjaxManager.AjaxSettings.AddAjaxSetting(Button1, radGrid, null);  
 
    }  
 
    void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)  
    {  
 
        if (e.CommandName == "RowClick")  
        {  
            //pnlSitesSecond.Visible = true;  
            //RadGrid radGrid = (RadGrid)pnlSiteGrid.FindControl("Sites");  
            //if (radGrid != null)  
            //    radGrid.Visible = false;  
            //tblSiteSearch.Visible = false;  
 
            //Response.Redirect("~/hidegrid.aspx");  
        }  
          
        if (e.CommandName == "RowDblClickServer")  
        {  
            pnlSitesSecond.Visible = true;  
            RadGrid radGrid = (RadGrid)pnlSiteGrid.FindControl("Sites");  
            if (radGrid != null)  
                radGrid.Visible = false;  
            tblSiteSearch.Visible = false;  
 
            //Response.Redirect("~/hidegrid.aspx");  
 
        }  
         
 
     }  
     
 
      
 
    public GridBoundColumn CreateColumn(string column)  
    {  
 
        GridBoundColumn boundColumn = new GridBoundColumn();  
        boundColumn.DataField = column;  
        boundColumn.HeaderText = column;  
 
        return boundColumn;  
    }  
 
 
    public RadGrid CreateGrid(ArrayList dataSource, ArrayList columns)  
    {  
        RadGrid RadGrid1 = new RadGrid();  
 
        RadGrid1.ID = "RadGrid1";  
        RadGrid1.DataSourceID = dataSource[0].ToString();  
 
        RadGrid1.MasterTableView.DataKeyNames = new string[] { columns[0].ToString() };  
 
        RadGrid1.Skin = "Outlook";  
 
        RadGrid1.Width = Unit.Percentage(100);  
        // RadGrid1.PageSize = 3;  
        RadGrid1.AllowPaging = true;  
        RadGrid1.AllowSorting = true;  
        // RadGrid1.AllowFilteringByColumn = true;  
 
        RadGrid1.PagerStyle.Mode = GridPagerMode.NumericPages;  
        RadGrid1.AutoGenerateColumns = false;  
        RadGrid1.ShowStatusBar = true;  
 
        RadGrid1.MasterTableView.PageSize = 18;  
 
        int count = columns.Capacity;  
        foreach (string col in columns)  
        {  
            RadGrid1.MasterTableView.Columns.Add(CreateColumn(col));  
 
        }  
 
        return RadGrid1;  
    }  
    protected void Button1_Click(object sender, EventArgs e)  
    {  
        pnlSitesSecond.Visible = false;  
        RadGrid radGrid = (RadGrid)pnlSiteGrid.FindControl("Sites");  
        if (radGrid != null)  
            radGrid.Visible = true;  
        tblSiteSearch.Visible = true;  
    }  

regards
sathies
0
Daniel
Telerik team
answered on 26 Mar 2009, 01:34 PM
Hello Sathies,

We don't recommend you use RowClick and RowDblClick events simultaneously because of the browser behavior issues.

Instead of this I suggest you use the left and right button of your mouse to perform different tasks.

Best regards,
Daniel
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
sathies
Top achievements
Rank 1
Answers by
Daniel
Telerik team
sathies
Top achievements
Rank 1
Share this question
or