Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
145 views
Dear,
i have radajaxmanger in masterpage and radajaxManagerProxy in content page.
Is possible to do the same like your sample :
http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandwindow/defaultcs.aspx?product=window

Thanks.
Giovanni
Marin Bratanov
Telerik team
 answered on 07 Feb 2013
1 answer
197 views
Hi,
I'm working with radgrid to insert and edit data.Insert delete command working fine.But update command is not firing.Please help me to solve this.


<%@ Page Title="" Language="C#" MasterPageFile="~/Development/MasterPageHome.master" AutoEventWireup="true" CodeFile="SuperAnnuationFundMaster.aspx.cs" Inherits="Development_SuperAnnuationFundMaster" %>
 
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<style type="text/css">
 
.style2
{
width: 686px;
height: 22px;
}
.style3
{
width: 686px;
height: 14px;
}
</style>
 
 
<script type="text/JavaScript">
<!--
window.onload = function () {
 
 
document.getElementById('ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl02_ctl02_SPIN_1TextBox').disabled = true;
 
};
// -->
</script>
 
 
 
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<table align="left" style="width: 100%">
<tr>
<td align="left" class="style2" valign="top">
<asp:Label ID="Label2" runat="server"
Font-Size="13pt" Font-Names="Tahoma" Font-Bold="True"
Font-Underline="False" ForeColor="#404040">Superannuation Fund Setup</asp:Label>
</td>
<td align="left" class="style2">
 </td>
</tr>
<tr>
<td align="left" class="style3" valign="top">
<asp:Label ID="Label11" runat="server" Font-Names="Tahoma"
Font-Size="10pt"></asp:Label>
<asp:Label ID="Label3" runat="server"></asp:Label>
</td>
<td align="left" class="style3">
 </td>
</tr>
<tr>
<td align="left" style="width: 686px" valign="top" colspan="2">
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True"
CellSpacing="0" GridLines="None" OnNeedDataSource="RadGrid1_NeedDataSource" Width="750px"
OnInsertCommand="RadGrid1_InsertCommand" OnItemCommand="RadGrid1_ItemCommand"
OnItemCreated="RadGrid1_ItemCreated" OnUpdateCommand="RadGrid1_UpdateCommand"
OnPreRender="RadGrid1_PreRender" AutoPostback="True" OnItemUpdated="RadGrid1_ItemUpdated"
OnDeleteCommand="RadGrid1_DeleteCommand" AllowPaging="True" AllowSorting="True"
OnEditCommand="RadGrid1_EditCommand" PageSize="30">
<ClientSettings>
<Selecting CellSelectionMode="None" AllowRowSelect="True"></Selecting>
</ClientSettings>
<MasterTableView AutoGenerateColumns="False" CommandItemDisplay="Top" DataKeyNames="Id"
ClientDataKeyNames="Id">
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
<RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
</RowIndicatorColumn>
<ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
</ExpandCollapseColumn>
<Columns>
<telerik:GridBoundColumn DataField="Id" Display="False" EditFormColumnIndex="1" FilterControlAltText="Filter Id column"
HeaderText="Id" UniqueName="Id" Visible="False">
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn DataField="SFund_Code" FilterControlAltText="Filter SFund_Code column"
HeaderText="Superannuation_Fund_Code" SortExpression="SFund_Code" UniqueName="SFund_Code">
<EditItemTemplate>
<table style="width: 100%">
<tr>
<td style="width: 5px; color: #FF0000;">
*
</td>
<td style="width: 179px">
<asp:TextBox ID="SFund_CodeTextBox" runat="server" Height="18px" Text='<%# Bind("SFund_Code") %>'
Width="168px" MaxLength="12"></asp:TextBox>
</td>
<td align="left" valign="top">
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="SFund_CodeTextBox"
ErrorMessage="!" SetFocusOnError="True" ToolTip="Required Field"></asp:RequiredFieldValidator>
</td>
</tr>
</table>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="SFund_CodeLabel" runat="server" Text='<%# Eval("SFund_Code") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="Fund_Name" FilterControlAltText="Filter Fund_Name column"
HeaderText="Fund_Name" SortExpression="Fund_Name" UniqueName="Fund_Name">
<EditItemTemplate>
<table style="width: 100%; height: 19px">
<tr>
<td style="width: 5px; color: #FF0000;">
*
</td>
<td style="width: 179px">
<asp:TextBox ID="Fund_NameTextBox" runat="server" Height="18px" Text='<%# Bind("Fund_Name") %>'
Width="168px" MaxLength="76"></asp:TextBox>
</td>
<td align="left" valign="top">
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="Fund_NameTextBox"
ErrorMessage="!" SetFocusOnError="True" ToolTip="Required Field"></asp:RequiredFieldValidator>
</td>
</tr>
</table>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Fund_NameLabel" runat="server" Text='<%# Eval("Fund_Name") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="Address_Line_1" FilterControlAltText="Filter Address_Line_1 column"
HeaderText="Address_Line_1" SortExpression="Address_Line_1" UniqueName="Address_Line_1">
<EditItemTemplate>
<table style="width: 100%; height: 19px">
<tr>
<td style="width: 5px; color: #FF0000;">
*
</td>
<td style="width: 179px">
<asp:TextBox ID="Address_Line_1TextBox" runat="server" Height="18px" Text='<%# Bind("Address_Line_1") %>'
Width="168px" MaxLength="38"></asp:TextBox>
</td>
<td align="left" valign="top">
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="Fund_NameTextBox"
ErrorMessage="!" SetFocusOnError="True" ToolTip="Required Field"></asp:RequiredFieldValidator>
</td>
</tr>
</table>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Address_Line_1Label" runat="server" Text='<%# Eval("Address_Line_1") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="Address_Line_2" FilterControlAltText="Filter Address_Line_2 column"
HeaderText="Address_Line_2" SortExpression="Address_Line_2" UniqueName="Address_Line_2"
Visible="False">
<EditItemTemplate>
<table style="width: 100%">
<tr>
<td style="width: 5px; color: #FF0000;">
   
