Recentally I updated my Rad controls.
I drag and drop a RadAjaxManager on to the page and use the Configure Ajax manager API to set up the control and this is what is automaticaly generate:
<telerik:RadAjaxManager ID="ramCreateMessage" runat="server">
<AjaxSettings>
<telerik.web.ui.ajaxsetting ajaxcontrolid="chkPriorityMessage"><updatedcontrols>
<telerik.web.ui.ajaxupdatedcontrol controlid="chkReadReceipt"></telerik.web.ui.ajaxupdatedcontrol>
</updatedcontrols>
</telerik.web.ui.ajaxsetting>
<telerik.web.ui.ajaxsetting ajaxcontrolid="btnSendMessage"><updatedcontrols>
<telerik.web.ui.ajaxupdatedcontrol controlid="lblRecipientError"></telerik.web.ui.ajaxupdatedcontrol>
</updatedcontrols>
</telerik.web.ui.ajaxsetting>
</AjaxSettings>
</telerik:RadAjaxManager>
The telerik.web.ui.ajaxsetting Tag is causing this error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Telerik.Web.UI.AjaxSettingsCollection must have items of type 'Telerik.Web.UI.AjaxSetting'. 'telerik.web.ui.ajaxsetting' is of type 'System.Web.UI.HtmlControls.HtmlGenericControl'.
Source Error:
Line 111:<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
Line 112: <AjaxSettings>
Line 113: <telerik.web.ui.ajaxsetting ajaxcontrolid="chkPriorityMessage"><updatedcontrols>
Line 114:<telerik.web.ui.ajaxupdatedcontrol controlid="chkReadReceipt"></telerik.web.ui.ajaxupdatedcontrol>
Line 115:</updatedcontrols>
I can edit the client side code and correct the issue by doing this
<telerik:RadAjaxManager ID="ramCreateMessage" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="chkPriorityMessage">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="chkReadReceipt" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="btnSendMessage">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="lblRecipientError" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
This is how the Configure Ajax manager API should be generating the code, I would like to use the Configure Ajax manager API
And NOT have to always modify my code. How do I fix this????? This Just happened after I updated my controls, PLEASE HELP.
| <td align="right" colspan="2"> |
| <asp:Button ID="btnUpdate" runat="server" CssClass="form-button" |
| CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' |
| Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' |
| /> |
| |
| <asp:Button ID="btnCancel" runat="server" CausesValidation="False" CssClass="form-button" |
| CommandName="Cancel" Text="Cancel" /> |
| </td> |
| protected void RadGrid1_UpdateCommand(object source, GridCommandEventArgs e) |
| { |
| ... |
| if (id == 0) |
| // if (result != null) |
| { |
| SqlDataSource2.UpdateParameters["Program"].DefaultValue = combo.SelectedItem.Text; |
| e.Canceled = false; |
| } |
| else |
| { |
| string user = "John Doe";
string stlocation = "Your Location"; |
| RadAjaxPanel1.ResponseScripts.Add(string.Format("alert('Location already exists for the selected user');")); |
| e.Canceled = true; |
| } |
| } |
I would like to show:
John Doe, Location already exists for the selected user from: Your Location. .
As you will notice, I stored John Doe in string user and Your Location in stlocation..
Is it possible this can be done via a Javscript Function and this whole string "John Doe, Location already exists for the selected user from: Your Location" can be pass as argument or parameter. This way I can call the same Function over and over from other events just by passing the parameter.
Thanks
GC_0620

