My structure is this...
MasterPage >> Content Page which includes a RadGrid >> In the RadGrid, I am using a UserControl (ascx) for the insert item.
Masterpage has ScriptManager and RadAjaxManager
Contentpage has RadAjaxProxy
UserControl has RadAjaxProxy
The UserControl is basically a table with labels, Radtextboxes and Radcomboboxes.
My usercontrol has this declaration:
----------------------------------------------------------------------------
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server" >
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="uxDirectory">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="uxProjectName" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManagerProxy>
-------------------------------------------------------------------------------
uxDirectory and uxProjectName are both RadComboBoxes
The problem I am facing is when a value is changed in the uxDirectory combobox all the "Load" events based on other controls are being fired. It is my understanding that since I have autopostback="true" on the uxDirectory, and based upon the declaration above, that only the uxProjectName control will Load. However, all my controls are reloading. This is wiping out the values saved, etc. How can I perform a Ajax postback for a specific control within a ASCX Usercontrol?
-DB
<telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" GridLines="None" OnInsertCommand="RadGrid1_InsertCommand" OnItemCommand="RadGrid1_ItemCommand" OnNeedDataSource="RadGrid1_NeedDataSource" OnUpdateCommand="RadGrid1_UpdateCommand" OnItemDataBound="RadGrid1_ItemDataBound" OnItemCreated="RadGrid1_ItemCreated" Width="100%"> <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"> </HeaderContextMenu> <MasterTableView AllowMultiColumnSorting="True" CommandItemDisplay="Top" DataKeyNames="ID,OriginalAmount" CommandItemSettings-AddNewRecordText="Add new payment or credit" ClientDataKeyNames="ID" Font-Size="Smaller"> <EditFormSettings> <EditColumn FilterControlAltText="Filter EditCommandColumn column"> </EditColumn> </EditFormSettings> <PagerStyle Mode="NextPrevNumericAndAdvanced" /> <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings> <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"> <HeaderStyle Width="20px"></HeaderStyle> </RowIndicatorColumn> <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"> <HeaderStyle Width="20px"></HeaderStyle> </ExpandCollapseColumn> <Columns> <telerik:GridEditCommandColumn FilterControlAltText="Filter EditCommandColumn column" ButtonType="PushButton"> <ItemStyle Font-Size="Smaller" Width="10%" /> </telerik:GridEditCommandColumn> <telerik:GridButtonColumn CommandName="Rollback" ConfirmText="Are you sure you want to roll back the application of this payment/credit?" ConfirmTitle="Rollback?" FilterControlAltText="Filter Rollback column" Text="Rollback" UniqueName="Rollback" ButtonType="PushButton"> </telerik:GridButtonColumn> <telerik:GridButtonColumn CommandName="Apply" FilterControlAltText="Filter Apply column" Text="Apply" UniqueName="Apply" ButtonType="PushButton"> </telerik:GridButtonColumn> <telerik:GridButtonColumn CommandName="ViewApplication" FilterControlAltText="Filter View Application column" Text="View" UniqueName="ViewApplication" ButtonType="PushButton"> </telerik:GridButtonColumn> <telerik:GridButtonColumn CommandName="NSF" FilterControlAltText="Filter NSF column" Text="NSF" UniqueName="NSF" ButtonType="PushButton"> </telerik:GridButtonColumn> <telerik:GridDateTimeColumn DataField="CreditDate" DataType="System.DateTime" FilterControlAltText="Filter CreditDate column" HeaderText="Credit Date" UniqueName="CreditDate" DataFormatString="{0:MM/dd/yyyy}"> </telerik:GridDateTimeColumn> <telerik:GridTemplateColumn DataField="ActivityTypeID" FilterControlAltText="Filter ActivityType column" HeaderText="Type" UniqueName="ActivityType"> <EditItemTemplate> <telerik:RadComboBox ID="rcbActivityType" runat="server"> </telerik:RadComboBox> </EditItemTemplate> <ItemTemplate> <asp:Label ID="lblActivityType" runat="server" Text='<%# Eval("ActivityTypeID") %>'></asp:Label> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridBoundColumn DataField="CreditIdentifier" FilterControlAltText="Filter Check Number column" HeaderText="Check Number" MaxLength="500" UniqueName="CreditIdentifier"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="OriginalAmount" FilterControlAltText="Filter OriginalAmount column" HeaderText="Original Amt." UniqueName="OriginalAmount" DataFormatString="{0:C2}"> </telerik:GridBoundColumn> <telerik:GridNumericColumn DataField="RemainingAmount" DataType="System.Decimal" DecimalDigits="2" FilterControlAltText="Filter RemainingAmount column" HeaderText="Remaining Amt." NumericType="Currency" ReadOnly="True" UniqueName="RemainingAmount"> </telerik:GridNumericColumn> <telerik:GridBoundColumn DataField="Notes" FilterControlAltText="Filter Notes column" ColumnEditorID="GridTextBoxColumnEditor1" HeaderText="Notes" MaxLength="500" UniqueName="Notes"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="CreatedBy" FilterControlAltText="Filter CreatedBy column" HeaderText="Created By" MaxLength="50" ReadOnly="True" UniqueName="CreatedBy" Display="False"> </telerik:GridBoundColumn> </Columns> <EditFormSettings> <EditColumn UniqueName="EditCommandColumn1" FilterControlAltText="Filter EditCommandColumn column" ButtonType="PushButton"> </EditColumn> </EditFormSettings> <PagerStyle Mode="NextPrevNumericAndAdvanced"></PagerStyle> </MasterTableView> <FilterMenu EnableImageSprites="False"> </FilterMenu></telerik:RadGrid>protected void RadGrid1_UpdateCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e){ LaundryLogicDAL.ARCredits oARC = new LaundryLogicDAL.ARCredits(); try { oARC.es.Connection.Name = "NAS"; oARC.es.Connection.SqlAccessType = esSqlAccessType.DynamicSQL; GridEditableItem editedItem = e.Item as GridEditableItem; GridEditManager editMan = editedItem.EditManager; int iID = (int)editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["ID"]; DateTime dteCreditDate = DateTime.Parse((editMan.GetColumnEditor("CreditDate") as GridDateTimeColumnEditor).Text); int iActivityTypeID = Convert.ToInt16((editedItem["ActivityType"].FindControl("rcbActivityType") as RadComboBox).SelectedValue); decimal dOriginalAmount = CurrencyToDecimal((editMan.GetColumnEditor("OriginalAmount") as GridTextBoxColumnEditor).Text); string sNotes = (editMan.GetColumnEditor("Notes") as GridTextBoxColumnEditor).Text; string sCreditIdentifier = (editMan.GetColumnEditor("CreditIdentifier") as GridTextBoxColumnEditor).Text; if (oARC.LoadByPrimaryKey(iID)) { oARC.CreditDate = dteCreditDate; oARC.ActivityTypeID = iActivityTypeID; oARC.CreditIdentifier = sCreditIdentifier; oARC.OriginalAmount = dOriginalAmount; oARC.Notes = sNotes; oARC.Save(); } } catch (Exception ex) { DotNetNuke.Services.Exceptions.Exceptions.ProcessModuleLoadException(this, ex); } finally { oARC = null; }<telerik:RadScriptManager ID="RadScriptManager1" runat="server" /> <!-- content start --> <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="grdMain"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="grdMain" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> <telerik:RadGrid ID="grdMain" OnSortCommand="grdMain_SortCommand" OnPageIndexChanged="grdMain_PageIndexChanged" Width="100%" OnPageSizeChanged="grdMain_PageSizeChanged" AllowSorting="True" PageSize="20" AllowPaging="True" AllowMultiRowSelection="True" runat="server" GridLines="None" Skin="Windows7" AutoGenerateColumns="true"> <MasterTableView Width="100%" Summary="RadGrid table" /> <PagerStyle Mode="NextPrevAndNumeric" /> <ClientSettings AllowKeyboardNavigation="true" EnableRowHoverStyle="true"> <Selecting AllowRowSelect="true" /> </ClientSettings> </telerik:RadGrid> <!-- content end -->
Hi,
I use pretty simple set of Editor. On IE8 and previous version of controls I could select text, make it italic, set background and foreground colors, after I upgrades to most recent one and installed IE9 something has changed. I can do all I could do before if I switch into IE7 compatibility mode, when I'm in IE8, IE8 and FF4 Editor doesn't let italic happen: no change in editor no button gets toggled.
There is a hierarchy of control that loaded dynamically and editor is one of them.
Also 2 related questions:
1)JS below has issue that was toggling very interesting flickering on IE8 with previous versions of controls, haven't tested yet with current version and IE9 if also happens
2)when a page that loads dynamic controls is loaded first time and inside some of those controls there is Editor or TreeList (haven't checked other controls) - the appearance of controls is broken, feels like they didn't have a chance to recalculate their layout using JS. When I navigate away and come back - view is ok. I have made a lot of css chnages to site, so if I will experience this behaviour I will attach screenshot
here is my Editor:
<telerik:RadEditor ID="radEditor" runat="server" EditModes="Design" Skin="Default" OnClientSubmit="OnClientSubmit" OnClientLoad="OnClientLoad" StripFormattingOnPaste="AllExceptNewLines" StripFormattingOptions="AllExceptNewLines" Style="position: relative; right: 1px;" Width="100%" Height="150px" AutoResizeHeight="false"> <Tools> <telerik:EditorToolGroup Tag="MainToolbar"> <telerik:EditorTool Name="Cut"></telerik:EditorTool> <telerik:EditorTool Name="Copy" ShortCut="CTRL+C"></telerik:EditorTool> <telerik:EditorTool Name="Paste" ShortCut="CTRL+V"></telerik:EditorTool> </telerik:EditorToolGroup> <telerik:EditorToolGroup> <telerik:EditorTool Name="Bold" ShortCut="CTRL+B"></telerik:EditorTool> <telerik:EditorTool Name="Italic" ShortCut="CTRL+I"></telerik:EditorTool> <telerik:EditorTool Name="Underline" ShortCut="CTRL+U"></telerik:EditorTool> <telerik:EditorTool Name="StrikeThrough"></telerik:EditorTool> <telerik:EditorSeparator /> </telerik:EditorToolGroup> <telerik:EditorToolGroup> <telerik:EditorSplitButton Name="ForeColor"> </telerik:EditorSplitButton> <telerik:EditorSplitButton Name="BackColor"> </telerik:EditorSplitButton> </telerik:EditorToolGroup> </Tools> <Content> </Content> </telerik:RadEditor>function OnClientSubmit(editor) { // line below causes weird flickering effect on IE when rad editor is loaded first time and navigated away //editor.fire("FormatStripper", { value: "AllExceptNewLines" }); } function OnClientLoad(editor, args) { var style = editor.get_contentArea().style; style.backgroundImage = "none"; style.backgroundColor = "e1e2dc"; style.color = "#000"; style.fontFamily = "Verdana"; style.fontSize = 11 + "px"; }