</td>
<td style="width: 179px">
<asp:TextBox ID="Address_Line_2TextBox" runat="server" Height="18px" Text='<%# Bind("Address_Line_2") %>'
Width="168px" MaxLength="38"></asp:TextBox>
</td>
<td align="left" valign="top">
  
</td>
</tr>
</table>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Address_Line_2Label" runat="server" Text='<%# Eval("Address_Line_2") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="Suburb" FilterControlAltText="Filter Suburb column"
HeaderText="Suburb" SortExpression="Suburb" UniqueName="Suburb">
<EditItemTemplate>
<table style="width: 100%; height: 19px;">
<tr>
<td class="style7" style="color: #FF0000;">
*
</td>
<td class="style8">
<asp:TextBox ID="SuburbTextBox" runat="server" Height="18px" Text='<%# Bind("Suburb") %>'
Width="168px" MaxLength="27"></asp:TextBox>
</td>
<td align="left" class="style9" valign="top">
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="SuburbTextBox"
ErrorMessage="!" SetFocusOnError="True" ToolTip="Required Field"></asp:RequiredFieldValidator>
</td>
</tr>
</table>
</EditItemTemplate>
<ItemTemplate>
             
<asp:Label ID="SuburbLabel" runat="server" Text='<%# Eval("Suburb") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="State" FilterControlAltText="Filter State column"
HeaderText="State" SortExpression="State" UniqueName="State" Visible="False">
<EditItemTemplate>
<table style="width: 100%; height: 19px">
<tr>
<td class="style7" style="color: #FF0000;">
   
</td>
<td class="style8">
<telerik:RadComboBox ID="StateTextBox" runat="server" SelectedValue='<%# Bind("State") %>'
Width="174px">
<Items>
<telerik:RadComboBoxItem runat="server" Selected="True" />
<telerik:RadComboBoxItem runat="server" Text="ACT" Value="ACT" />
<telerik:RadComboBoxItem runat="server" Text="NSW" Value="NSW" />
<telerik:RadComboBoxItem runat="server" Text="NT" Value="NT" />
<telerik:RadComboBoxItem runat="server" Text="QLD" Value="QLD" />
<telerik:RadComboBoxItem runat="server" Text="SA" Value="SA" />
<telerik:RadComboBoxItem runat="server" Text="TAS" Value="TAS" />
<telerik:RadComboBoxItem runat="server" Text="VIC" Value="VIC" />
<telerik:RadComboBoxItem runat="server" Text="WA" Value="WA" />
</Items>
</telerik:RadComboBox>
</td>
<td align="left" class="style9" valign="top">
  
