Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
194 views

Hello,

I have a page with rad tab there is in that there is radiobuttons. Radwindow is opening  from server side. On click of radiobutton radwindow should open without postback. I have used update panel for stoping postback so when i am clicking on radiobutton radwindow is opening without postback bt when i want to close , cancle , ok radwindow that time page is getting postback for that plz help me to stop postback.

Below I have attached code which i have tried:

javascript code

<script type="text/javascript">
function ExtraFixedFnctn1(arg) {
            if (arg) {
                $get("<%= hdfPrompt1.ClientID %>").value = arg;
                __doPostBack();
            }
            else if (!arg) {
                $get("<%= hdfPrompt1.ClientID %>").value = arg;
                    __doPostBack();
                }
        }
        function ExtraFixedFnctn2(arg) {
            if (arg) {
                $get("<%= hdfPrompt2.ClientID %>").value = arg;
                __doPostBack();
            }
            else if (!arg) {
                $get("<%= hdfPrompt2.ClientID %>").value = arg;
                        __doPostBack();
                    }
            }
            function ExtraFixedFnctn3(arg) {
                if (arg) {
                    $get("<%= hdfPrompt3.ClientID %>").value = arg;
                    __doPostBack();
                }
                else if (!arg) {
                    $get("<%= hdfPrompt3.ClientID %>").value = arg;
                        __doPostBack();
                    }
            }
            function ExtraFixedFnctn4(arg) {
                if (arg) {
                    $get("<%= hdfPrompt4.ClientID %>").value = arg;
                    __doPostBack();
                }
                else if (!arg) {
                    $get("<%= hdfPrompt4.ClientID %>").value = arg;
                    __doPostBack();
                }
        }
</script>

.aspx code

<telerik:RadWindowManager ID="RadWindowManager2" runat="server" Skin="Office2007">
    </telerik:RadWindowManager>
    <asp:HiddenField runat="server" ID="hdfPrompt1" Value="" />
    <asp:HiddenField runat="server" ID="hdfPrompt2" Value="" />
    <asp:HiddenField runat="server" ID="hdfPrompt3" Value="" />
    <asp:HiddenField runat="server" ID="hdfPrompt4" Value="" />
 <asp:UpdatePanel ID="Updatepanel1" runat="server" UpdateMode="Conditional">
                        <ContentTemplate>
<telerik:RadPageView runat="server" ID="TaxInfo" TabIndex="2" Font-Names="Arial" ForeColor="DarkBlue">
                <br />
                 
                <table>
                    <tr>
                        <td style="text-align: center;" colspan="4">
                            <asp:Label runat="server" ID="lblTaxInfoError" SkinID="Error" ForeColor="Red"></asp:Label>
                        </td>
                    </tr>
                </table>
 
                <div align="left" style="padding-left: 5px">
                    <table>
                        <tr>
                            <td style="text-align: center; font-weight: bold; font-size: medium; text-decoration: underline; font-family: Arial, Helvetica, sans-serif;" colspan="2">Federal</td>
                            <td style="text-align: center; font-weight: bold; font-size: medium; text-decoration: underline; font-family: Arial, Helvetica, sans-serif;" colspan="2">State</td>
                            <td></td>
                        </tr>
                        <tr>
                            <td style="text-align: left; padding-left: 4px" class="auto-style23" colspan="2">
                                 
 
                            </td>
 
                            <td style="text-align: left">
                                <asp:Label ID="Label6" ForeColor="Red" runat="server" Text="*"></asp:Label>Withholding State: </td>
 
                            <td>
                                <div class="selectWrapper" style="border: 1px  solid red">
                                    <asp:DropDownList ID="ddlStateWithHoldingState" runat="server" CssClass="selectBox">
                                    </asp:DropDownList>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td style="text-align: left">Marital Status: </td>
                            <td class="auto-style17">
                                <div class="selectWrapper">
                                    <asp:DropDownList ID="ddlFedMarital" runat="server" CssClass="selectBox">
                                    </asp:DropDownList>
                                </div>
                            </td>
                            <td style="text-align: left">Marital Status:
                            </td>
                            <td>
                                <div class="selectWrapper">
                                    <asp:DropDownList ID="ddlStateMarital" runat="server" CssClass="selectBox">
                                    </asp:DropDownList>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td style="text-align: left" class="auto-style18">Exemptions:
                            </td>
                            <td class="auto-style19">
                                <asp:TextBox ID="txtFedExempt" runat="server" Width="30px" MaxLength="2" onfocus="this.select()" CssClass="input"></asp:TextBox>
                                <asp:RegularExpressionValidator ID="reFederalExemptions" runat="server" ValidationGroup="EmployeeUpdate" ControlToValidate="txtFedExempt" ValidationExpression="^\d+$" ErrorMessage="Only numeric values are allowed." ForeColor="red" SetFocusOnError="true" Font-Size="Small"></asp:RegularExpressionValidator>
                            </td>
                            <td style="text-align: left" class="auto-style18">Exemptions:
                            </td>
                            <td class="auto-style18">
                                <asp:TextBox ID="txtStateExempt" onfocus="this.select()" runat="server" Width="30px" MaxLength="2" CssClass="input"></asp:TextBox>
                                <asp:RegularExpressionValidator ID="reStateExemptions" runat="server" ControlToValidate="txtStateExempt" ValidationExpression="^\d+$" ValidationGroup="EmployeeUpdate"
                                    ErrorMessage="Only numeric values are allowed." ForeColor="red" SetFocusOnError="true"></asp:RegularExpressionValidator>
                            </td>
                        </tr>
                        <tr>
                            <td></td>
                            <td>
                                <asp:RadioButton ID="rbFedExtra" runat="server" Text="Extra" OnCheckedChanged="rbFedExtra_CheckedChanged" GroupName="R1" AutoPostBack="true" />
                                <asp:RadioButton ID="rbFedFixed" runat="server" Text="Fixed" OnCheckedChanged="rbFedFixed_CheckedChanged" GroupName="R1" AutoPostBack="true" />
                            </td>
                            <td></td>
                            <td>
                                <asp:RadioButton ID="rbStateExtra" runat="server" Text="Extra" OnCheckedChanged="rbStateExtra_CheckedChanged" GroupName="R2" AutoPostBack="true" />
                                <asp:RadioButton ID="rbStateFixed" runat="server" Text="Fixed" OnCheckedChanged="rbStateFixed_CheckedChanged" GroupName="R2" AutoPostBack="true" />
                            </td>
                        </tr>
                        <tr>
                            <td style="text-align: left">Extra Withholding:
                            </td>
                            <td class="auto-style17">
                                <asp:RadioButton ID="rbFedExtraDollar" runat="server" Text="$" GroupName="Radio1" OnCheckedChanged="rbFedExtraDollar_CheckedChanged" AutoPostBack="true" Checked="true" />
                                <asp:RadioButton ID="rbFedExtraPercent" runat="server" Text="%" GroupName="Radio1" OnCheckedChanged="rbFedExtraPercent_CheckedChanged" AutoPostBack="true" />
                                <telerik:RadNumericTextBox ID="txtFEDExtraWH" runat="server" Width="70px" NumberFormat-DecimalDigits="2" SelectionOnFocus="SelectAll" mask="nnnnnn.nn" MaxValue="999999.99" MinValue="000000.00" AllowOutOfRangeAutoCorrect="False"></telerik:RadNumericTextBox>
                                <br />
                                 
                                <asp:RegularExpressionValidator runat="server" ID="revFedExtraPercent" ControlToValidate="txtFEDExtraWH" Enabled="false"
                                    ErrorMessage="Enter value between 0 to 100" ForeColor="Red" ValidationGroup="EmployeeUpdate"
                                    ValidationExpression="^100(\.0{0,2}?)?$|^\d{0,2}(\.\d{0,2})?$" Display="Dynamic" SetFocusOnError="True">                    
                                </asp:RegularExpressionValidator>
                            </td>
                            <td style="text-align: left">Extra Withholding:
                            </td>
                            <td>
                                <asp:RadioButton ID="rbStateExtraDollar" runat="server" Text="$" GroupName="Radio2" OnCheckedChanged="rbStateExtraDollar_CheckedChanged" AutoPostBack="true" Checked="true" />
                                <asp:RadioButton ID="rbStateExtraPercent" runat="server" Text="%" GroupName="Radio2" AutoPostBack="true" OnCheckedChanged="rbStateExtraPercent_CheckedChanged" />
                                <telerik:RadNumericTextBox ID="txtStateExtraWH" runat="server" Width="70px" NumberFormat-DecimalDigits="2" SelectionOnFocus="SelectAll" mask="nnnnnn.nn" AllowOutOfRangeAutoCorrect="False" MaxValue="999999.99" MinValue="000000.00"></telerik:RadNumericTextBox>
                                <br />
                                
                                <asp:RegularExpressionValidator runat="server" ID="revStateExtraPercent" ControlToValidate="txtStateExtraWH" Enabled="false"
                                    ErrorMessage="Enter value between 0 to 100" ForeColor="Red" ValidationGroup="EmployeeUpdate"
                                    ValidationExpression="^100(\.0{0,2}?)?$|^\d{0,2}(\.\d{0,2})?$" Display="Dynamic" SetFocusOnError="True">                    
                                </asp:RegularExpressionValidator>
                            </td>
                        </tr>
                        <br />
                        <tr>
                            <td style="text-align: left">Fixed Withholding:
                            </td>
                            <td class="auto-style17">
                                <asp:RadioButton ID="rbIsDollarFederal" runat="server" Text="$" GroupName="Radio" AutoPostBack="true" OnCheckedChanged="rbIsDollarFederal_CheckedChanged" Checked="true" />
                                <asp:RadioButton ID="rbIsPercentFederal" runat="server" Text="%" GroupName="Radio" AutoPostBack="true" OnCheckedChanged="rbIsPercentFederal_CheckedChanged" />
                                <telerik:RadNumericTextBox ID="txtFedFixedWH" runat="server" Enabled="true" Width="70px" NumberFormat-DecimalDigits="2" SelectionOnFocus="SelectAll" mask="nnnnnn.nn" MaxValue="999999.99" MinValue="000000.00" AllowOutOfRangeAutoCorrect="False"></telerik:RadNumericTextBox>
                                <br />
                                <%--<asp:RegularExpressionValidator runat="server" ID="revdedamt" ValidationExpression="^[0-9]\d{0,9}(\.\d{1,2})?%?$" ValidationGroup="EmployeeUpdate"
                                    ErrorMessage="Enter only positive integer" ForeColor="Red" ControlToValidate="RadtxtFixedFederalWithholding" Display="Dynamic">
                                </asp:RegularExpressionValidator>
                                <br />--%>
                                <asp:RegularExpressionValidator runat="server" ID="rvFedWithholding" ControlToValidate="txtFedFixedWH" Enabled="false"
                                    ErrorMessage="Enter value between 0 to 100" ForeColor="Red" ValidationGroup="EmployeeUpdate"
                                    ValidationExpression="^100(\.0{0,2}?)?$|^\d{0,2}(\.\d{0,2})?$" Display="Dynamic" SetFocusOnError="True">                    
                                </asp:RegularExpressionValidator>
                                
                            </td>
                            <td style="text-align: left">Fixed Withholding:
                            </td>
                            <td>
                                <asp:RadioButton ID="rbIsDollarState" runat="server" Text="$" GroupName="Radio4" AutoPostBack="true" OnCheckedChanged="rbIsDollarState_CheckedChanged" Checked="true" />
                                <asp:RadioButton ID="rbIsPercentState" runat="server" Text="%" GroupName="Radio4" AutoPostBack="true" OnCheckedChanged="rbIsPercentState_CheckedChanged" />
                                <telerik:RadNumericTextBox ID="txtStateFixedWH" runat="server" Enabled="true" Width="70px" NumberFormat-DecimalDigits="2" SelectionOnFocus="SelectAll" mask="nnnnnn.nn" MaxValue="999999.99" MinValue="000000.00" AllowOutOfRangeAutoCorrect="False"></telerik:RadNumericTextBox>
                                <br />
                                 
                                <asp:RegularExpressionValidator runat="server" ID="rvStateWithholding" ControlToValidate="txtStateFixedWH" Enabled="false"
                                    ErrorMessage="Enter value between 0 to 100" ForeColor="Red" ValidationGroup="EmployeeUpdate"
                                    ValidationExpression="^100(\.0{0,2}?)?$|^\d{0,2}(\.\d{0,2})?$" Display="Dynamic" SetFocusOnError="True">                    
                                </asp:RegularExpressionValidator>
                               </td>
                        </tr>
 
                        <tr>
 
                            <td></td>
                            <td></td>
                            <td>
                                <asp:Label ID="Label7" ForeColor="Red" runat="server" Text="*" />SUI State:
                            </td>
                            <td>
                                <div class="selectWrapper" style="border: 1px  solid red">
                                    <asp:DropDownList ID="ddlSUIState" runat="server" CssClass="selectBox">
                                    </asp:DropDownList>
                                </div>
                            </td>
                        </tr>
                        <tr>
 
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td style="text-align: left">Non-taxable pay only:
                            </td>
                            <td class="auto-style17">
                                <asp:CheckBox ID="chkNonTaxableApayAmount" runat="server" AutoPostBack="true" OnCheckedChanged="chkNonTaxableApayAmount_CheckedChanged"></asp:CheckBox>
                            </td>
                            <td style="text-align: left; visibility: hidden">Local Marital Status:
                            </td>
                            <td style="visibility: hidden">
                                <div class="selectWrapper">
                                    <asp:DropDownList ID="ddlLocalMaritalStatus" runat="server" CssClass="selectBox">
                                    </asp:DropDownList>
                                </div>
                            </td>
 
                        </tr>
                        <tr>
                            <td style="text-align: left">OASDI Exempt:
                            </td>
                            <td class="auto-style17">
                                <asp:CheckBox ID="chkOASDIExempt" runat="server"></asp:CheckBox>
                            </td>
                            <td style="text-align: left; visibility: hidden">Local Exemptions:
                            </td>
                            <td style="visibility: hidden">
                                <asp:TextBox ID="txtLocalExemptions" runat="server" Width="30px" MaxLength="2"></asp:TextBox>
                            </td>
 
                        </tr>
                        <tr>
                            <td style="text-align: left">Medicare Exempt:
                            </td>
                            <td class="auto-style17">
                                <asp:CheckBox ID="chkMedicareExempt" runat="server"></asp:CheckBox>
                            </td>
                            <td style="text-align: left; visibility: hidden">Extra Local Withholding:
                            </td>
                            <td style="visibility: hidden">
                                <telerik:RadNumericTextBox ID="RadtxtExtraLocalWithholding" runat="server" Width="70px" NumberFormat-DecimalDigits="2" SelectionOnFocus="SelectAll" mask="nnnnnn.nn"></telerik:RadNumericTextBox>
 
                            </td>
 
                        </tr>
                        <tr>
 
                            <td style="text-align: left; visibility: hidden">Fixed Local Withholding:
                            </td>
                            <td style="visibility: hidden">
                                <asp:RadioButton ID="rbIsDollarLocal" runat="server" Text="$" GroupName="Radio3" Checked="true" />
                                <asp:RadioButton ID="rbIsPercentLocal" runat="server" Text="%" GroupName="Radio3" />
                                <telerik:RadNumericTextBox ID="RadtxtFixedLocalWithholding" runat="server" Enabled="true" Width="70px" NumberFormat-DecimalDigits="2" SelectionOnFocus="SelectAll" mask="nnnnnn.nn"></telerik:RadNumericTextBox>
 
                            </td>
 
                        </tr>
 
                    </table>
                </div>
                        
            </telerik:RadPageView>
 </ContentTemplate>
                    </asp:UpdatePanel>

