Protected Sub grdMember_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles grdMember.ItemDataBound If e.Item.OwnerTableView.DataSourceID = "sdsMember" Then If TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode Then If e.Item.OwnerTableView.IsItemInserted Then Dim edititem As GridEditFormItem = DirectCast(e.Item, GridEditFormItem) Dim acsysid As TextBox = DirectCast(edititem("ACCOUNTING_SYSTEM_ID").Controls(0), TextBox) acsysid.Visible = False Dim termdate As RadDatePicker = DirectCast(edititem("MEMBER_RB_TERMINATION_DATE").FindControl("rdpTerminationDate"), RadDatePicker) termdate.Visible = False Dim termcomments As TextBox = DirectCast(edititem("MEMBER_RB_TERMINATION_COMMENTS").FindControl("txtTermComments"), TextBox) termcomments.Visible = False Dim memberrbactive As CheckBox = DirectCast(edititem("MEMBER_RB_ACTIVE").Controls(0), CheckBox) memberrbactive.Visible = False End If End If End IfEnd Sub<telerik:GridBoundColumn DataField="ACCOUNTING_SYSTEM_ID" UniqueName="ACCOUNTING_SYSTEM_ID" HeaderText="Accounting ID" AutoPostBackOnFilter="true"> <ItemStyle VerticalAlign="Top" /> </telerik:GridBoundColumn> <telerik:GridTemplateColumn HeaderText="Term. Date" DataField="MEMBER_RB_TERMINATION_DATE" SortExpression="MEMBER_RB_TERMINATION_DATE" UniqueName="MEMBER_RB_TERMINATION_DATE"> <EditItemTemplate> <telerik:RadDatePicker ID="rdpTerminationDate" runat="server" DbSelectedDate='<%# Bind("MEMBER_RB_TERMINATION_DATE", "{0: MM/dd/yy}") %>'> <DateInput ID="diTerminationDate" InvalidStyleDuration="100" runat="server"> </DateInput> </telerik:RadDatePicker> </EditItemTemplate> <ItemTemplate> <asp:Label ID="MEMBER_RB_TERMINATION_DATELabel" runat="server" Text='<%# Bind("MEMBER_RB_TERMINATION_DATE", "{0: MM/dd/yy}") %>'></asp:Label> </ItemTemplate> <ItemStyle VerticalAlign="Top" /> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn DataField="MEMBER_RB_TERMINATION_COMMENTS" HeaderText="Term. Comments" SortExpression="MEMBER_RB_TERMINATION_COMMENTS" UniqueName="MEMBER_RB_TERMINATION_COMMENTS"> <EditItemTemplate> <asp:TextBox ID="txtTermComments" runat="server" Text='<%# Bind("MEMBER_RB_TERMINATION_COMMENTS") %>' TextMode="multiLine" Rows="5" Columns="40"></asp:TextBox> </EditItemTemplate> <ItemTemplate> <asp:Label ID="MEMBER_RB_TERMINATION_COMMENTSLabel" runat="server" Text='<%# Eval("MEMBER_RB_TERMINATION_COMMENTS") %>'></asp:Label> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridCheckBoxColumn DataField="MEMBER_RB_ACTIVE" DataType="System.Boolean" HeaderText="Active" SortExpression="MEMBER_RB_ACTIVE" UniqueName="MEMBER_RB_ACTIVE" AutoPostBackOnFilter="true"> <ItemStyle VerticalAlign="Top" Width="40px" /> <HeaderStyle Width="45px" /> </telerik:GridCheckBoxColumn>Hello,
I would like to try using the CompositeScript functionality provided by the RadScriptManager. However, I'm having difficulty trying to pass in the parameters that I would need in the javascript in order to do to. For example, for the RadNumericTextBox OnValueChaging event, we defined the javascript function to call:
txtAmount.ClientEvents.OnValueChanging = "price_changing";
In the RadScriptBlock, I have the following function:
function price_changing(sender, args) { var strOldValue = args.get_oldValue().toString().replace("$",""); // 0.00 var strNewValue = args.get_newValue().toString().replace("$", ""); // 0.00 var totalfee = parseFloat(document.getElementById("<%= lblTotalFee.ClientID %>").innerText.replace("$", "")); if (run_update && (strOldValue != strNewValue)) { var grid = $find('<%= grdFee.ClientID %>'); .....
In order to move the script block into a seperate .JS file, I need to replace "<%= lblTotalFee.ClientID %>" with a variable I can pass into the javascript function. (Or the "<%= grdFee.ClientID %>").
There seems to be no way of doing that, I cannot specify parameters in the ClientEvents.OnValueChanging event.
One way might solve it is to upgrade to .NET 4 (We use .NET 3.5 now), then use the ClientIDMode property, so we can always expect a static ID. But I'm looking for another option.
Any ideas?
Thanks,
Annie
<telerik:RadScriptManager ID="RSM" runat="server"></telerik:RadScriptManager> <table> <tr> <td valign="top"> <telerik:RadFileExplorer ID="RadFileExplorer1" Runat="server" Width="400px"> <Configuration ViewPaths="~/Images/CMS" DeletePaths="~/Images/CMS" UploadPaths="~/Images/CMS" /> </telerik:RadFileExplorer> </td> <td valign="top"> <telerik:RadEditor Height="700px" Width="100%" ID="RadEditor1" Content='<%# Bind("PageContent") %>' Runat="server"> <ImageManager DeletePaths="~/Images/CMS" UploadPaths="~/Images/CMS" ViewPaths="~/Images/CMS" /> </telerik:RadEditor><telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="cboContentAreas"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="cboAreasOfConcern" /> <telerik:AjaxUpdatedControl ControlID="cboInterventionTools" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="cboAreasOfConcern"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="cboInterventionTools" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager>