I have a form in which i am using dataGrid to acess the data from the database.
Now on clicking the button a new Detailview page is open in which i want to retrieve value according to the button in which click.
My Default.aspx coding is
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<link href="StyleSheet.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" language="javascript">
function OpenPopUp()
{
window.showModalDialog("child.aspx", ' ', 'dialogHeight:10;
dialogWidth: 300px; dialogTop: 125px; dialogLeft: 100px; edge: Raised;
center: Yes; resizable: No; status: Yes;');
}
</script>
</head>
<body>
<form id="form1" runat="server">
<telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
<telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />
<telerik:RadGrid ID="RadGrid1" runat="server"
AllowFilteringByColumn="True"
OnNeedDataSource="RadGrid1_NeedDataSource" GridLines="None"
Height="750px" AllowSorting="True" PageSize="8" AllowPaging="True">
<MasterTableView AllowMultiColumnSorting="True" AutoGenerateColumns="False">
<Columns>
<telerik:GridBoundColumn UniqueName="CITY_CODE" DataField="CITY_CODE" HeaderText="City Code" >
<HeaderStyle Width="200px" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="NAME" DataField="NAME" HeaderText="Hotel Name" >
<HeaderStyle Width="200px" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="ADDRESS_3" DataField="ADDRESS_3" HeaderText="City" >
<HeaderStyle Width="200px" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="PHONE" DataField="PHONE" HeaderText="Phone Number" >
<HeaderStyle Width="200px" />
</telerik:GridBoundColumn>
</Columns>
<ItemTemplate>
<%# (((GridItem)Container).ItemIndex != 0) ?
"</td></tr></table>" :
"</td></tr></table>"%>
<asp:Panel ID="ItemContainer" CssClass='<%#
(((GridItem)Container).ItemType == GridItemType.Item)? "item" :
"alternatingItem" %>'
runat="server" Width="326px" Height="122px">
<asp:Label ID="titleLabel" runat="server" Text="City Code:"
Font-Bold="true" style="float:left;width:30%;text-align:right"/>
<asp:Label ID="lblCityCode" runat="server" Text='<%# Eval("CITY_CODE") %>'/><br />
<asp:Label ID="Label6" runat="server" Text="Hotel Name:"
Font-Bold="true" style="float:left;width:30%;text-align:right"/>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("NAME") %>'/><br />
<asp:Label ID="Label7" runat="server" Text="Address:"
Font-Bold="true"
style="float:left;width:30%;text-align:right"/>
<asp:Label ID="lblAddress"
runat="server" Text='<%# Eval("ADDRESS_1")+ ", " %>' /><br
/>
<asp:Label ID="Label8" runat="server"
style="float:left;width:30%;text-align:right"/>
<asp:Label ID="lblAddress2"
runat="server" Text='<%# Eval("ADDRESS_2")+ ", " %>' /><br
/>
<asp:Label ID="Label9" runat="server" style="float:left;width:30%;text-align:right"/>
<asp:Label ID="Label4" runat="server" Text='<%# Eval("ADDRESS_3")+ ", " %>' /><br />
<asp:Label ID="Label10" runat="server" style="float:left;width:30%;text-align:right"/>
<asp:Label ID="Label5" runat="server" Text='<%# Eval("ADDRESS_4") %>' /><br />
<asp:Label ID="Label11" runat="server" Text="Phone Number:"
Font-Bold="true" style="float:left;width:30%;text-align:right"/>
<asp:Label ID="Label2" runat="server" Text='<%# Eval("PHONE") %>'/><br />
<asp:Label ID="Label12" runat="server" Text="Fax:" Font-Bold="true"
style="float:left;width:30%;text-align:right"/>
<asp:Label ID="Label3" runat="server" Text='<%# Eval("FAX") %>'/>
<br />
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
</telerik:RadWindowManager>
<button style="width: 40px; margin-bottom: 3px;"
onclick="OpenPopUp()">More</button><br style="clear:both"
/><br style="clear:both" />
</asp:Panel>
</ItemTemplate>
</MasterTableView>
<GroupingSettings CaseSensitive="False" />
</telerik:RadGrid>
</form>
</body>
</html>
default.aspx.cs is
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection sqlConnection = new SqlConnection("Data Source =
DELLVOSTRO; Initial Catalog = ALPHA; User Id= sa; Password= intransit");
string selectString = "SELECT CITY_CODE,NAME,PHONE,ADDRESS_1,ADDRESS_2,ADDRESS_3,ADDRESS_4,FAX " + "FROM HOTELS ";
SqlDataAdapter dataAdapter = new SqlDataAdapter(selectString, sqlConnection);
DataTable table = new DataTable();
dataAdapter.Fill(table);
RadGrid1.DataSource = table;
RadGrid1.DataBind();
}
child.aspxis
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="child.aspx.cs" Inherits="child" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Message Deatils</title>
</head>
<body>
<script type="text/javascript">
function GetRadWindow()
{
var oWindow = null;
if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;//IE (and Moz as well)
return oWindow;
}
function CloseWnd()
{
GetRadWindow().close();
}
function OnClientLoad(sender,args)
{
window.setTimeout(function()
{
sender.set_mode(2);
sender.set_mode(1);
}, 0);
}
</script>
<form id="form1" runat="server">
<telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
<telerik:RadSkinManager ID="RadSkinManager" runat="server" Skin="Outlook">
</telerik:RadSkinManager>
<telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" />
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server"
LoadingPanelID="RadLoadingPanel1">
<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" Width="33%"
CellPadding="0" Height="100%" GridLines="None" OnPageIndexChanging="DetailsView1_PageIndexChanging">
<Fields>
<asp:BoundField DataField="CITY_CODE" HeaderText="City Code:" SortExpression="CITY_CODE" >
<HeaderStyle Width="30%" />
</asp:BoundField>
<asp:BoundField DataField="NAME" HeaderText="Hotel Name:" SortExpression="NAME" />
<asp:BoundField DataField="ADDRESS_1" HeaderText="ADDRESS:" SortExpression="NAME" />
<asp:BoundField DataField="ADDRESS_2" SortExpression="NAME" />
<asp:BoundField DataField="ADDRESS_3" SortExpression="NAME" />
<asp:BoundField DataField="ADDRESS_4" SortExpression="NAME" />
<asp:BoundField DataField="PHONE" HeaderText="Phone Number" SortExpression="NAME" />
<asp:BoundField DataField="FAX" HeaderText="Fax" SortExpression="NAME" />
</Fields>
</asp:DetailsView>
<div style="text-align: right; margin-top:8px;">
</div>
</telerik:RadAjaxPanel>
<telerik:RadAjaxLoadingPanel ID="RadLoadingPanel1" runat="server" >
</telerik:RadAjaxLoadingPanel>
</form>
</body>
</html>
child.aspx.cs is
public partial class child : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection sqlConnection = new SqlConnection("Data Source =
DELLVOSTRO; Initial Catalog = ALPHA; User Id= sa; Password= intransit");
string selectString = "SELECT
CITY_CODE,NAME,PHONE,ADDRESS_1,ADDRESS_2,ADDRESS_3,ADDRESS_4,FAX " +
"FROM HOTELS "+ "Where FAX = '"+label3.text+"'";
SqlDataAdapter dataAdapter = new SqlDataAdapter(selectString, sqlConnection);
DataTable table = new DataTable();
dataAdapter.Fill(table);
DetailsView1.DataSource = table;
DetailsView1.DataBind();
}
protected void DetailsView1_PageIndexChanging(object sender, DetailsViewPageEventArgs e)
{
}
}