</td>
</tr>
</table>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="StateLabel" runat="server" Text='<%# Eval("State") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="Postcode" DataType="System.Int32" FilterControlAltText="Filter Postcode column"
HeaderText="Postcode" SortExpression="Postcode" UniqueName="Postcode" Visible="False">
<EditItemTemplate>
<table style="width: 100%; height: 19px">
<tr>
<td class="style7" style="color: #FF0000;">
*
</td>
<td class="style8">
<asp:TextBox ID="PostcodeTextBox" runat="server" Height="18px" Text='<%# Bind("Postcode") %>'
Width="168px" MaxLength="4"></asp:TextBox>
</td>
<td align="left" class="style9" valign="top">
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="PostcodeTextBox"
ErrorMessage="!" SetFocusOnError="True" ToolTip="Required Field"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="PostcodeTextBox"
ErrorMessage="!" ToolTip="Invalid Characters" ValidationExpression="[0-9]+"></asp:RegularExpressionValidator>
</td>
</tr>
</table>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="PostcodeLabel" runat="server" Text='<%# Eval("Postcode") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="Country" FilterControlAltText="Filter Country column"
HeaderText="Country" SortExpression="Country" UniqueName="Country" Visible="False">
<EditItemTemplate>
<table style="width: 100%; height: 19px">
<tr>
<td class="style7" style="color: #FF0000;">
   
</td>
<td class="style8">
<asp:TextBox ID="CountryTextBox" runat="server" Height="18px" Text='<%# Bind("Country") %>'
Width="168px" MaxLength="20"></asp:TextBox>
</td>
<td align="left" class="style9" valign="top">
</td>
</tr>
</table>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="CountryLabel" runat="server" Text='<%# Eval("Country") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="Telephone" FilterControlAltText="Filter Telephone column"
HeaderText="Telephone" SortExpression="Telephone" UniqueName="Telephone">
<EditItemTemplate>
<table style="width: 100%; height: 19px">
<tr>
<td class="style7" style="color: #FF0000;">
   
</td>
<td class="style8">
<telerik:RadMaskedTextBox ID="TelephoneTextBox" runat="server" EnableSingleInputRendering="True"
LabelWidth="64px" Mask="(###) ###-####" Text='<%# Bind("Telephone") %>' TextWithLiterals="() -"
Width="174px" SelectionOnFocus="CaretToBeginning">
</telerik:RadMaskedTextBox>
</td>
<td align="left" class="style9" valign="top">
</td>
</tr>
</table>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="TelephoneLabel" runat="server" Text='<%# Eval("Telephone") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="Email" FilterControlAltText="Filter Email column"
HeaderText="Email" SortExpression="Email" UniqueName="Email" EditFormColumnIndex="1">
<EditItemTemplate>
<table style="width: 100%; height: 19px">
<tr>
<td class="style7" style="color: #FF0000;">
   
</td>
<td class="style8">
<asp:TextBox ID="EmailTextBox" runat="server" Height="18px" Text='<%# Bind("Email") %>'
Width="168px" MaxLength="60"></asp:TextBox>
</td>
<td align="left" class="style9" valign="top">
<asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="EmailTextBox"
ErrorMessage="!" ToolTip="Invalid Email Address" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
</td>
</tr>
</table>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="EmailLabel" runat="server" Text='<%# Eval("Email") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="Website" FilterControlAltText="Filter Website column"
HeaderText="Website" SortExpression="Website" UniqueName="Website" Visible="False"
EditFormColumnIndex="1">
<EditItemTemplate>
<table style="width: 100%; height: 19px">
<tr>
<td class="style7" style="color: #FF0000;">
   
</td>
<td class="style8">
<asp:TextBox ID="WebsiteTextBox" runat="server" Height="18px" Text='<%# Bind("Website") %>'
Width="168px" MaxLength="80"></asp:TextBox>
</td>
<td align="left" class="style9" valign="top">
  
