An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.
|
|
If I use DataBinding to create my menuitems, and use the OnClientItemClicked event to call a javascript which calls a radwindow (popup), the called radwindow does not popup, rather it loads into the target pane.
(well it pops up briefly, then exits and reloads in the Target Pane)
However, when I Create the MenuItems in HTML, the call to the OnClientItemClicked javascript , does popup the radwindow correctly.
My workaround for this was "AppendDataBoundItems" and retain a menu item from HTML, such that my popup radwindow pops up correctly...Happiness,..BUT
It is AppendDataBoundItems,...and I really want PrePend,..i.e. I would like my MenuItem with Popup to appear at the end of the Menu, not the beginning.
Any help,..ideas ? (for either).
Code is:
RadMenu AdminAuthMenu = this.NavPane.FindControl("RadMenu1") as RadMenu;
AdminAuthMenu.DataSource = SiteMap.GetdbMenuItems(); //Just class with db sql to get MenuItems
AdminAuthMenu.DataBind();
protected void RadMenu1_OnItemDataBound(object sender, RadMenuEventArgs e)
{
RadMenuItem ei = e.Item as RadMenuItem;
ei.Target = "ContentPane";
}Markup is:
telerik:RadMenu ID="RadMenu1" runat="server" Width="100%" Height="31px" Skin="Black"
OnClientItemClicked="MenuItemItemClicked"
DataFieldID="ScreenId"
DataNavigateUrlField="Screen"
DataTextField="Title"
DataValueField="ScreenId"
OnItemDataBound="RadMenu1_OnItemDataBound"
AppendDataBoundItems="True">
<DefaultGroupSettings Flow="Horizontal" />
<Items >
<telerik:RadMenuItem runat="server" Text="Login" value="Login"
BackColor="Transparent" ForeColor="#FFFFC0"></telerik:RadMenuItem>
</Items>
function verificarCPF() { var contador; var valorCPF = $telerik.findMaskedTextBox("txtBuscaCpf").get_value(); var numeroCPF = valorCPF.substr(0, 9); var digitoCPF = valorCPF.substr(9, 2); var d1 = 0; for (contador = 0; contador < 9; contador++) { d1 += numeroCPF.charAt(contador) * (10 - contador); } if (d1 == 0) { radalert("CPF Inválido!",350,140,"Mensagem",null,null); return false; } d1 = 11 - (d1 % 11); if (d1 > 9) d1 = 0; if (digitoCPF.charAt(0) != d1) { radalert("CPF Inválido!", 350, 140, "Mensagem", null, null); return false; } d1 *= 2; for (contador = 0; contador < 9; contador++) { d1 += numeroCPF.charAt(contador) * (11 - contador); } d1 = 11 - (d1 % 11); if (d1 > 9) d1 = 0; if (digitoCPF.charAt(1) != d1) { radalert("CPF Inválido!", 350, 140, "Mensagem", null, null); return false; } return true; //radalert("CPF Válido!", 350, 140, "Mensagem", null, null);}<telerik:RadMaskedTextBox ID="txtBuscaCpf" ClientEvents-OnBlur="verificarCPF" AutoPostBack="true" runat="server" Mask="###.###.###-##" Width="100" OnTextChanged="txtBuscaCpf_TextChanged" />Hi
Iam placed one table inside the EditFormSetting .i want to calculate the days in between twodates of datepickers .
how can i get the value of datepickerconcrol when i selected the date for writing the javascript function .
please help me .Thank u in advance.
<EditFormSettings EditFormType="Template">
</FormTemplate>
---datepicker1---
---datepicker2---
---ddl----price*days
--txtbox---result bind to this textbox
</formTemplate>
</EditFormSettings>
<table cellpadding="1" cellspacing="1" width="98%" align="center"> <tr> <!--#include file="../Menus/MenuPage.aspx"--> </tr> <tr> <td align="center"> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate > <table align="center"> <tr> <td style="text-align: center"> <asp:LinkButton ID="LinkButton1" runat="server" Font-Bold="true" Font-Names="verdana" Font-Size="12pt" ForeColor="SteelBlue"> Bill Details </asp:LinkButton> </td> </tr> <tr> <td> </td> </tr> <tr> <td align="center"> <table align="center" cellpadding="1" cellspacing="1" style="margin:2px"> <tr> <td align="left" style="width:100px"> <asp:Label ID="Label1" runat="server" Text="RefNo" Font-Names="Verdana" Font-Size="8.5pt" ForeColor="Maroon"></asp:Label></td> <td align="left" style="width:150px"> <asp:TextBox ID="txtRefno" runat="server" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="8.5pt" ForeColor="Black"></asp:TextBox> <telerik:RadComboBox ID="ddlRefno" runat="server" AllowCustomText="True" AutoPostBack="True" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" DropDownCssClass="RadComboBox_Sunset" EmptyMessage="Select a RefNo" EnableEmbeddedSkins="False" EnableLoadOnDemand="True" EnableViewState="false" EnableVirtualScrolling="True" Font-Names="verdana" Font-Size="8.5pt" MarkFirstMatch="True" ShowMoreResultsBox="True" Skin="Sunset" style="color:Black;background-color:White;font-family:Verdana;font-size:8pt;" TabIndex="1"> </telerik:RadComboBox> </td> <td align="left" style="width:100px" > <asp:Label ID="Label2" runat="server" Text="Date" Font-Names="Verdana" Font-Size="8.5pt" ForeColor="Maroon"></asp:Label></td> <td align="left" style="width:150px"><asp:TextBox ID="txtDate" runat="server" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="8.5pt"></asp:TextBox></td> </tr> <tr> <td align="left" style="width:100px"> <asp:Label ID="Label3" runat="server" Text="Patient Id" Font-Names="Verdana" Font-Size="8.5pt" ForeColor="Maroon"></asp:Label></td> <td align="left" style="width:150px"> <telerik:RadComboBox ID="ddlPatientno" runat="server" AutoPostBack="True" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" DropDownCssClass="RadComboBox_Sunset" EmptyMessage="Select a Patient No/Name" EnableEmbeddedSkins="False" EnableLoadOnDemand="True" EnableViewState="false" EnableVirtualScrolling="True" Font-Names="verdana" Font-Size="8.5pt" MarkFirstMatch="True" ShowMoreResultsBox="True" Skin="Sunset" style="color:Black;background-color:White;font-family:Verdana;font-size:8pt;" TabIndex="2" Width="230"> </telerik:RadComboBox> </td> <td align="left" style="width:100px" > <asp:Label ID="Label4" runat="server" Text="Patient Name" Font-Names="Verdana" Font-Size="8.5pt" ForeColor="Maroon"></asp:Label> </td> <td align="left" style="width:200px"> <asp:TextBox ID="txtPatientname" runat="server" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Width="200" Font-Size="8.5pt"></asp:TextBox> </td> </tr> <tr> <td align="left" style="width:100px"> <asp:Label ID="Label5" runat="server" Text="Ward" Font-Names="Verdana" Font-Size="8.5pt" ForeColor="Maroon"></asp:Label></td> <td align="left" style="width:150px"> <asp:TextBox ID="txtWard" runat="server" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="8.5pt"></asp:TextBox> </td> <td align="left" style="width:100px" > <asp:Label ID="Label6" runat="server" Text="Room No" Font-Names="Verdana" Font-Size="8.5pt" ForeColor="Maroon"></asp:Label> </td> <td align="left" style="width:150px"> <asp:TextBox ID="txtRoomno" runat="server" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="8.5pt"></asp:TextBox> </td> </tr> <tr> <td align="left" style="width:100px"> <asp:Label ID="Label7" runat="server" Text="Bed No" Font-Names="Verdana" Font-Size="8.5pt" ForeColor="Maroon"></asp:Label></td> <td align="left" style="width:150px"> <asp:TextBox ID="txtBedno" runat="server" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="8.5pt"></asp:TextBox> </td> <td align="left" style="width:100px" > </td> <td align="left" style="width:150px"> </td> </tr> <tr> <td align="left" colspan="4"> <asp:Panel ID="Panel1" runat="server" Font-Names="Verdana" Font-Size="8.5pt" ForeColor="Maroon" HorizontalAlign="Left"> <fieldset > <legend ><b style="color:Maroon">Equipment Bill</b></legend> <table width="98%" cellpadding="0" cellspacing="0"> <tr> <td align="left" style="font-size: 8.5pt; font-family: Verdana;color:Maroon"> </td> </tr> <tr> <td align="left" style="font-size: 8.5pt; font-family: Verdana;color:Maroon"> </td> </tr> <tr> <td align="center" > <telerik:RadGrid ID="grvEquipDetails" runat="server" AllowSorting="True" AutoGenerateColumns="False" CellSpacing="0" GridLines="None" Skin="Outlook" ShowStatusBar="True" Width="700px" TabIndex="3" > <ClientSettings EnableRowHoverStyle="true"> </ClientSettings> <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Outlook"> </HeaderContextMenu> <MasterTableView CommandItemDisplay="Top" DataKeyNames="doctorid"> <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:GridTemplateColumn FilterControlAltText="Filter column column" HeaderText="S.NO" UniqueName="column"> <EditItemTemplate> <%# Container.DataSetIndex+1 %> </EditItemTemplate> <ItemTemplate> <%# Container.DataSetIndex+1 %> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridBoundColumn DataField="Fdate" FilterControlAltText="Filter Fdate column" HeaderText="FROM DATE" UniqueName="fdate"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Tdate" FilterControlAltText="Filter Tdate column" HeaderText="TO DATE" UniqueName="tdate"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Ecode" FilterControlAltText="Filter Ecode column" HeaderText="EQUIPMENT NAME" UniqueName="Ecode"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Days" FilterControlAltText="Filter Days column" HeaderText="DAYS" UniqueName="Days"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Amount" FilterControlAltText="Filter Amount column" HeaderText="AMOUNT" UniqueName="Amount"> </telerik:GridBoundColumn> <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" ButtonType="ImageButton"> <ItemStyle Width="50px" /> </telerik:GridEditCommandColumn> <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" ConfirmText="Delete this Doctor Name ?" Text="Delete" UniqueName="DeleteColumn1"> <HeaderStyle Width="20px" /> <ItemStyle CssClass="MyImageButton" HorizontalAlign="Center" /> </telerik:GridButtonColumn> </Columns> <EditFormSettings EditFormType="Template"> <EditColumn UniqueName="EditCommandColumn1" FilterControlAltText="Filter EditCommandColumn1 column"></EditColumn> <FormTemplate> <table id="tblDesi" cellspacing="2" cellpadding="1" width="100%" border="1" rules="none" style="border-collapse: collapse; background: white;"> <tr class="EditFormHeader"> <td colspan="2" style="font-size: small; font-family: Verdana;color:Maroon" > <b>Equipment Bill:</b> </td> </tr> <tr> <td align="center"> <table id="Table3" cellspacing="1" cellpadding="1" width="250" border="0"> <tr> <td> </td> <td> </td> </tr> <tr> <td align="left"> <asp:Label ID="label7" Text="From Date:" runat="server" Font-Names="verdana" Font-Size="8.5pt" ForeColor="Maroon" Width="110"></asp:Label> </td> <td align="left"> <telerik:RadDatePicker ID="txtFromdate" runat="server" Culture="English (United States)" onkeypress="return CharOnly()" onkeydown="return noNumbers(event)" MinDate="1900-01-01" Font-Size="8.5pt" Font-Names="verdana" Width="100"> <Calendar ID="Calendar2" runat="server" UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x"></Calendar><DatePopupButton ImageUrl="" HoverImageUrl="" ToolTip="Calendar"></DatePopupButton> <DateInput ID="DateInput2" runat="server" DisplayDateFormat="dd/MM/yyyy" DateFormat="dd/MM/yyyy" ></DateInput> </telerik:RadDatePicker><span style="font-size: 8pt; color: maroon">*</span> </td> <%-- <td> <asp:DropDownList ID="ddlDoc" AppendDataBoundItems="true" runat="server" Width="222px" TabIndex="1" Font-Names="verdana" Font-Size="8.5pt" DataTextField='<%# Bind("doctorid") %>' DataValueField='<%# Bind("doctorid") %>'></asp:DropDownList><span style="font-size: 8pt; color: maroon">*</span> </td>--%> </tr> <tr> <td align="left"> <asp:Label ID="label9" Text="To Date:" runat="server" Font-Names="verdana" Font-Size="8.5pt" ForeColor="Maroon" Width="110"></asp:Label> </td> <td align="left"> <telerik:RadDatePicker ID="txtToDate" runat="server" Culture="English (United States)" onkeypress="return CharOnly()" onkeydown="return noNumbers(event)" Font-Size="8.5pt" Font-Names="verdana" Width="100"> <Calendar ID="Calendar1" runat="server" UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x"></Calendar> <DatePopupButton ImageUrl="" HoverImageUrl="" ToolTip="Calendar"></DatePopupButton> <DateInput ID="DateInput1" runat="server" DisplayDateFormat="dd/MM/yyyy" DateFormat="dd/MM/yyyy" ></DateInput> </telerik:RadDatePicker><span style="font-size: 8pt; color: maroon">*</span> </td> </tr> <tr> <td align="left"> <asp:Label ID="label10" Text="Equipment Name:" runat="server" Font-Names="verdana" Font-Size="8.5pt" ForeColor="Maroon" Width="110"></asp:Label> </td> <td align="left"> <telerik:RadComboBox ID="ddlEuipment" runat="server" AutoPostBack="True" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" DropDownCssClass="RadComboBox_Sunset" EmptyMessage="Select a EquipmentName" EnableEmbeddedSkins="False" EnableLoadOnDemand="True" EnableViewState="false" EnableVirtualScrolling="True" Font-Names="verdana" Font-Size="8.5pt" MarkFirstMatch="True" ShowMoreResultsBox="True" Skin="Sunset" style="color:Black;background-color:White;font-family:Verdana;font-size:8pt;" TabIndex="2" Width="230"> </telerik:RadComboBox></td> </tr> <tr> <td align="left"> <asp:Label ID="label11" Text="Days:" runat="server" Font-Names="verdana" Font-Size="8.5pt" ForeColor="Maroon" Width="110"></asp:Label> </td> <td align="left"> <asp:TextBox ID="txtDays" runat="server" Font-Names="verdana" Font-Size="8.5pt" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px"></asp:TextBox> </td> </tr> <tr> <td align="left"> <asp:Label ID="label12" Text="Amount:" runat="server" Font-Names="verdana" Font-Size="8.5pt" ForeColor="Maroon" Width="110"></asp:Label> </td> <td align="left"> <asp:TextBox ID="txtAmount" runat="server" Font-Names="verdana" Font-Size="8.5pt" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px"></asp:TextBox></td> </tr> </table> </td> </tr> <%--<tr> <td align="right" colspan="2"> <asp:Button ID="btnUpdate1" Text='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "Insert", "Update") %>' Style="color: White; background-color: SteelBlue; font-family: Verdana; font-size: 8pt; width: 87px;" runat="server" CommandName='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "PerformInsert", "Update")%>' OnClientClick="return ValidName()" CausesValidation="true" AccessKey="I" ToolTip="Alt+i" TabIndex="7"> </asp:Button> <asp:Button ID="btnCancel1" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel" Style="color: White; background-color: SteelBlue; font-family: Verdana; font-size: 8pt; width: 87px;" AccessKey="C" ToolTip="Alt+c" TabIndex="8"></asp:Button> </td> </tr>--%> <tr> <td colspan="2" align="center" style="padding-left:65px" > <asp:ImageButton ID="btnUpdate1" AccessKey="S" ToolTip="Save" runat="server" Text='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "Insert", "Update" ) %>' ImageUrl="~/Images/save.jpg" CommandName='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "PerformInsert", "Update")%>' OnClientClick="OnClientClick(); return false;" /> <asp:ImageButton ID="btnCancel1" runat="server" CausesValidation="false" CommandName="Cancel" ImageUrl="~/Images/cancelbtn.jpg" ToolTip="Cancel"/> </td> </tr> </table> </FormTemplate> </EditFormSettings> </MasterTableView> <FilterMenu EnableImageSprites="False"> </FilterMenu> </telerik:RadGrid> </td> </tr> <tr> <td> </td> </tr> </table> </fieldset></asp:Panel> </td> </tr> </table> </td> </tr> <tr> <td align="center"> <asp:Button ID="btnAdd" runat="server" Text="Add" AccessKey="A" ToolTip="Alt+a" style="color:White;background-color:SteelBlue;font-family:Verdana;font-size:8.5pt;" Width="80px" /> <asp:Button ID="btnEdit" runat="server" Text="Edit" AccessKey="E" ToolTip="Alt+e" style="color:White;background-color:SteelBlue;font-family:Verdana;font-size:8.5pt;" Width="80px" /> <asp:Button ID="btnSave" runat="server" Text="Save" AccessKey="S" ToolTip="Alt+s" style="color:White;background-color:SteelBlue;font-family:Verdana;font-size:8.5pt;" Width="80px" /> <asp:Button ID="btnDel" runat="server" Text="Delete" AccessKey="D" ToolTip="Alt+d" style="color:White;background-color:SteelBlue;font-family:Verdana;font-size:8.5pt;" Width="80px" /> <asp:Button ID="btnClear" runat="server" Text="Clear" AccessKey="C" ToolTip="Alt+c" style="color:White;background-color:SteelBlue;font-family:Verdana;font-size:8.5pt;" Width="80px" /> <asp:Button ID="btnPrint" runat="server" Text="Print" AccessKey="P" ToolTip="Alt+p" style="color:White;background-color:SteelBlue;font-family:Verdana;font-size:8.5pt;" Width="80px" /> </td> </tr> <tr> <td align="center"> <asp:Label ID="lblResult" runat="server" Font-Bold="True" Font-Names="Verdana" Font-Size="8.5pt" ForeColor="Maroon" Width="448px"></asp:Label> <asp:TextBox ID="txtSpeNo" runat="server" BorderStyle="None" ForeColor="White" Height="10px" Width="100px"></asp:TextBox> <asp:TextBox ID="txtGrid" runat="server" BorderStyle="None" ForeColor="White" Height="10px" Width="100px"></asp:TextBox> </td> </tr> </table> </ContentTemplate> </asp:UpdatePanel> </td> </tr> </table> <telerik:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column" UniqueName="DeleteColumn" HeaderText="Delete"> <ItemTemplate> <asp:ImageButton ID="btTrash" ImageUrl="/BSS/Admin/resources/Trash.png" runat="server" OnClientClick="DeleteEntry" ></asp:ImageButton> </ItemTemplate> </telerik:GridTemplateColumn>function rgUpdateConfigSummary_OnRowDataBound(sender, args) { //var dataItem = args.get_gridDataItem(); var SiteID = glbl_SiteID; var prodID = args.get_dataItem().ProductID; var GenID = args.get_dataItem().GenerationID; var DeleteLink = args.get_item().get_cell("DeleteColumn").getElementsByTagName('input')[0]; var attrib_href = document.createAttribute('href'); attrib_href.value = '#'; DeleteLink.setAttributeNode(attrib_href); DeleteLink.removeAttribute("onclick"); var attrib_onClick = document.createAttribute('onclick'); attrib_onClick.value = 'showDeleteConfirm(' + prodID + ',' + GenID + ',"' + SiteID + '"); '; DeleteLink.setAttributeNode(attrib_onClick); }function showDeleteConfirm(prodID, GenID, SiteID) { radconfirm('Client radconfirm: Are you sure?', function () { confirmDelete(prodID, GenID, SiteID); }, 330, 100, null, 'Client RadConfirm', imgUrl); return false; }function confirmDelete(prodID, GenID, SiteID) { var service = new tempuri.org.ImyService(); alert(prodID + GenID + SiteID); service.Delete(SiteID, prodID, GenID, rebindandclose); return false; }Hi all,
Im using the latest telerik rad ajax controls (ASP.NET AJAX Q1 2012 version 12.1.215.0). I have a treelist which has a template column whereby I placed a combobox in it. What my page does is I allow the user to select options in the combobox and when they click the save button, my function will create 1 record per row which has a selected option in the comboboxes. Here is my code
<telerik:RadAjaxLoadingPanel ID="RadTreeAjax" runat="server" Skin="Windows7" EnableSkinTransparency="False" Transparency="30" /> <telerik:RadTreeList ID="RadTreeList1" runat="server" AllowPaging="true" PageSize="15" Skin="Windows7" OnNeedDataSource="RadTreeList1_OnNeedDataSource" OnItemDataBound="RadTreeList1_OnItemDataBound" AutoGenerateColumns="false" AllowSorting="true" DataKeyNames="ParentId" ParentDataKeyNames="GoalId" Width="1070px" GridLines="None" > <Columns> <telerik:TreeListBoundColumn DataField="Id" UniqueName="Id" HeaderText="Id" Visible="false" /> <telerik:TreeListBoundColumn DataField="ParentId" UniqueName="ParentId" HeaderText="ParentId" Visible="false" /> <telerik:TreeListBoundColumn DataField="GoalId" UniqueName="GoalId" HeaderText="GoalId" Visible="false" /> <telerik:TreeListBoundColumn DataField="InterventionId" UniqueName="InterventionId" HeaderText="InterventionId" Visible="false" /> <telerik:TreeListBoundColumn DataField="Goal" UniqueName="Goal" HeaderText="Goal" ItemStyle-Width="320px" HeaderStyle-Width="320px" /> <telerik:TreeListBoundColumn DataField="Intervention" UniqueName="Intervention" HeaderText="Intervention" ItemStyle-Width="495px" HeaderStyle-Width="495px" /> <telerik:TreeListTemplateColumn UniqueName="GoalStatus" HeaderText="Status" ItemStyle-Width="100px" HeaderStyle-Width="100px" > <ItemTemplate> <telerik:RadComboBox ID="ddlGoalStatus" Width="90px" Filter="StartsWith" AllowCustomText="true" EmptyMessage="" AutoPostBack="true" EnableViewState="true" runat="server" Skin="Windows7" CssClass="tabbar_tasklist_last" RegisterWithScriptManager="False"> </telerik:RadComboBox> </ItemTemplate> </telerik:TreeListTemplateColumn> <telerik:TreeListTemplateColumn UniqueName="InterventionStatus" ItemStyle-Width="105px" HeaderStyle-Width="105px" > <ItemTemplate> <telerik:RadComboBox ID="ddlInterventionStatus" Width="95px" Filter="StartsWith" AllowCustomText="true" EmptyMessage="" AutoPostBack="true" runat="server" Skin="Windows7" CssClass="tabbar_tasklist_last" RegisterWithScriptManager="False"> </telerik:RadComboBox> </ItemTemplate> </telerik:TreeListTemplateColumn> </Columns> </telerik:RadTreeList>protected void RadTreeList1_OnNeedDataSource(object sender, TreeListNeedDataSourceEventArgs e) { RadTreeList1.DataSource = GetGoalsAndInterventions(); } protected void RadTreeList1_OnItemDataBound(object sender, Telerik.Web.UI.TreeListItemDataBoundEventArgs e) { if (e.Item is TreeListDataItem) { TreeListDataItem dataItem = e.Item as TreeListDataItem; RadComboBox ddlGoalStatus = (RadComboBox)e.Item.FindControl("ddlGoalStatus"); RadComboBox ddlInterventionStatus = (RadComboBox)e.Item.FindControl("ddlInterventionStatus"); ddlGoalStatus.DataSource = GetGoalStatusMaster(); ddlGoalStatus.DataValueField = "GoalStatusId"; ddlGoalStatus.DataTextField = "Value"; ddlGoalStatus.DataBind(); ddlInterventionStatus.DataSource = GetInterventionStatusMaster(); ddlInterventionStatus.DataValueField = "InterventionStatusId"; ddlInterventionStatus.DataTextField = "Value"; ddlInterventionStatus.DataBind(); if (dataItem.ItemType == TreeListItemType.Item || dataItem.ItemType == TreeListItemType.AlternatingItem) { TableCell cell = dataItem["ParentId"]; string value = cell.Text; if (value != " ") { ddlInterventionStatus.Visible = false; ddlGoalStatus.Visible = true; } TableCell cell2 = dataItem["InterventionId"]; string value2 = cell2.Text; if (value2 != " ") { ddlGoalStatus.Visible = false; ddlInterventionStatus.Visible = true; } } } }private void SaveGoalStatus() { // delete all goal status from database DeleteInterventionStatus(); DeleteGoalStatus(); foreach (TreeListDataItem item in RadTreeList1.Items) { string s1 = string.Empty; string s2 = string.Empty; RadComboBox ddlInterventionStatus = (RadComboBox)item.FindControl("ddlInterventionStatus"); if (item.ItemType == TreeListItemType.Item || item.ItemType == TreeListItemType.AlternatingItem) { RadComboBox ddlGoalStatus = (RadComboBox)item.FindControl("ddlGoalStatus"); string s = ddlGoalStatus.SelectedItem.Text; if (ddlGoalStatus.SelectedItem != null) { TableCell cell = item["Id"]; string ProblemGoalId = cell.Text; if (ProblemGoalId != " ") { try { CarePlan_GoalStatus oGoalStatus = new CarePlan_GoalStatus(); oGoalStatus.CarePlanId = this.CarePlanID; oGoalStatus.ProblemGoalId = new Guid(ProblemGoalId); oGoalStatus.GoalStatusId = GetGoalId(s); oGoalStatus.CreatedBy = this.UserId; oGoalStatus.ModifiedBy = this.UserId; oGoalStatus = WCFSvcClient.CCITDataService.Insert(oGoalStatus) as CarePlan_GoalStatus; } catch (Exception ex) { lblMessage.Text = "Create Goal Status" + ex.Message; } } } } if (ddlInterventionStatus.SelectedItem != null) { if (item.ItemType == TreeListItemType.Item || item.ItemType == TreeListItemType.AlternatingItem) { TableCell cell = item["Id"]; string GoalInterventionId = cell.Text; if (GoalInterventionId != " ") { try { CarePlan_InterventionStatus oInterventionStatus = new CarePlan_InterventionStatus(); oInterventionStatus.CarePlanId = this.CarePlanID; oInterventionStatus.GoalInterventionId = new Guid(GoalInterventionId); oInterventionStatus.InterventionStatusId = new Guid(ddlInterventionStatus.SelectedItem.Value); oInterventionStatus.CreatedBy = this.UserId; oInterventionStatus.ModifiedBy = this.UserId; oInterventionStatus = WCFSvcClient.CCITDataService.Insert(oInterventionStatus) as CarePlan_InterventionStatus; } catch (Exception ex) { lblMessage.Text = "Create Intervention Status" + ex.Message; } } } #region Populate Info On Page BindToViewState(); // call first to populate the ddlSection selection DisplayCarePlanInfoOnPage(); // the values are originally populated on selected change of ddlSection but due to population of data on first load of page // the page has no selected index change, this this has to be done manually GetProblemBySection(ddlSection.SelectedItem.Value); // call again to GET the selected value of ddlProblem DisplayCarePlanInfoOnPage(); foreach (DataRow row in ProblemTable.Rows) { if (row["Value"].ToString() == ddlProblem.SelectedItem.Text) txtProblemDescription.Text = row["Description"].ToString(); } #endregion } } }
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="ddlSection"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="ddlSection" /> <telerik:AjaxUpdatedControl ControlID="ddlProblem" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="ddlProblem"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="ddlProblem" /> <telerik:AjaxUpdatedControl ControlID="txtProblemDescription" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="RadTreeList1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadTreeList1" LoadingPanelID="RadTreeAjax" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="cpTB"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="CarePlanPanel" LoadingPanelID="CarePlanAjax" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="btnSearch"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="Panel1" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager>As you can see, I bind my comboboxes in the itemdatabound and in my Save function what I do is I clear my database table and then I reinsert new rows into the table based on rows in the treelist which has a selected value in the combobox. As for now I am only testing based on ddlGoalStatus combobox so please ignore the ddlInterventionStatus combobox. In my save function, I have a line which says "string s = ddlGoalStatus.SelectedItem.Text;" and the value I retrieved is ALWAYS the previous value and not the newly selected value. Am I doing anything wrong?
Please help.
Thanks!
function UsernameTextBoxValueChanged(sender, eventArgs) { if (trimSearchTerm(sender.get_value()) == "") sender._invalid = true; else sender._invalid = false; sender.updateCssClass(); return false; } function PasswordTextBoxValueChanged(sender, eventArgs) { if (trimSearchTerm(sender.get_value()) == "") sender._invalid = true; else sender._invalid = false; sender.updateCssClass(); return false; }<telerik:RadTextBox ID="radTextBoxUsername" runat="server" CssClass="inputBox" ClientEvents-OnKeyPress="OnKeyPress" MaxLength="16" ClientEvents-OnBlur="UsernameTextBoxValueChanged" SelectionOnFocus="SelectAll"> <ClientEvents OnKeyPress="OnKeyPress" OnBlur="UsernameTextBoxValueChanged"></ClientEvents> <InvalidStyle CssClass="inputBoxInvalid" /> </telerik:RadTextBox><br /> <telerik:RadTextBox ID="radTextBoxPassword" runat="server" CssClass="inputBox" ClientEvents-OnKeyPress="OnKeyPress" MaxLength="16" ClientEvents-OnBlur="PasswordTextBoxValueChanged" SelectionOnFocus="SelectAll" TextMode="Password"> <ClientEvents OnKeyPress="OnKeyPress" OnBlur="PasswordTextBoxValueChanged"></ClientEvents> <InvalidStyle CssClass="inputBoxInvalid" /> </telerik:RadTextBox><br /><form id="formLogon" runat="server" onsubmit="return validateForm();">function validateForm() { var error = 0; var userNameCtl = document.getElementById('<%= radTextBoxUsername.ClientID %>'); var passwordCtl = document.getElementById('<%= radTextBoxPassword.ClientID %>'); var userNameCtlRef = $find("<%= radTextBoxUsername.ClientID %>"); var passwordCtlRef = $find("<%= radTextBoxPassword.ClientID %>"); if (trimSearchTerm(passwordCtl.value) == "") { passwordCtl._invalid = true; error = 1; //showErrorTip(passwordCtl, "Password is required"); //passwordCtl.style.background = '#F08080 !important'; } else { passwordCtl._invalid = false; //passwordCtl.style.background = '#FFFFFF !important'; } if (trimSearchTerm(userNameCtl.value) == "") { userNameCtl._invalid = true; error = 1; //showErrorTip(userNameCtl, "Username is required"); //userNameCtl.style.background = '#F08080 !important'; } else { userNameCtl._invalid = false; //userNameCtl.style.background = '#FFFFFF !important'; } userNameCtlRef.updateCssClass(); passwordCtlRef.updateCssClass(); if (error == 1) return false; return true; }<telerik:RadNumericTextBox ID="RadNumericTextBox1" runat="server" Value="55.55"> </telerik:RadNumericTextBox> <telerik:RadNumericTextBox ID="RadNumericTextBox2" runat="server" ReadOnly="true" Value="22.22"> </telerik:RadNumericTextBox>