Hi,
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.
regards
sathies
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.
<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"> |
<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%"> |
|
<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