</td>
</tr>
</table>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="WebsiteLabel" runat="server" Text='<%# Eval("Website") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="ABN" FilterControlAltText="Filter ABN column"
HeaderText="ABN" SortExpression="ABN" UniqueName="ABN" EditFormColumnIndex="1">
<EditItemTemplate>
<table style="width: 100%; height: 19px">
<tr>
<td class="style7" style="color: #FF0000;">
*
</td>
<td class="style8">
<telerik:RadMaskedTextBox ID="ABNTextBox" runat="server" EnableSingleInputRendering="True"
LabelWidth="64px" Mask="###########" Text='<%# Bind("ABN") %>' Width="174px"
SelectionOnFocus="CaretToBeginning">
</telerik:RadMaskedTextBox>
</td>
<td align="left" class="style9" valign="top">
<asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="ABNTextBox"
ErrorMessage="!" SetFocusOnError="True" ToolTip="Required Field"></asp:RequiredFieldValidator>
</td>
</tr>
</table>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="ABNLabel" runat="server" Text='<%# Eval("ABN") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="SMSF" DataType="System.Boolean" FilterControlAltText="Filter SMSF column"
HeaderText="SMSF" SortExpression="SMSF" UniqueName="SMSF" Visible="False" EditFormColumnIndex="1"
DefaultInsertValue="false">
<EditItemTemplate>
   
<script language="javascript" type="text/javascript">
 
 
 
function checkk(oSrouce, args) {
 
var c = document.getElementById('ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl02_ctl02_CheckBox1');
 
if (c.checked) {
 
var spin = document.getElementById('ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl02_ctl02_SPIN_1TextBox').disabled = false;
document.getElementById('ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl02_ctl02_SPIN_1TextBox').focus();
var AccountNo = document.getElementById('ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl02_ctl02_Account_NoTextBox').value;
 
if (!AccountNo.match(/\S/))
 
args.IsValid = false;
 
else
 
args.IsValid = true;
 
 
 
return true;
 
}
 
 
else {
document.getElementById('ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl02_ctl02_SPIN_1TextBox').disabled = true;
return false;
}
 
 
 
 
}
 
 
function ValidateCheckBox(sender, args) {
if (document.getElementById('ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl02_ctl02_CheckBox1').checked == true) {
 
var AccountNo = document.getElementById('ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl02_ctl02_Account_NoTextBox').value;
 
 
if (!AccountNo.match(/\S/))
 
args.IsValid = false;
 
else
 
args.IsValid = true;
 
 
 
}
 
else {
args.IsValid = true;
}
}
 
 
</script>
<asp:CheckBox ID="CheckBox1" runat="server" onchange="checkk()" Checked='<%# Bind("SMSF") %>' />
<br />
</EditItemTemplate>
<ItemTemplate>
   
<script language="javascript" type="text/javascript">
 
 
 
 
</script>
<asp:CheckBox ID="CheckBox2" runat="server" onchange="check" Checked='<%# Bind("SMSF") %>' />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="SPIN_1" FilterControlAltText="Filter SPIN_1 column"
HeaderText="SPIN" SortExpression="SPIN_1" UniqueName="SPIN_1" Visible="False"
EditFormColumnIndex="1">
<EditItemTemplate>
<table style="width: 100%; height: 0px">
<tr>
<td style="color: #FF0000;" class="style4">
   
</td>
<td class="style5">
<telerik:RadMaskedTextBox ID="SPIN_1TextBox" runat="server" EnableSingleInputRendering="True"
LabelWidth="64px" Mask="LLL####LL" PromptChar="#" Text='<%# Bind("SPIN_1") %>'
Width="174px" SelectionOnFocus="CaretToBeginning">
</telerik:RadMaskedTextBox>
</td>
<td align="left" valign="top" class="style6">
</td>
</tr>
</table>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="SPIN_1Label" runat="server" Text='<%# Eval("SPIN_1") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="Account_No" FilterControlAltText="Filter BSB_1 column"
HeaderText="Account_No" SortExpression="Account_No" UniqueName="Account_No" Visible="False"
EditFormColumnIndex="1">
<EditItemTemplate>
<table style="width: 100%; height: 19px">
<tr>
<td class="style7" style="color: #FF0000;">
   
</td>
<td class="style8">
<asp:TextBox ID="Account_NoTextBox" runat="server" Height="18px" Text='<%# Bind("ABN") %>'
Width="168px" MaxLength="9"></asp:TextBox>
<asp:CustomValidator ID="CustomValidator2" runat="server" ClientValidationFunction="ValidateCheckBox"
ErrorMessage="!" ToolTip="Mandotory If SMSF tickbox is seton"></asp:CustomValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator19" runat="server"
ControlToValidate="Account_NoTextBox" ErrorMessage="!" ToolTip="Invalid Characters"
ValidationExpression="[0-9]+"></asp:RegularExpressionValidator>
</td>
<td align="left" class="style9" valign="top">
  