.aspx.cs code

protected void rbFedExtra_CheckedChanged(object sender, EventArgs e)
        {
            EmployeePortal.Models.NCI.NCIEntities ent = EmployeePortal.Models.ClsNCIUtil.GetNCIEntity(Session["CustomerID"].ToString());
            using (ent)
            {
                var FedExtra = (ent.EmployeeTaxes.Where(a => a.EmployeeId == empno && a.TaxTypeId == 4)).FirstOrDefault();//extra
                if (FedExtra == null)
                {
                    txtFEDExtraWH.Enabled = true;
                    rbFedExtraDollar.Enabled = true;
                    rbFedExtraPercent.Enabled = true;
                    txtFedFixedWH.Text = null;
                    txtFedFixedWH.Enabled = false;
                    rbIsDollarFederal.Enabled = false;
                    rbIsPercentFederal.Enabled = false;
                }
                else
                {
                    if (hdfPrompt1.Value == "")
                    {
                        RadWindowManager2.RadConfirm("Extra amounts override Fixed amounts. Fixed amount will be cleared.  Press OK to continue or Cancel to return to your changes.", "ExtraFixedFnctn1", 400, 150, null, "Extra/Fixed");
                    }
                    else if (hdfPrompt1.Value == "true")
                    {
                        txtFedFixedWH.Text = null;
                        txtFedFixedWH.Enabled = false;
                        rbIsDollarFederal.Enabled = false;
                        rbIsPercentFederal.Enabled = false;
                        txtFEDExtraWH.Enabled = true;
                        rbFedExtraDollar.Enabled = true;
                        rbFedExtraPercent.Enabled = true;
                        var PercentFedExtra = (ent.EmployeeTaxes.Where(a => a.EmployeeId == empno && a.TaxTypeId == 1)).FirstOrDefault();//extra
                        if (PercentFedExtra != null && PercentFedExtra.TaxCalcId == 1)
                        {
                            rbIsDollarFederal.Checked = true;
                            rbIsPercentFederal.Checked = false;
                        }
                        if (PercentFedExtra != null && PercentFedExtra.TaxCalcId == 2)
                        {
                            rbIsPercentFederal.Checked = true;
                            rbIsDollarFederal.Checked = false;
                        }
                        var EmpFedFixed = (from a in ent.EmployeeTaxes
                                           where a.EmployeeId == empno && (a.TaxTypeId == 1)
                                           select new { a.EmployeeId, a.MaritalStatus, a.NumExemptions, a.Amount, a.TaxCalcId }).FirstOrDefault();
                        if (EmpFedFixed != null)
                        {
                            if (EmpFedFixed.Amount == null || EmpFedFixed.Amount == 0)
                                txtFEDExtraWH.Text = "0.00";
                            else
                                txtFEDExtraWH.Text = (EmpFedFixed.Amount).ToString();
                        }
                        var PercentFedFixed = (ent.EmployeeTaxes.Where(a => a.EmployeeId == empno && a.TaxTypeId == 4)).FirstOrDefault();//fixed
                        if (PercentFedFixed != null && PercentFedFixed.TaxCalcId == 1)
                        {
                            rbFedExtraDollar.Checked = true;
                            rbFedExtraPercent.Checked = false;
                        }
                        if (PercentFedFixed != null && PercentFedFixed.TaxCalcId == 2)
                        {
                            rbFedExtraDollar.Checked = false;
                            rbFedExtraPercent.Checked = true;
                        }
                        var EmpFedExtra = (from a in ent.EmployeeTaxes
                                           where a.EmployeeId == empno && (a.TaxTypeId == 4)
                                           select new { a.EmployeeId, a.MaritalStatus, a.NumExemptions, a.Amount, a.TaxCalcId }).FirstOrDefault();
                        if (EmpFedExtra != null)
                        {
                            if (EmpFedExtra.Amount == null || EmpFedExtra.Amount == 0)
                                txtFEDExtraWH.Text = "0.00";
                            else
                                txtFEDExtraWH.Text = (EmpFedExtra.Amount).ToString();
                        }
                        hdfPrompt1.Value = "";
                    }
                    else if (hdfPrompt1.Value == "false")
                    {
                        rbFedExtra.Checked = false;
                        rbFedFixed.Checked = true;
                        hdfPrompt1.Value = "";
                    }
                }
            }
        }
        protected void rbFedFixed_CheckedChanged(object sender, EventArgs e)
        {
            EmployeePortal.Models.NCI.NCIEntities ent = EmployeePortal.Models.ClsNCIUtil.GetNCIEntity(Session["CustomerID"].ToString());
            using (ent)
            {
                var FedFixed = (ent.EmployeeTaxes.Where(a => a.EmployeeId == empno && a.TaxTypeId == 1)).FirstOrDefault();//extra
                if (FedFixed == null)
                {
                    txtFedFixedWH.Enabled = true;
                    rbIsDollarFederal.Enabled = true;
                    rbIsPercentFederal.Enabled = true;
                    txtFEDExtraWH.Text = null;
                    txtFEDExtraWH.Enabled = false;
                    rbFedExtraDollar.Enabled = false;
                    rbFedExtraPercent.Enabled = false;
                }
                else
                {
                    if (hdfPrompt2.Value == "")
                    {
                        RadWindowManager2.RadConfirm("Fixed amounts override Extra amounts. Extra amount will be cleared.  Press OK to continue or Cancel to return to your changes.", "ExtraFixedFnctn2", 400, 150, null, "Extra/Fixed");
                    }
                    else if (hdfPrompt2.Value == "true")
                    {
                        txtFEDExtraWH.Text = null;
                        txtFEDExtraWH.Enabled = false;
                        rbFedExtraDollar.Enabled = false;
                        rbFedExtraPercent.Enabled = false;
                        txtFedFixedWH.Enabled = true;
                        rbIsDollarFederal.Enabled = true;
                        rbIsPercentFederal.Enabled = true;
                        var PercentFedExtra = (ent.EmployeeTaxes.Where(a => a.EmployeeId == empno && a.TaxTypeId == 1)).FirstOrDefault();//extra
                        if (PercentFedExtra != null && PercentFedExtra.TaxCalcId == 1)
                        {
                            rbIsDollarFederal.Checked = true;
                            rbIsPercentFederal.Checked = false;
                        }
                        if (PercentFedExtra != null && PercentFedExtra.TaxCalcId == 2)
                        {
                            rbIsDollarFederal.Checked = false;
                            rbIsPercentFederal.Checked = true;
                        }
                        var EmpFedFixed = (from a in ent.EmployeeTaxes
                                           where a.EmployeeId == empno && (a.TaxTypeId == 1)
                                           select new { a.EmployeeId, a.MaritalStatus, a.NumExemptions, a.Amount, a.TaxCalcId }).FirstOrDefault();
                        if (EmpFedFixed != null)
                        {
                            if (EmpFedFixed.Amount == null || EmpFedFixed.Amount == 0)
                                txtFedFixedWH.Text = "0.00";
                            else
                                txtFedFixedWH.Text = (EmpFedFixed.Amount).ToString();
                        }
                        var PercentFedFixed = (ent.EmployeeTaxes.Where(a => a.EmployeeId == empno && a.TaxTypeId == 4)).FirstOrDefault();//fixed
                        if (PercentFedFixed != null && PercentFedFixed.TaxCalcId == 1)
                        {
                            rbFedExtraDollar.Checked = true;
                            rbFedExtraPercent.Checked = false;
                        }
                        if (PercentFedFixed != null && PercentFedFixed.TaxCalcId == 2)
                        {
                            rbFedExtraDollar.Checked = false;
                            rbFedExtraPercent.Checked = true;
                        }
                        var EmpFedExtra = (from a in ent.EmployeeTaxes
                                           where a.EmployeeId == empno && (a.TaxTypeId == 4)
                                           select new { a.EmployeeId, a.MaritalStatus, a.NumExemptions, a.Amount, a.TaxCalcId }).FirstOrDefault();
                        if (EmpFedExtra != null)
                        {
 
                            if (EmpFedExtra.Amount == null || EmpFedExtra.Amount == 0)
                                txtFedFixedWH.Text = "0.00";
                            else
                                txtFedFixedWH.Text = (EmpFedExtra.Amount).ToString();
                        }
                        hdfPrompt2.Value = "";
                    }
                    else if (hdfPrompt2.Value == "false")
                    {
                        rbFedFixed.Checked = false;
                        rbFedExtra.Checked = true;
                        hdfPrompt2.Value = "";
                    }
                }
            }
        }
        protected void rbStateExtra_CheckedChanged(object sender, EventArgs e)
        {
            EmployeePortal.Models.NCI.NCIEntities ent = EmployeePortal.Models.ClsNCIUtil.GetNCIEntity(Session["CustomerID"].ToString());
            using (ent)
            {
                var StateExtra = (ent.EmployeeTaxes.Where(a => a.EmployeeId == empno && a.TaxTypeId == 5)).FirstOrDefault();//extra
                if (StateExtra == null)
                {
                    txtStateExtraWH.Enabled = true;
                    rbStateExtraDollar.Enabled = true;
                    rbStateExtraPercent.Enabled = true;
                    txtStateFixedWH.Text = null;
                    txtStateFixedWH.Enabled = false;
                    rbIsDollarState.Enabled = false;
                    rbIsPercentState.Enabled = false;
                }
                else
                {
                    if (hdfPrompt3.Value == "")
                    {
                        RadWindowManager2.RadConfirm("Extra amounts will override Fixed amounts. Fixed amount will be cleared.  Press OK to continue or Cancel to return to your changes.", "ExtraFixedFnctn3", 400, 150, null, "Extra/Fixed");
                    }
                    else if (hdfPrompt3.Value == "true")
                    {
                        txtStateFixedWH.Text = null;
                        txtStateFixedWH.Enabled = false;
                        rbIsDollarState.Enabled = false;
                        rbIsPercentState.Enabled = false;
                        rbStateExtraDollar.Enabled = true;
                        rbStateExtraPercent.Enabled = true;
                        txtStateExtraWH.Enabled = true;
                        var PercentStateExtra = (ent.EmployeeTaxes.Where(a => a.EmployeeId == empno && a.TaxTypeId == 2)).FirstOrDefault();//extra
                        if (PercentStateExtra != null && PercentStateExtra.TaxCalcId == 1)
                        {
                            rbIsDollarState.Checked = true;
                            rbIsPercentState.Checked = false;
                        }
                        if (PercentStateExtra != null && PercentStateExtra.TaxCalcId == 2)
                        {
                            rbIsDollarState.Checked = false;
                            rbIsPercentState.Checked = true;
                        }
                        var EmpStateFixed = (from a in ent.EmployeeTaxes
                                             where a.EmployeeId == empno && (a.TaxTypeId == 2)
                                             select new { a.EmployeeId, a.MaritalStatus, a.NumExemptions, a.Amount, a.TaxCalcId }).FirstOrDefault();
                        if (EmpStateFixed != null)
                        {
                            if (EmpStateFixed.Amount == null || EmpStateFixed.Amount == 0)
                                txtStateExtraWH.Text = "0.00";
                            else
                                txtStateExtraWH.Text = (EmpStateFixed.Amount).ToString();
                        }
                        var PercentStateFixed = (ent.EmployeeTaxes.Where(a => a.EmployeeId == empno && a.TaxTypeId == 5)).FirstOrDefault();//fixed
                        if (PercentStateFixed != null && PercentStateFixed.TaxCalcId == 1)
                        {
                            rbStateExtraDollar.Checked = true;
                            rbStateExtraPercent.Checked = false;
                        }
                        if (PercentStateFixed != null && PercentStateFixed.TaxCalcId == 2)
                        {
                            rbStateExtraDollar.Checked = false;
                            rbStateExtraPercent.Checked = true;
                        }
                        var EmpStateExtra = (from a in ent.EmployeeTaxes
                                             where a.EmployeeId == empno && (a.TaxTypeId == 5)
                                             select new { a.EmployeeId, a.MaritalStatus, a.NumExemptions, a.Amount, a.TaxCalcId }).FirstOrDefault();
                        if (EmpStateExtra != null)
                        {
                            if (EmpStateExtra.Amount == null || EmpStateExtra.Amount == 0)
                                txtStateExtraWH.Text = "0.00";
                            else
                                txtStateExtraWH.Text = (EmpStateExtra.Amount).ToString();
                        }
                        hdfPrompt3.Value = "";
                    }
                    else if (hdfPrompt3.Value == "false")
                    {
                        rbStateExtra.Checked = false;
                        rbStateFixed.Checked = true;
                        hdfPrompt3.Value = "";
                    }
                }
            }
        }
        protected void rbStateFixed_CheckedChanged(object sender, EventArgs e)
        {
            EmployeePortal.Models.NCI.NCIEntities ent = EmployeePortal.Models.ClsNCIUtil.GetNCIEntity(Session["CustomerID"].ToString());
            using (ent)
            {
                var StateFixed = (ent.EmployeeTaxes.Where(a => a.EmployeeId == empno && a.TaxTypeId == 2)).FirstOrDefault();//extra
                if (StateFixed == null)
                {
                    txtStateFixedWH.Enabled = true;
                    rbIsDollarState.Enabled = true;
                    rbIsPercentState.Enabled = true;
                    txtStateExtraWH.Text = null;
                    txtStateExtraWH.Enabled = false;
                    rbStateExtraDollar.Enabled = false;
                    rbStateExtraPercent.Enabled = false;
                }
                else
                {
                    if (hdfPrompt4.Value == "")
                    {
                        RadWindowManager2.RadConfirm("Fixed amounts will override Extra amounts. Extra amount will be cleared.  Press OK to continue or Cancel to return to your changes.", "ExtraFixedFnctn4", 400, 150, null, "Extra/Fixed");
                    }
                    else if (hdfPrompt4.Value == "true")
                    {
                        txtStateExtraWH.Text = null;
                        txtStateExtraWH.Enabled = false;
                        rbStateExtraDollar.Enabled = false;
                        rbStateExtraPercent.Enabled = false;
                        rbIsDollarState.Enabled = true;
                        rbIsPercentState.Enabled = true;
                        txtStateFixedWH.Enabled = true;
                        var PercentStateExtra = (ent.EmployeeTaxes.Where(a => a.EmployeeId == empno && a.TaxTypeId == 2)).FirstOrDefault();//extra
                        if (PercentStateExtra != null && PercentStateExtra.TaxCalcId == 1)
                        {
                            rbIsDollarState.Checked = true;
                            rbIsPercentState.Checked = false;
                        }
                        if (PercentStateExtra != null && PercentStateExtra.TaxCalcId == 2)
                        {
                            rbIsDollarState.Checked = false;
                            rbIsPercentState.Checked = true;
                        }
                        var EmpStateFixed = (from a in ent.EmployeeTaxes
                                             where a.EmployeeId == empno && (a.TaxTypeId == 2)
                                             select new { a.EmployeeId, a.MaritalStatus, a.NumExemptions, a.Amount, a.TaxCalcId }).FirstOrDefault();
                        if (EmpStateFixed != null)
                        {
                            if (EmpStateFixed.Amount == null || EmpStateFixed.Amount == 0)
                                txtStateFixedWH.Text = "0.00";
                            else
                                txtStateFixedWH.Text = (EmpStateFixed.Amount).ToString();
                        }
                        var PercentStateFixed = (ent.EmployeeTaxes.Where(a => a.EmployeeId == empno && a.TaxTypeId == 5)).FirstOrDefault();//fixed
                        if (PercentStateFixed != null && PercentStateFixed.TaxCalcId == 1)
                        {
                            rbStateExtraDollar.Checked = true;
                            rbStateExtraPercent.Checked = false;
                        }
                        if (PercentStateFixed != null && PercentStateFixed.TaxCalcId == 2)
                        {
                            rbStateExtraDollar.Checked = false;
                            rbStateExtraPercent.Checked = true;
                        }
                        var EmpStateExtra = (from a in ent.EmployeeTaxes
                                             where a.EmployeeId == empno && (a.TaxTypeId == 5)
                                             select new { a.EmployeeId, a.MaritalStatus, a.NumExemptions, a.Amount, a.TaxCalcId }).FirstOrDefault();
                        if (EmpStateExtra != null)
                        {
                            if (EmpStateExtra.Amount == null || EmpStateExtra.Amount == 0)
                                txtStateFixedWH.Text = "0.00";
                            else
                                txtStateFixedWH.Text = (EmpStateExtra.Amount).ToString();
                        }
                        hdfPrompt4.Value = "";
                    }
                    else if (hdfPrompt4.Value == "false")
                    {
                        rbStateFixed.Checked = false;
                        rbStateExtra.Checked = true;
                        hdfPrompt4.Value = "";
                    }
                }
            }
        }

 