| <%@ Page Language="C#" AutoEventWireup="true" CodeFile="RadGridTest3.aspx.cs" Inherits="RadGridTest3" %> |
| <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head> |
| <title>Test Radgrids</title> |
| </head> |
| <body> |
| <form runat="server" id="mainForm" method="post"> |
| <div style="width:300px"> |
| <telerik:RadScriptManager ID="RadScriptManager1" runat="server" /> |
| <!-- content start --> |
| <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> |
| <AjaxSettings> |
| <telerik:AjaxSetting AjaxControlID="RadGrid1"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| </AjaxSettings> |
| </telerik:RadAjaxManager> |
| <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1" OnColumnCreated="RadGrid1_ColumnCreated" |
| OnItemCreated="RadGrid1_ItemCreated" OnItemDataBound="RadGrid1_ItemDataBound"> |
| <MasterTableView HierarchyDefaultExpanded="true" HierarchyLoadMode="Client" AllowSorting="true" |
| DataKeyNames="EmployeeID, ReportsTo" Width="100%"> |
| <SelfHierarchySettings ParentKeyName="ReportsTo" KeyName="EmployeeID" /> |
| </MasterTableView> |
| <HeaderStyle width="300px"/> |
| <ClientSettings AllowExpandCollapse="true"> |
| <Scrolling AllowScroll="True" UseStaticHeaders="True" FrozenColumnsCount="1"> |
| </Scrolling> |
| </ClientSettings> |
| </telerik:RadGrid> |
| </div> |
| <asp:SqlDataSource ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>" |
| ProviderName="System.Data.SqlClient" SelectCommand="SELECT EmployeeID, LastName, FirstName, Title, ReportsTo FROM Employees" |
| runat="server"></asp:SqlDataSource> |
| </form> |
| </body> |
| </html> |
have a radgrid which is bound to a sqldatasource. When I click on the "Edit" option and make changes to click "Update", the changes are not saved to the Database. I am sure I am doing something wrong(but don't know what).
Related Information:
RadGrid Code:
telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1" AutoGenerateColumns="False"
GridLines="None" AllowAutomaticUpdates="True" AllowAutomaticDeletes="True"
AllowAutomaticInserts="True">
<MasterTableView DataSourceID="SqlDataSource1" DataKeyNames="DateTime,SourceID" EditMode="InPlace">
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
<Columns>
<telerik:GridEditCommandColumn>
</telerik:GridEditCommandColumn>
<telerik:GridBoundColumn DataField="DateTime" HeaderText="DateTime"
SortExpression="DateTime" UniqueName="column1" DataFormatString="{0:g}"
ReadOnly="True">
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn DataField="N1" HeaderText="Heater Duty (63 MMBTU/HR)"
SortExpression="N1" UniqueName="column3">
<EditItemTemplate>
<asp:TextBox ID="N1TextBox" runat="server" Text='<%# Bind("N1", "{0:F3}") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="N1Label" runat="server" Text='<%# Eval("N1", "{0:F3}") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="N2" HeaderText="NOX (2.52 lb/hr)" SortExpression="N2"
UniqueName="column2">
<EditItemTemplate>
<asp:TextBox ID="N2TextBox" runat="server" Text='<%# Bind("N2", "{0:F3}") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="N2Label" runat="server" Text='<%# Eval("N2", "{0:F3}") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="N3" HeaderText="CO (4.46 lb/hr)" SortExpression="N3"
UniqueName="column5">
<EditItemTemplate>
<asp:TextBox ID="N3TextBox" runat="server" Text='<%# Bind("N3", "{0:F3}") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="N3Label" runat="server" Text='<%# Eval("N3", "{0:F3}") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="N4" HeaderText="SO2 (1.67 lb/hr)" SortExpression="N4"
UniqueName="column6">
<EditItemTemplate>
<asp:TextBox ID="N4TextBox" runat="server" Text='<%# Bind("N4", "{0:F3}") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="N4Label" runat="server" Text='<%# Eval("N4", "{0:F3}") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="N5" HeaderText="VOC (0.33 lb/hr)" SortExpression="N5"
UniqueName="column7">
<EditItemTemplate>
<asp:TextBox ID="N5TextBox" runat="server" Text='<%# Bind("N5", "{0:F3}") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="N5Label" runat="server" Text='<%# Eval("N5", "{0:F3}") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="N6" HeaderText="PM (0.47 lb/hr)" SortExpression="N6"
UniqueName="column8">
<EditItemTemplate>
<asp:TextBox ID="N6TextBox" runat="server" Text='<%# Bind("N6", "{0:F3}") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="N6Label" runat="server" Text='<%# Eval("N6", "{0:F3}") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="N7" HeaderText="Fuel Gas Flow"
SortExpression="N7" UniqueName="column9">
<EditItemTemplate>
<asp:TextBox ID="N7TextBox" runat="server" Text='<%# Bind("N7", "{0:F3}") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="N7Label" runat="server" Text='<%# Eval("N7", "{0:F3}") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</telerik:GridTemplateColumn>
<telerik:GridCheckBoxColumn DataField="Deviation" DataType="System.Boolean"
HeaderText="Deviation" SortExpression="Deviation" UniqueName="Deviation" ReadOnly="True">
</telerik:GridCheckBoxColumn>
<telerik:GridTemplateColumn HeaderText="Event" UniqueName="EventHyperlink">
<ItemTemplate>
<asp:HyperLink ID="hplEvent" runat="server"
NavigateUrl='<%# String.Format("Event.aspx?EventID={0}&datetime={1}&sourceid={2}", Eval("EventID"), Eval("DateTime"), Eval("SourceID")) %>'
Text='<%# DataBinder.Eval(Container, "DataItem.ImpactNo") %>'></asp:HyperLink>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Comment" UniqueName="Comments">
<EditItemTemplate>
<asp:TextBox ID="txtComments" runat="server"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<a id="commlink" onclick="javascript:popup=void(window.open('Comments.aspx?datetime=<%#DataBinder.Eval(Container.DataItem,"DateTime")%>&sourceid=<%#DataBinder.Eval(Container.DataItem,"SourceID")%>','popup','left=400,top=300,height=450,width=450,status=no,resizable=no,scrollbars=no,toolbar=no,location=no,menubar=no,titlebar=no'));" href="#" id="a6" ><%#DataBinder.Eval(Container, "DataItem.Comments")%></a>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Report" UniqueName="TemplateColumn">
<ItemTemplate>
<asp:HyperLink ID="hplReport" runat="server"
NavigateUrl='<%# DataBinder.Eval(Container, "DataItem.ImpactNo", "Test.aspx?ImpactNo={0}") %>'
Text="Report"></asp:HyperLink>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
<EditFormSettings>
<EditColumn UniqueName="EditCommandColumn1"></EditColumn>
</EditFormSettings>
</MasterTableView>
</telerik:RadGrid>
SQL DataSource Code:
-----------------------------------
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TotalConn %>"
SelectCommand="SELECT GV.DateTime, GV.EventID, GV.SourceID, GV.N1, GV.N2, GV.N3, GV.N4, GV.N5, GV.N6, GV.N7, GV.Deviation, GV.Comments, E.ImpactNo FROM stGridView GV LEFT JOIN Events E ON GV.EventID = E.EventID WHERE GV.SourceID = 2 AND GV.DateTime BETWEEN '1-22-2010' AND '1-23-2010' ORDER BY GV.DateTime"
UpdateCommand="UPDATE stGridView SET N1 = @N1, N2 = @N2, N3 = @N3, N4 = @N4, N5 = @N5, N6 = @N6, N7 = @N7 WHERE DateTime = @DateTime AND SourceID = @SourceID">
<UpdateParameters>
<asp:Parameter Name="DateTime" Type="DateTime" />
<asp:Parameter Name="SourceID" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
Related Information:
-----------------------------
In the sqldatasource update command (UpdateCommand="UPDATE stGridView SET N1 = @N1.......), if I replace "@N1" with a value, say "5", that value is correctly saved. It seems that the update command is unable to get "@N1" value. I am not sure if there needs to be anything in the code-behind to handle this.
Thanks for any help!
Sri
Hi,
We are using RadScheduler to display events. When user clicks “Today” link on header, the user navigates to the Today date, which is the server date. We want to change this server date. I have tried by setting SelectedDate property but it’s not working. Is there any way to do this..??
Please help me..
Thanking you.