</td>
</tr>
</table>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Account_NoLabel" runat="server" Text='<%# Eval("Account_No") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="BSB_1" FilterControlAltText="Filter Account_No column"
HeaderText="BSB" SortExpression="Account_No" UniqueName="BSB_1" Visible="False"
DataType="System.Int32" EditFormColumnIndex="1">
<EditItemTemplate>
<table style="width: 100%; height: 0px">
<tr>
<td class="style4" style="color: #FF0000;">
   
</td>
<td class="style5">
<telerik:RadMaskedTextBox ID="BSB_1TextBox" runat="server" EnableSingleInputRendering="True"
LabelWidth="64px" Mask="###-###" PromptChar="#" Text='<%# Bind("BSB_1") %>' Width="174px"
SelectionOnFocus="CaretToBeginning">
</telerik:RadMaskedTextBox>
</td>
<td align="left" class="style6" valign="top">
</td>
</tr>
</table>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="BSB_1Label" runat="server" Text='<%# Eval("BSB_1") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="Account_Name" FilterControlAltText="Filter Account_Name column"
HeaderText="Account_Name" SortExpression="Account_Name" UniqueName="Account_Name"
Visible="False" EditFormColumnIndex="1">
<EditItemTemplate>
<table style="width: 100%; height: 19px">
<tr>
<td class="style7" style="color: #FF0000;">
   
</td>
<td class="style8">
<asp:TextBox ID="Account_Nametxtbx" runat="server" Height="18px" Text='<%# Bind("Account_Name") %>'
Width="168px" MaxLength="32"></asp:TextBox>
<asp:CustomValidator ID="CustomValidator1" runat="server" ClientValidationFunction="ValidateCheckBox"
ErrorMessage="!" ToolTip="Mandotory If SMSF tickbox is seton"></asp:CustomValidator>
</td>
<td align="left" class="style9" valign="top">
</td>
</tr>
</table>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="BPAY_Biller_CodeLabel" runat="server" Text='<%# Eval("Account_Name") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
<EditFormSettings ColumnNumber="3">
<EditColumn FilterControlAltText="Filter EditCommandColumn column">
</EditColumn>
</EditFormSettings>
</MasterTableView>
<FilterMenu EnableImageSprites="False">
</FilterMenu>
</telerik:RadGrid>
</td>
</tr>
<tr>
<td style="width: 686px" colspan="2">
 </td>
</tr>
<tr>
<td style="width: 686px" colspan="2">
 </td>
</tr>
<tr>
<td style="width: 686px" colspan="2">
 </td>
</tr>
</table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="contentRightpanel" Runat="Server">
</asp:Content>
Kostadin
Telerik team
 answered on 07 Feb 2013
17 answers
1.7K+ views
Hello,

I have several grids on a page. This page is wrapped with an iframe with a height of 593px. All of the content renders beyond the height of the iframe, giving me a scroll-bar to see all of the data. When I edit a line item in the grid that's at the very bottom of the frame and it shows the RadWindow, it immediately scrolls back to the very top of the frame and I have to scroll down just to see my window again.

My question is: is there some kind of setting I can apply when that window opens so that it doesn't move back to the top of the frame? My ASP.NET AJAX version is 2009.3.1314.35.

Thanks in advance!

*EDIT* Just for better reference, I am using a RadWindowManager to manage multiple windows. There are a total of 3 grids on the page, all of which extend beyond the 593px height of the iframe. I have looked into using InitialBehaviors="Pin" for each RadWindow, which is fine because the window stays pinned, but upon opening the RadWindow, the iframe still resets itself to be scrolled to the very top.

*EDIT 2* I am using Firefox 3.6.16. I cannot recreate this issue in IE8
Marin Bratanov
Telerik team
 answered on 07 Feb 2013
5 answers
364 views

Below is my scenario:

Scenario:

1. I have one telerik:RadAjaxManager which has telerik:AjaxSettings. In it, AjaxControlID is a button Id and AjaxUpdatedControl is a table which contains that button along with few textboxes, requiredfieldvalidators for them and one server side button.

2. The button has onclientclick and onclick events registered.