Please help me as soon as possible.

Marin Bratanov
Telerik team
 answered on 12 Dec 2018
6 answers
242 views
I have Telerik RadGrid which contains around 20 columns. In the beginning, I can see column 1 to column 8. Then I scroll horizontally to see other columns. Suppose I should now see column 9 to 17, but I see the columns 10 to 18. Column 9 is passed over and not shown. One column is missed. How can I adjust the scrolling properties of Telerik to avoid this situation?
Eyup
Telerik team
 answered on 12 Dec 2018
4 answers
269 views

Hi 

I need force radcombobox to always open like RadListBox, i not use RadListBox because this control not have IsSeparator property

Any idea?

Thanks

Juan
Top achievements
Rank 1
 answered on 12 Dec 2018
1 answer
114 views

Hello,

It says on the documentation that "Another optional column for the Resources Table is Format. This column define the format of the assignment Units and its default value is percentage("p0").".

I have created this column as an nchar(10) (just like the "Color" column) in the GanttResources table and I've tried n0, p0 and c0 as values for my resources but every time the unit displayed is %.

Is there a list of expected values for this column or does it have to be enabled somewhere I'm missing? The documentation about RadGantt doesn't mention this column anywhere else nor do the examples provided use this table in any sort of way.

Thank you for your help!