The comboBox is:<telerik:RadComboBox ID="rcbProva" runat="server" EmptyMessage="Seleziona..." EnableLoadOnDemand="true" OnItemsRequested="rcbProva_ItemsRequested"></telerik:RadComboBox>| <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1"> |
| <AjaxSettings> |
| <telerik:AjaxSetting AjaxControlID="Tabs1"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="Tabs1" /> |
| <telerik:AjaxUpdatedControl ControlID="Pages" LoadingPanelID="LoadingPanel" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| <telerik:AjaxSetting AjaxControlID="Pages"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="Pages" LoadingPanelID="LoadingPanel" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| </AjaxSettings> |
| </telerik:RadAjaxManager> |
| protected void Page_Load(object sender, EventArgs e) |
| { |
| if (!Page.IsPostBack) |
| { |
| AddTab("Vista en Arbol"); |
| AddPageView(Tabs1.FindTabByText("Vista en Arbol")); |
| AddTab("Vista en Tabla"); |
| } |
| } |
| private void AddTab(string tabName) |
| { |
| RadTab tab = new RadTab(); |
| tab.Text = tabName; |
| Tabs1.Tabs.Add(tab); |
| } |
| private void AddPageView(RadTab tab) |
| { |
| RadPageView pageView = new RadPageView(); |
| pageView.ID = tab.Text; |
| Pages.PageViews.Add(pageView); |
| tab.PageViewID = pageView.ID; |
| } |
| protected void Tabs1_TabClick(object sender, RadTabStripEventArgs e) |
| { |
| AddPageView(e.Tab); |
| e.Tab.PageView.Selected = true; |
| } |
| protected void Pages_PageViewCreated(object sender, RadMultiPageEventArgs e) |
| { |
| string userControlName=""; |
| if (e.PageView.ID == "Vista en Arbol") |
| { |
| userControlName ="~/visitas/conexionesAJAX.ascx"; |
| } |
| else if (e.PageView.ID == "Vista en Tabla") |
| { |
| userControlName ="~/visitas/conexionesGRID.ascx"; |
| } |
| Control userControl = Page.LoadControl(userControlName); |
| userControl.ID = e.PageView.ID + "_userControl"; |
| e.PageView.Controls.Add(userControl); |
| } |
We have a need to fire a spell check before an email gets sent out. The idea being, user clicks “Send” and once the spellcheck is complete, it would send without further interaction. This works with the following script very well. The only issue we have is that is distinguishing between whether the user clicked on “Cancel” on the spellchecker in RadEditor or the spell check completed. When the user clicks Cancel, we don’t want to send the email.
Is there any way to know what condition fired the function attached to add_spellCheckEnd ? Or an alternative method?
<script type="text/javascript">
function SpellCheckAndSubmit() {
var editor = $find("<%=textEdit.RadEditorClientID%>");
var sendButton = document.getElementById("<%=btnSendEmail.ClientID%>");
editor.fire("AjaxSpellCheck");
setTimeout(function() {
var spell = editor.get_ajaxSpellCheck();
spell.add_spellCheckEnd(function(sender, args) {
//if Cancelled Button Hit
//Do nothing
//else
//Do Event
sendButton.click();
});
}, 100);
return false;
}
</script>
Any help you can provide would be appreciated.
Thanks
Martin Cheverall