3. Onclientclick event calls a simple javascript function which does some validation of form data and returns true or false. (OnClientClick="return ValidatePage();")

4. Onclick event calls some server side implementation.

 Behavior:

1. When a button is clicked,  requiredfieldvalidators (only checks if data is entered) gets fired.

2. When data is entered in the textboxes, javascript function 'ValidatePage()' (checks if VALID data is entered) gets fired.

3. When ValidatePage() returns false, server side event doesn't get fired.(Which is desired behavior)

4. When ValidatePage() returns true, still server side event doesn't get fired.(Which is not desired behavior)

5. When OnclientClick event registration is removed, the server side event gets fired through AJAX after entering data in the textboxes.

6. When button is moved out of the table, both, the javascript function and the server side event gets fired but normal postback occurs.

Desired behavior:

1. First requiredfieldvalidators should get fired.

2. Then 'ValidatePage()' should get fired. If it returns false, it should restrict server side call. If it returns true, server side event should get called through AJAX.

Please let me know if you have any comments on it.

Regards,

Shubha
Kostadin
Telerik team
 answered on 07 Feb 2013
3 answers
185 views

Hello,

When opening a RadWindow via .setUrl and .show(), two postbacks are envoked on the destination page, one for .setUrl and one for .show().

Is it possible to only cause one postback?

Below is sample code:

I cannot use navigateUrl of RadWindow because I need to pass querystring values.

I cannot use radopen() function because of styling issues.

RadWindowDoublePostback.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RadWindowDoublePostback.aspx.cs" Inherits="WebApplication1.RadWindowDoublePostback" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

<!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">

    <title></title>

</head>

<body>

    <form id="form1" runat="server">

    <div>

        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">

        </telerik:RadScriptManager>

        <asp:Button Text="ShowWindow" runat="server" ID="Button1" OnClientClick="showWindow(); return false;"/>

        <telerik:RadWindowManager ID="RadWindowManager1" runat="server">

            <Windows>

                <telerik:RadWindow ID="RadWindow1" runat="server" ReloadOnShow="true">

                </telerik:RadWindow>

            </Windows>

        </telerik:RadWindowManager>

        <script type="text/javascript">

            function showWindow() {

                //var oWnd = radopen("RadWindowCloseDialog.aspx", "RadWindow1");

                var oWnd = $find("<%= RadWindow1.ClientID %>");

                if (oWnd) {

                    oWnd.setUrl('<%= ResolveUrl("RadWindowDoublePostbackDiaolog.aspx") %>');

                    oWnd.show();

                }

            }

        </script>

    </div>

    </form>

</body>

</html>


RadWindowDoublePostbackDiaolog.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RadWindowDoublePostbackDiaolog.aspx.cs" Inherits="WebApplication1.RadWindowDoublePostbackDiaolog" %>

<!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">

    <title></title>

</head>

<body>

    <form id="form1" runat="server">

    <div>

        RadWindowDoublePostbackDiaolog

    </div>

    </form>

</body>

</html>

Is it possible to only cause one postback when I open the window?

Thanks!

Marin Bratanov
Telerik team
 answered on 07 Feb 2013
4 answers
160 views
Hey at Telerik

I have tried for hours now to show/hide columns depending on the selected index of an in a RadGrid imbedded RadComboBox.

The problem is that if i try to rebind in the SelectedIndexChanged event of the imbedded RadComboBox the Inserted Item is disposed.

If i don't rebind the visibility of the columns are not refreshed.

protected void rgvEgenskaber_PreRender(object sender, EventArgs e)
    {
        if (this.rgvEgenskaber.MasterTableView.IsItemInserted || this.rgvEgenskaber.EditItems.Count > 0)
        {
            GridEditableItem gridEditableItem = null;
            if (this.rgvEgenskaber.MasterTableView.IsItemInserted)
                gridEditableItem = this.rgvEgenskaber.MasterTableView.GetInsertItem();
            else
                gridEditableItem = this.rgvEgenskaber.EditItems[0] as GridEditableItem;
            DLDataContext dLDataContext = new DLDataContext();
            Egenskab egenskab = dLDataContext.Egenskabs.First(eg => eg.Egenskabid.Equals(Guid.Parse(((RadComboBox)((GridDataItem)gridEditableItem)["EgenskabID"].Controls[1]).SelectedValue)));
            //if (gridEditableItem.DataItem != null)
            //{
            this.rgvEgenskaber.MasterTableView.Columns.OfType<GridColumn>().Where(c => c.UniqueName.Equals("Valglistevaerdi") || c.UniqueName.Equals("Decimalvaerdi") || c.UniqueName.Equals("Heltalsvaerdi")).ToList().ForEach(c => c.Visible = false);
            switch (egenskab.Type)
            {
                case "H":
                    this.rgvEgenskaber.MasterTableView.GetColumn("Heltalsvaerdi").Visible = true;
                    break;
                case "D":
                    this.rgvEgenskaber.MasterTableView.GetColumn("Decimalvaerdi").Visible = true;
                    break;
                case "V":
                    this.rgvEgenskaber.MasterTableView.GetColumn("Valglistevaerdi").Visible = true;
                    break;
                default:
                    break;
            }
        }
    }