Peter Milchev
Telerik team
 answered on 12 Dec 2018
6 answers
424 views
I have implemented a combobox with multiselect using checkboxes.
Along with this functionality I also want to provide radio buttons next to the checkboxes.

The requirement is that the user should be able to select multi items in the combo and mark one of them as the default value.

The multi-select is working perfectly for me, I am unable to figure out how to get the radio buttons.

Can you help me with this requirement?
Mark
Top achievements
Rank 2
 answered on 11 Dec 2018
5 answers
565 views

Hi 

I have the following requirements and I am trying to get some telerik control to work but it seems I cannot achieve all the requirements.

I need a multi-select control. I do not want to load the data on page load for performance reasons. When the user clicks on the dropdown that is when I want to load all items and show it to the user. It does not require client filtering but if it works then its a bonus.

The user then selects the multiple options and a button is pressed. In the postback I need to pick up the options that were selected. 

I have tried the RadCombobox but if you use LOD then checkboxes are not supported. I tried using itemtemplate with a checkbox in it but I was not able to pick up the selected checkboxes after postback and the selections are not perserved after postback either. I have seen an example of this but the js function it uses needs the clientid of the radcombobox. I do not have this available at the right time in the page lifecycle. It is too complicated to get this because I am rendering these controls programmatically and dynamically.

