or
I have a https site, use radwindow to open another window on the same https site.
On the main window I have the below code.
function Sel_OnClientClose(sender, eventArgs) {
top.location.href = top.location.href;
}
<
telerik:RadWindowManager
ID
=
"radWindowManager"
runat
=
"server"
IconUrl
=
"/img/radwindowicon.gif"
Style
=
"z-index: 7001"
>
<
Windows
>
<
telerik:RadWindow
ID
=
"wndSelectAccount"
runat
=
"server"
Modal
=
"true"
KeepInScreenBounds
=
"true"
height
=
"450px"
Width
=
"700px"
Animation
=
"Fade"
AutoSizeBehaviors
=
"Default"
ShowContentDuringLoad
=
"true"
VisibleStatusbar
=
"false"
NavigateUrl
=
"/SelectAccount.aspx"
OnClientClose
=
"Sel_OnClientClose"
/>
</
Windows
>
</
telerik:RadWindowManager
>
<telerik:RadCaptcha ID="CaptchaImage" runat="server" ErrorMessage="Entered code as displayed" CaptchaTextBoxLabel="" />
<
div
id
=
"ctl00_cph_cnt_CaptchaImage"
class
=
"RadCaptcha RadCaptcha_Default"
>
<!-- 2011.2.915.40 -->
<
span
id
=
"ctl00_cph_cnt_CaptchaImage_ctl00"
style
=
"color:Red;visibility:hidden;"
>Entered code as displayed</
span
><
div
id
=
"ctl00_cph_cnt_CaptchaImage_SpamProtectorPanel"
>
<
img
id
=
"ctl00_cph_cnt_CaptchaImage_CaptchaImage"
alt
=
""
src
=
"Telerik.Web.UI.WebResource.axd?type=rca&guid=a4dfd827-ddb3-4dd6-b837-01385b3dc115"
style
=
"height:50px;width:180px;border-width:0px;display:block;"
/><
p
><
input
name
=
"ctl00$cph_cnt$CaptchaImage$CaptchaTextBox"
type
=
"text"
maxlength
=
"5"
id
=
"ctl00_cph_cnt_CaptchaImage_CaptchaTextBox"
title
=
""
/><
label
for
=
"ctl00_cph_cnt_CaptchaImage_CaptchaTextBox"
id
=
"ctl00_cph_cnt_CaptchaImage_CaptchaTextBoxLabel"
></
label
></
p
>
</
div
><
input
id
=
"ctl00_cph_cnt_CaptchaImage_ClientState"
name
=
"ctl00_cph_cnt_CaptchaImage_ClientState"
type
=
"hidden"
/>
</
div
>
<
httpHandlers
>
<
add
path
=
"Telerik.Web.UI.WebResource.axd"
verb
=
"*"
type
=
"Telerik.Web.UI.WebResource, Telerik.Web.UI"
validate
=
"false"
/>
</
httpHandlers
>
<
telerik:RadToolBar
ID
=
"RadToolBar1"
runat
=
"server"
OnClientButtonClicking
=
"onToolBarClientButtonClicking"
OnButtonClick
=
"RadToolBar1_ButtonClick"
Width
=
"100%"
>
<
Items
>
<
telerik:RadToolBarButton
Text="<%$ Resources:FormName, Addnew %>" CommandName="InitInsert"
ImageUrl="../../images/AddRecord.gif" Visible='<%# !RadGrid1.MasterTableView.IsItemInserted %>'>
</
telerik:RadToolBarButton
>
<
telerik:RadToolBarButton
Text="<%$ Resources:FormName, Filter %>" CommandName="Filter"
ImageUrl="../../images/Filter 3.gif">
</
telerik:RadToolBarButton
>
<
telerik:RadToolBarButton
Text="<%$ Resources:FormName, Refresh %>" CommandName="RebindGrid"
ImageUrl="../../images/Refresh.gif">
</
telerik:RadToolBarButton
>
<
telerik:RadToolBarButton
runat
=
"server"
Value
=
"HeaderDisplay"
>
<
ItemTemplate
>
<
table
>
<
tr
>
<
td
align
=
"right"
>
<
telerik:RadComboBox
runat
=
"server"
ID
=
"DeleteOption"
OnSelectedIndexChanged
=
"DeleteOption_SelectedIndexChanged"
AutoPostBack
=
"true"
AppendDataBoundItems
=
"true"
>
<
Items
>
<
telerik:RadComboBoxItem
runat
=
"server"
Text
=
"All"
Value
=
"All"
/>
<
telerik:RadComboBoxItem
runat
=
"server"
Text
=
"Deleted"
Value
=
"Deleted"
/>
<
telerik:RadComboBoxItem
runat
=
"server"
Text
=
"Not Deleted"
Value
=
"Not Deleted"
/>
</
Items
>
</
telerik:RadComboBox
>
</
td
>
</
tr
>
</
table
>
</
ItemTemplate
>
</
telerik:RadToolBarButton
>
</
Items
>
</
telerik:RadToolBar
>
protected void DeleteOption_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
{
GridCommandItem commandItem = RadGrid1.MasterTableView.GetItems(GridItemType.CommandItem)[0] as GridCommandItem;
RadToolBar toolBar = commandItem.FindControl("RadToolBar1") as RadToolBar;
RadToolBarItem textItem = toolBar.FindItemByValue("HeaderDisplay");
RadComboBox Comobovalue = (RadComboBox)textItem.FindControl("DeleteOption");
var DeleteOption = Comobovalue.SelectedValue;
if (DeleteOption == "All")
{
using (var db = new DoskContractServicesDataContext(Globals.strCon))
{
var result = (from a in db.DSProjectMasters
join b in db.dsdatamasters
on a.ClientCode equals b.clientcode into Lcat
from Lclien in Lcat.DefaultIfEmpty()
join c in db.dsdatamasters
on a.MainContractor equals c.clientcode into Lmain
from Lmaincon in Lmain.DefaultIfEmpty()
select new
{
a.ProjectID,a.ProjectTitle,a.Duration,a.DtCommencement,a.DtCompletion,a.EstimateDistance,a.ContractAmount,a.ProjectCode,
Lclien.clientname,maincon = Lmaincon.clientname
}).ToList();
RadGrid1.DataSource = result;
RadGrid1.Rebind();
Comobovalue.Text = "All";
}
}
else if (DeleteOption == "Deleted")
{
using (var db = new DoskContractServicesDataContext(Globals.strCon))
{
var result = (from a in db.DSProjectMasters
join b in db.dsdatamasters
on a.ClientCode equals b.clientcode into Lcat
from Lclien in Lcat.DefaultIfEmpty()
join c in db.dsdatamasters
on a.MainContractor equals c.clientcode into Lmain
from Lmaincon in Lmain.DefaultIfEmpty()
where a.Status == "DEL"
select new
{
a.ProjectID,a.ProjectTitle,a.Duration,a.DtCommencement,a.DtCompletion,a.EstimateDistance,a.ContractAmount,a.ProjectCode,Lclien.clientname,
maincon = Lmaincon.clientname
}).ToList();
RadGrid1.DataSource = result;
RadGrid1.Rebind();
Comobovalue.Text = "Deleted";
}
}
else if (DeleteOption == "Not Deleted")
{
using (var db = new DoskContractServicesDataContext(Globals.strCon))
{
var result = (from a in db.DSProjectMasters
join b in db.dsdatamasters
on a.ClientCode equals b.clientcode into Lcat
from Lclien in Lcat.DefaultIfEmpty()
join c in db.dsdatamasters
on a.MainContractor equals c.clientcode into Lmain
from Lmaincon in Lmain.DefaultIfEmpty()
where a.Status != "DEL"
select new
{
a.ProjectID,a.ProjectTitle,a.Duration,a.DtCommencement,a.DtCompletion,a.EstimateDistance,a.ContractAmount,
a.ProjectCode,Lclien.clientname,maincon = Lmaincon.clientname
}).ToList();
RadGrid1.DataSource = result;
RadGrid1.Rebind();
Comobovalue.Text = "Not Deleted";
}
}
}
var master = $find(gridID).get_masterTableView(); master.fireCommand("InitInsert", "");2. New empty row appears and I enter all data and press Save button. On server side I handle ItemCommand event like this:
case PerformInsertCommandName: GridEditableItem newItem = MasterTableView.GetInsertItem(); Dictionary<string, object> newValues = new Dictionary<string, object>(); newItem.ExtractValues(newValues); break;and newValues always contain empty values. I try to find controls directly like
WebControl ctl = newItem.FindControl<WebControl>(c => c is IZSheetControl);but control's value is always null anyway. Have I missed anything?
public class ZTextBox : TextBox, IScriptControl, IZSheetControl { private ScriptManager sm; public ZTextBox(ZSheetItem item) { Item = item; } #region IZSheetControl public ZSheetItem Item { get; set; } public object Value { get { return Text; } set { Text = value == null ? string.Empty : value.ToString(); } } public int MinWidth { get { return 120; } } #endregion #region IScriptControl IEnumerable<ScriptReference> IScriptControl.GetScriptReferences() { ScriptReference reference = new ScriptReference { Assembly = "UpeWeb.ASPNET.UI", Name = "UpeWeb.ASPNET.UI.Scripts.ZTextBox.js", #if DEBUG ScriptMode = ScriptMode.Debug, #else ScriptMode = ScriptMode.Release, #endif }; yield return reference; } IEnumerable<ScriptDescriptor> IScriptControl.GetScriptDescriptors() { var control = new ScriptControlDescriptor("UpeWeb.ASPNET.UI.Controls.ZTextBox", ClientID); control.AddProperty("text", Text); yield return control; } #endregion protected override void OnPreRender(EventArgs e) { if (!DesignMode) { sm = ScriptManager.GetCurrent(Page); if (sm == null) throw new HttpException("A ScriptManager control must exist on the current page."); sm.RegisterScriptControl(this); } base.OnPreRender(e); } protected override void Render(HtmlTextWriter writer) { if (!DesignMode) sm.RegisterScriptDescriptors(this); base.Render(writer); } }