protected void rcbEgenskabID_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
    {
        this.rgvEgenskaber.MasterTableView.Rebind();
  }

 

protected void rgvEgenskaber_ItemCommand(object source, GridCommandEventArgs e)
    {
        switch (e.CommandName)
        {
            case RadGrid.InitInsertCommandName:
                e.Canceled = true;
                if (Request.QueryString["elementType"] != null && Request.QueryString["elementId"] != null)
                {
                    string elementType = Request.QueryString["elementType"];
                    string elementId = Request.QueryString["elementId"];
                    DLContext.DLDataContext dLDataContext = new DLDataContext();
                    Bestemmelse bestemmelse = dLDataContext.Bestemmelses.First(b => b.Bestemmelseid.Equals(Guid.Parse(elementId)));
                    Egenskab egenSkab = dLDataContext.Egenskabs.First();
                    Egenskabsforklaring egenskabsforklaring = dLDataContext.Egenskabsforklarings.First();
                    if (!e.Item.OwnerTableView.IsItemInserted)
                        e.Item.OwnerTableView.InsertItem(new Egenskabsvaerdi() { Egenskabsvaerdiid = Guid.NewGuid(),  Egenskab = egenSkab, Egenskabsforklaring = egenskabsforklaring, Bestemmelse = bestemmelse });
                }
                break;
            case RadGrid.PageCommandName:
                break;
            default:
                break;
        }
    }

 

I hope you can help me with this problem.

Sincerly Jan

Maria Ilieva
Telerik team
 answered on 07 Feb 2013
3 answers
100 views