I have tried to make this to work with radautocompletebox however I have a box where I have to type before I see the options. This is not acceptable for my requirements. When the user clicks on the autocomplete control I need to show them all options available. Then once they select and press the button I need them persisted and need to be able to pick them up in the post back.

Please advise if these controls can be made to meet my requirments or if you have another control that can achieve this? To summarise:

It must Load on Demand when the control is clicked

It must allow multi select

I must be able to pick up the selections in server side postback.

Peter Milchev
Telerik team
 answered on 11 Dec 2018
3 answers
118 views

Hi Telerik

RadScheduler Appointment on SelectedView="MonthView" showing as tiny square, in the day, in IOS touch tablet. It takes up the whole dayColumn on desktop.

Also the context menu from this appointment after appearing does not work when clicked on in the IOS touch tablet.

Regards

Darren

Peter Milchev
Telerik team
 answered on 11 Dec 2018
1 answer
114 views

Hi

 

I have followed the guide to create a simple project with RadScheduler with vs 2010.

In the project, the RadScheduler retrieves the record from sql database.

However, after I start the website,

1. no appointment option is shown up after double-click any cells.

2. no event is shown in the scheduler. (the record is exist in sql database and tested ok for the connection)

 

What do I miss?

Below is my code:

 

<%@ Page Language="VB" AutoEventWireup="true" CodeFile="RadSchedulerWebForm.aspx.vb" Inherits="RadSchedulerWebForm" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <script type="text/javascript">
        //Put your JavaScript code here.
    </script>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadScheduler1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadScheduler1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadScheduler runat="server" ID="RadScheduler1" DataEndField="EndTime"
        DataKeyField="id" DataSourceID="SqlDataSource1" DataStartField="StartTime"
        ReadOnly="True" StartEditingInAdvancedForm="false"
        DataSubjectField="Subject">         
    </telerik:RadScheduler>
 
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
        ConnectionString="<%$ ConnectionStrings:Scheduler_TestConnectionString %>"
        DeleteCommand="DELETE FROM [scheduler_table] WHERE [id] = @id"
        InsertCommand="INSERT INTO [scheduler_table] ([id], [Subject], [StartTime], [EndTime]) VALUES (@id, @Subject, @StartTime, @EndTime)"
        SelectCommand="SELECT * FROM [scheduler_table]"
         
         
        UpdateCommand="UPDATE [scheduler_table] SET [Subject] = @Subject, [StartTime] = @StartTime, [EndTime] = @EndTime WHERE [id] = @id">
        <DeleteParameters>
            <asp:Parameter Name="id" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="id" Type="Int32" />
            <asp:Parameter Name="Subject" Type="String" />
            <asp:Parameter Name="StartTime" Type="DateTime" />
            <asp:Parameter Name="EndTime" Type="DateTime" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="Subject" Type="String" />
            <asp:Parameter Name="StartTime" Type="DateTime" />
            <asp:Parameter Name="EndTime" Type="DateTime" />
            <asp:Parameter Name="id" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>
    </form>