I am trying to update a grid that is bound.  When I hit the javascript code that does the close and rebind the args are undefined (see code snippet 1.  As I step through the server side code all looks good. I tried using both ScriptManager and ClientScript.  Any thoughts???  thanks...
code snippet 1....
            function CloseAndRebind(args) {
                alert('args ' + args);
                GetRadWindow().BrowserWindow.refreshGrid(args);
                GetRadWindow().close();
            }

code snippet 2...
        protected void DetailsView1_ItemCommand(object sender, DetailsViewCommandEventArgs e)
        {
            if (e.CommandName == "Update")
            {
                //ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "CloseAndRebind();", true);
                ScriptManager.RegisterStartupScript(this,Page.GetType(), "mykey", "CloseAndRebind();", true);
            }
}

protected void DetailsView1_ItemUpdating(object sender, DetailsViewUpdateEventArgs e)
        {
            //logic to truncate long string to prevent SQL error
            for (int i = 1; i < 6; i++)
            {
                string val = e.NewValues[i - 1].ToString();
                int maxLength = i * 10;
                if (val.Length > maxLength) e.NewValues[i - 1] = val.Substring(0, maxLength);
            }
        }
Maria Ilieva
Telerik team
 answered on 07 Feb 2013
5 answers
95 views
hi, i am having an issue on Splitter and its radslidingpane on IE8. When i set the splitter to a certain height (from my case 95-97%), the sliding event will keep looping the browser resize event. Any idea how this will happen?
Vessy
Telerik team
 answered on 07 Feb 2013
1 answer
831 views

How can I stop timer(in other words stop browser refresh/page refresh), while dragging a task from RadGrid to RadScheduler and how can I start timer(in other words start browser refresh/page refresh), after the task is dropped.
My drag and drop is similar to this demo
http://demos.telerik.com/aspnet-ajax/scheduler/examples/draganddropintegration/defaultcs.aspx?product=scheduler

This is my code for RadScheduler:
<telerik:RadScheduler ID="rsTicketsSchedule" runat="server" AllowInsert="False" DisplayDeleteConfirmation="False"
                            Localization-HeaderToday="Today" EnableCustomAttributeEditing="True" EnableDescriptionField="True"
                            Height="100%" EnableExactTimeRendering="true" EnableViewState="true" OverflowBehavior="Scroll"
                            ShowAllDayRow="false" OnAppointmentDataBound="TicketsSchedule_AppointmentDataBound"
                            OnNavigationComplete="rsTicketsSchedule_NavigationComplete" OnNavigationCommand="rsTicketsSchedule_NavigationCommand"
                            OnTimeSlotCreated="rsTicketsSchedule_TimeSlotCreated" OnAppointmentUpdate="onApptUpdate"
                            OnClientAppointmentDoubleClick="rsClientAppointmentDoubleClick" OnClientAppointmentClick="singleClick"
                            OnClientAppointmentContextMenu="CheckTimerStatus" OnClientAppointmentContextMenuItemClicked="handleClick"
                            OnClientFormCreated="ClientFormCreated" OnDataBound="rsTicketsSchedule_DataBound"
                            OnClientAppointmentMoveEnd="AppointmentMoved" OnClientAppointmentDeleting="OnClientAppointmentDeleting"
                            OnClientAppointmentMoveStart="StopTimer" 
                            CustomAttributeNames="HasAttachment"    DataReminderField="Reminder" OnClientAppointmentEditing= "StopTimer"    >
                           <AppointmentTemplate>
                                 <div>
                                         <asp:Panel ID="RecurrencePanel" CssClass="rsAptRecurrence" runat="server" Visible="false" />
                                         <asp:Panel ID="RecurrenceExceptionPanel" CssClass="rsAptRecurrenceException" runat="server"
                                              Visible="false" />
                                       <%--  <asp:Panel ID="ReminderPanel" CssClass="rsAptReminder" runat="server" Visible="true" />--%>
                                         <div id="ApptImageDiv" style="text-align:right; position:absolute; width:95%;" >
                                             <asp:Image ID="ApptAttachmentImg" runat="server"  Width="16px" Height="17px" style=" margin-right:5px; background:url(img/sprite-alpha.png)-166px -34px no-repeat; background-position: -98px -66px; border:transparent; " 
                                                           Visible='<%# String.IsNullOrEmpty(Container.Appointment.Attributes["HasAttachment"])? false : Boolean.Parse(Container.Appointment.Attributes["HasAttachment"]) %>'
                                              />
                                          </div>
                                         <%#Eval("Subject") %>     
                                  
                                  </div>
                            </AppointmentTemplate    >
                        
                            <AppointmentContextMenus     >
                            </AppointmentContextMenus>
                            <DayView UserSelectable="True" GroupBy="TechName" GroupingDirection="Horizontal" />
                            <WeekView UserSelectable="True" GroupBy="TechName" GroupingDirection="Vertical" />
                            <MonthView UserSelectable="True" GroupBy="TechName" GroupingDirection="Vertical" />
                            <TimelineView ColumnHeaderDateFormat="h:mm tt" GroupingDirection="Vertical" HeaderDateFormat="MM/dd/yyyy h:mm tt"
                                NumberOfSlots="21" SlotDuration="00:30:00" StartTime="08:00:00" />
                            <AdvancedForm EnableCustomAttributeEditing="True" Modal="True" />
                            <ResourceTypes>
                                <telerik:ResourceType Name="TechName" />
                                <telerik:ResourceType Name="TicketState" />
                            </ResourceTypes>
                            <Reminders Enabled="true"></Reminders>
                                
                        </telerik:RadScheduler>

Thanks for your help in advance

Boyan Dimitrov
Telerik team
 answered on 07 Feb 2013
8 answers
186 views

Hi!


I'm trying to use RadRotator as a simple thumb rotative Image Gallery. I would like to show the loading gif while the image is not fully loaded and visible in the client. My problem is to remove the background Loading image. Is there anyway of doing that? I've tried to use the onload image DOM event to run javascript that does the pretended, but I can't know which image fired the function :-|.

The desired effect is this.

Regards,
Rodrigo S.
Martin Roussel
Top achievements
Rank 1
 answered on 07 Feb 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?