</body>
</html>
Peter Milchev
Telerik team
 answered on 11 Dec 2018
4 answers
228 views
Hi, I need to upload images to my website 
but I need to resize images before send to server
is there a way to implement this function as this http://www.plupload.com/
thanks
Peter Milchev
Telerik team
 answered on 11 Dec 2018
4 answers
552 views

Здравейте! Hi!

I am experiencing unusual behavior with a RadTreeList that's residing inside a user control (.ascx).

Note: The user control is programmatically/dynamically added on Page_Load from the parent page.

 

The RadTreeList definition inside the user control is as follows:

    <telerik:RadTreeList ID="RadTreeList1" runat="server"

        ParentDataKeyNames="ParentId" DataKeyNames="DataId" AllowPaging="false"
        AutoGenerateColumns="false" AllowSorting="false" ExpandCollapseMode="Client" AllowMultiItemSelection="true">

        <Columns>
            <telerik:TreeListBoundColumn DataField="FullName" UniqueName="FullName" HeaderText="FullName">
            </telerik:TreeListBoundColumn>
        </Columns>
    </telerik:RadTreeList>

 

In the code behind of the user control, I do this inside Page_Load():

           RadTreeList1.DataSource = lst; // lst is of type List<object> and is populated with valid data

           RadTreeList1.ExpandAllItems();

When the page containing this user control loads, one can see that the RadTreeList is rendered initially in a fully expanded state, but about half a second or less later, all the expanded nodes are auto-collapsed by the client-side.

The stack trace (snapped in the "middle" of toggling an expanded node back to a collapsed state) from Dev Tools in Chrome is:

toggleExpandCollapse (Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager2_TSM&compress=1&_TSM_CombinedScri…:22075)
initialize (Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager2_TSM&compress=1&_TSM_CombinedScri…:21971)
endUpdate (Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager2_TSM&compress=1&_TSM_CombinedScri…:2664)
endCreateComponents (Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager2_TSM&compress=1&_TSM_CombinedScri…:3406)
_raiseInit (Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager2_TSM&compress=1&_TSM_CombinedScri…:3548)
initialize (Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager2_TSM&compress=1&_TSM_CombinedScri…:3424)
b (Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager2_TSM&compress=1&_TSM_CombinedScri…:3504)
a (Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager2_TSM&compress=1&_TSM_CombinedScri…:3515)

 

If I change the ExpandCollapseMode of the RadTreeList to "Server" (from "Client"), the RadTreeList is rendered in expanded state, and the client side does not auto-collapse it (expected behavior).

The problem with "Server" expansion mode is that it causes a full page postback on every node expand/collapse icon click, which is highly undesirable in our situation.

 

Please advise on how to avoid the auto-collapse of a fully expanded RadTreeList while in "Client" ExpandCollapseMode.

 

Thank you!

 

Additional Info: Telerik.Web.UI version is 2016.2.607.45

 

Eyup
Telerik team
 answered on 11 Dec 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?