Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
164 views
I'm trying to find the proper way to deal with Validation, either using RequiredFieldValidator, RegularExpressionValidator, or a CustomValidator. When one of these validators hooked up to a Telerik RadInput control fails, I'd like the control to switch to it's Invalid State, showing the warning, etc. I can't find anyway to do this. 

[EDIT]

I've managed to figure out how to use RadInputManager to validate some of my textboxes... except that it doesn't seem to be invoked during Page.Validate(group), even if I set a group on the TextSetting. It seems like the TextSetting isn't actually added to the Control hierarchy, and so is never located. It also only has a single ErrorMessage property, which makes it impossible to actually specify different message for different inputs, even if their behaviors are the same: First name is required, last name is required, foo is required, blah is required, etc.

So other than setting the Invalid state of the controls... I can't figure out how this makes things EASIER?
Jerome
Top achievements
Rank 1
 answered on 02 Dec 2011
3 answers
64 views
When using a WebService-populated menu, as items get added, or branches opened (I can't work out the exact trigger). I get new dynamic script entries being put into the page - the script is simply :

' ' ;

In case that doesnt come out - its two single quotes, and a semi colon.

Its not that much of a worry - but when the menu is cached fully - there could be hundreds of these entries...
Peter
Telerik team
 answered on 02 Dec 2011
2 answers
142 views
How do I refresh multiple radgrids on a radtabstrip from a radwindow close event?
SoniTek
Top achievements
Rank 1
 answered on 02 Dec 2011
4 answers
1.3K+ views

I'm setting the background colors of the nodes in my treeview by binding to a CSS field in my database.

In my actual application, the nodes on the tree represent tasks and the colors indicate the priority. The same webform includes some controls to update the task. At the end of this process, I need to update the selected node color. Can someone tell me the code that I need to do this?

Here's a simplified code sample. When I try setting the node colors in code, only the text portion of the node is set. In the screen shot shown that's attached to this thread, notice how only the Node 1-1 section is colored in red. The rest of the node remains green.

What code do I need to change the color of the entire node?

Many thanks,
Tim

<head runat="server">
    <title></title>
    <style type="text/css">
        .green
        {
            background-color: green;
        }
        .red
        {
            background-color: red;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:UpdatePanel runat="server">
            <ContentTemplate>
                <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
                <telerik:RadTreeView ID="RadTreeView1" runat="server" DataFieldID="UniqueId" DataFieldParentID="parentid"
                    DataTextField="NodeText" DataValueField="UniqueId">
                    <ContextMenus>
                    </ContextMenus>
                    <DataBindings>
                        <telerik:RadTreeNodeBinding ContentCssClassField="CssClass" />
                    </DataBindings>
                </telerik:RadTreeView>
            </ContentTemplate>
        </asp:UpdatePanel>
 
        <asp:LinkButton Text="Change Color" runat="server"  ID="changeLink"/>
 
    </div>
 
    </form>
</body>
</html>


Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
 
    If Not Page.IsPostBack Then
 
        Dim values = {New With {.UniqueId = "0", .parentid = Nothing, .NodeText = "Node 1", .CssClass = "red"},
                      New With {.UniqueId = "1", .parentid = Nothing, .NodeText = "Node 1-1", .CssClass = "green"}
                     }
        RadTreeView1.DataSource = values
        RadTreeView1.DataBind()
    End If
 
End Sub
 
Protected Sub changeLink_Click(sender As Object, e As System.EventArgs) Handles changeLink.Click
 
    'None of these color the entire row. what's the correct syntax to use?
    RadTreeView1.FindNodeByValue("1").BackColor = Color.Red
    RadTreeView1.FindNodeByValue("1").CssClass = "red"
 
End Sub
Tim
Top achievements
Rank 1
 answered on 02 Dec 2011
3 answers
409 views
Since release of Q3 2011 (2011.3.1115) javascript error occurred after postback in aspx page with TagCloud component (no matter ajax request or not).

Error: Sys.InvalidOperationException: Two components with the same id 'ctl00_ContentPlaceHolder1_MessageBoard_Cloud_Cloud_0_8' can't be added to the application.

Where control id is actually id of RadTagCloudItem() added during Page_Load and not modified on postback.

In previous releases (Q2 2011) everything was Ok.
Pero
Telerik team
 answered on 02 Dec 2011
1 answer
98 views
Depending on a value in the expanded parent row, I want to display/hide the 'Add New' button in the DetailTable.  For instance, if 'Test A' in the MasterTableView is inactive, I don't want the 'Add New' button to appear if 'Test A' is expanded to show the DetailTable.  Any help would be appreciated.
Antonio Stoilkov
Telerik team
 answered on 02 Dec 2011
1 answer
86 views
I realized I probably did this the hard way but this is what I've done.  I placed this comment here because I think it's an overall telerik / vs issue

I've had an existing aspx website i've been working on and today i've installed the Telerik tools.  I created a new webpage using my template and CSS and I wanted to test out the ReportBookControl.   I went ahead and dropped the ReportBookControl in the section I wanted inside of the html table I wanted it placed.  I then went ahead and added a Telerik Report and then used the wizard to create the report.

I used the Wizard successfully and then went ahead and added that report to my report book.  When i debug the website and view the page I can't see the telerik control inside of the page source.

        <telerik:reportbookcontrol ID="ReportBookControl1" runat="server">
            <Reports>
                <telerik:reportinfo Report="Overview, App_Code.lxmpmeb9, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" />
            </Reports>
        </telerik:reportbookcontrol>

When I go to preview the designed report in Preview mode it tells me the source of the report definition has not been specified.  I'm wondering why the report wizard would leave this out?

Thanks!
Elian
Telerik team
 answered on 02 Dec 2011
1 answer
84 views
Hello,
I initiate a postback with __doPostback function and pass some data which should help to set a VERY custom filter on dataset. But when page is reloaded, I can see that grid client object was not refreshed and all data and AJAX cell controls was the same as before. Grid is in ASP.NET panel which is under RadAjaxManager control. Is there a way to fully reload grid client object on postback?
Thank you.

UPD. Almost forgot - grid is created programmatically in Page_Init method.
Maria Ilieva
Telerik team
 answered on 02 Dec 2011
4 answers
164 views
image Captura: the scenario
I have a Grid, and a button named Full Edit. When click in Full edit, open a Radwindow.
In Radwindow I have 3 buttons, Ones is Delete.

When User Click in delete, appear a RadWindow.Confirm (Deelete this User?)
If user click on Yes, remove user, close de windows and rebin the Grid.
this problem is RadAjaxManager1_AjaxRequest does not exececute Close and Rebien of JS

In save button, the user apply change, save and close (with intermidate windows) )this button wiorks.


This is my code:
.ASPX:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UserForm.aspx.cs" Inherits="WebSearch.UI.Admin.UserForm" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>User</title>
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    <link href="../Style/Admin.css" rel="stylesheet" type="text/css" />
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">

        function confirmCallBackFn(arg) {
            debugger;
            var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
            if (arg == true)
            { ajaxManager.ajaxRequest("Remove"); }

        }

        function CloseAndRebind(args) {
            debugger;
            GetRadWindow().BrowserWindow.refreshGrid(args);
            GetRadWindow().close();
        }

        function GetRadWindow() {
            var oWindow = null;
            if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well)

            return oWindow;
        }

        function CancelEdit() {
            GetRadWindow().close();
        }


        function filterCreated(sender, args) {
            sender.get_contextMenu().add_showing(
            function (sender, args) {
                sender.findItemByValue("IsNull").set_visible(false);
                sender.findItemByValue("NotIsNull").set_visible(false);
                sender.findItemByValue("GreaterThan").set_visible(false);
                sender.findItemByValue("GreaterThanOrEqualTo").set_visible(false);
                sender.findItemByValue("LessThan").set_visible(false);
                sender.findItemByValue("LessThanOrEqualTo").set_visible(false);
                sender.findItemByValue("NotBetween").set_visible(false);
                sender.findItemByValue("Between").set_visible(false);
            }
        );
        }

                   
    </script>
    </telerik:RadCodeBlock>
</head>

<body>

 
     <form id="form1" runat="server">
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest"  />
                <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
    <div class="TabContainer">
        <telerik:RadTabStrip ID="RadTabStrip1" runat="server" Skin="Vista" MultiPageID="RadMultiPage1"
            SelectedIndex="0" CssClass="tabStrip" Width="698px">
            <Tabs>
                <telerik:RadTab value="Information">
                </telerik:RadTab>
                <telerik:RadTab  Value="Mandatory">
                </telerik:RadTab>
            </Tabs>
        </telerik:RadTabStrip>
        <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" CssClass="multiPage">
            <telerik:RadPageView ID="RadPageViewInformation" runat="server" Width="100%">
            <div class="TabTitle">
                <asp:Label ID="lblTitleTab2" runat="server"></asp:Label>
            </div>
                <asp:Table ID="Table3" CssClass="EditFormTable" runat="server">
                    <asp:TableRow>
                        <asp:TableCell CssClass="CellLabelLTW">
                            <asp:Label runat="server" ID="lblFirstName" CssClass="fontLabel" /></asp:TableCell><asp:TableCell
                                CssClass="CellTextBoxL">
                                <asp:TextBox ID="txtFirstName" MaxLength="250" CssClass="TextBoxPopUp" Text='<%# Bind("FirstName") %>'
                                    runat="server">
                                </asp:TextBox><asp:RequiredFieldValidator ID="rfFirstName" runat="server" ErrorMessage="*"
                                    ControlToValidate="txtFirstName" CssClass="validator" ></asp:RequiredFieldValidator>
                            </asp:TableCell><asp:TableCell CssClass="CellLabelRTW">
                                <asp:Label runat="server" CssClass="fontLabel" ID="lblLastName" /></asp:TableCell><asp:TableCell
                                    CssClass="CellTextBoxR">
                                    <asp:TextBox ID="txtLastName" MaxLength="250" CssClass="TextBoxPopUp" Text='<%# Bind("LastName") %>'
                                        runat="server">
                                    </asp:TextBox><asp:RequiredFieldValidator ID="rvfLastName" runat="server" ErrorMessage="*"
                                        ControlToValidate="txtLastName" CssClass="validator"  ></asp:RequiredFieldValidator></asp:TableCell></asp:TableRow>
                    <asp:TableRow>
                        <asp:TableCell CssClass="CellLabelLTW">
                            <asp:Label runat="server" ID="lblMiddleName" CssClass="fontLabel" />
                        </asp:TableCell><asp:TableCell CssClass="CellTextBoxR" >
                            <asp:TextBox ID="txtMiddleName" MaxLength="250" CssClass="TextBoxPopUp" Text='<%# Bind("MiddleName") %>'
                                runat="server">
                            </asp:TextBox>
                        </asp:TableCell>
                        <asp:TableCell ColumnSpan="2"></asp:TableCell></asp:TableRow>
                    <asp:TableRow>
                        <asp:TableCell CssClass="CellLabelL">
                            <asp:Label runat="server" ID="lblLoginId" CssClass="fontLabel" /></asp:TableCell><asp:TableCell
                                CssClass="CellTextBoxL">
                                <asp:TextBox CausesValidation="true" ID="txtLoginId" MaxLength="250" CssClass="TextBoxPopUp"
                                    Text='<%# Bind("LoginId") %>' runat="server">
                                </asp:TextBox><asp:RequiredFieldValidator ID="rfvLoginId" runat="server" ErrorMessage="*"
                                    ControlToValidate="txtLoginId" CssClass="validator"></asp:RequiredFieldValidator>
                                <asp:CustomValidator ID="cvLoginId" runat="server" ControlToValidate="txtLoginId" ValidationGroup="Information"
                                    CssClass="validator" ValidateEmptyText="True" Display="Dynamic" OnServerValidate="cvLoginId_ServerValidate"></asp:CustomValidator>
                            </asp:TableCell><asp:TableCell CssClass="CellLabelRTW">
                                <asp:Label runat="server" ID="lblExternalId" CssClass="fontLabel" /></asp:TableCell><asp:TableCell
                                    CssClass="CellTextBoxR">
                                    <asp:TextBox ID="txtExternalId" MaxLength="250" CssClass="TextBoxPopUp" Text='<%# Bind("ExternalId") %>'
                                        runat="server">
                                    </asp:TextBox></asp:TableCell></asp:TableRow>
                    <asp:TableRow ID="AddressRow">
                        <asp:TableCell CssClass="CellLabelLTW">
                            <asp:Label runat="server" ID="lblEmail" CssClass="fontLabel" /></asp:TableCell><asp:TableCell
                                CssClass="CellTextBoxL">
                                <asp:TextBox ID="txtEmail" MaxLength="250" CssClass="TextBoxPopUp" Text='<%# Bind("Email") %>'
                                    runat="server">
                                </asp:TextBox><br />
                                <asp:RequiredFieldValidator ID="rfvEmail" runat="server" ErrorMessage="*"
                                    ControlToValidate="txtEmail" CssClass="validator"></asp:RequiredFieldValidator>
                                <asp:RegularExpressionValidator ID="revEmail" ControlToValidate="txtEmail"
                                    ValidationExpression="^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$" CssClass="validator"
                                    runat="server" Display="Dynamic"></asp:RegularExpressionValidator>
                                <asp:CustomValidator ValidationGroup="Information" ID="cvEmail" ControlToValidate="txtEmail" CssClass="validator"
                                    runat="server" OnServerValidate="cvEmail_ServerValidate" Display="Dynamic"></asp:CustomValidator>
                            </asp:TableCell><asp:TableCell CssClass="CellLabelRTW">
                                <asp:Label runat="server" ID="lblAddress" CssClass="fontLabel" /></asp:TableCell><asp:TableCell
                                    CssClass="CellTextBoxR">
                                    <asp:TextBox ID="txtAddress" MaxLength="250" CssClass="TextBoxPopUp" Text='<%# Bind("Address") %>'
                                        runat="server"></asp:TextBox></asp:TableCell></asp:TableRow>
                    <asp:TableRow ID="PhoneRow" runat="server">
                        <asp:TableCell CssClass="CellLabelLTW">
                            <asp:Label runat="server" ID="lblPhone" CssClass="fontLabel" /></asp:TableCell><asp:TableCell
                                CssClass="CellTextBoxL">
                                <telerik:RadMaskedTextBox ID="txtPhone" runat="server" MaxLength="250" CssClass="TextBoxPopUp"
                                    Text='<%# Bind("Phone") %>' Mask="(###) ###-####-####" DisplayMask="(###) ###-####-####">
                                </telerik:RadMaskedTextBox>
                            </asp:TableCell><asp:TableCell CssClass="CellLabelRTW">
                                <asp:Label runat="server" ID="lblCellPhone" CssClass="fontLabel" /></asp:TableCell>
                                <asp:TableCell
                                    CssClass="CellTextBoxR">
                                    <telerik:RadMaskedTextBox ID="txtCellPhone" runat="server" MaxLength="250" CssClass="TextBoxPopUp"
                                        Text='<%# Bind("CellPhone") %>' Mask="(###) ###-####-####" DisplayMask="(###) ###-####-####">
                                    </telerik:RadMaskedTextBox>
                                </asp:TableCell></asp:TableRow>

                        <asp:TableRow ID="TableRow1" runat="server">
                        <asp:TableCell CssClass="CellLabelLTW">
                            <asp:Label runat="server" ID="lblIsSuper" CssClass="fontLabel" /></asp:TableCell><asp:TableCell
                                CssClass="CellTextBoxL">
                                <asp:CheckBox ID="chkIsSuper" runat="server" />
                            </asp:TableCell>
                             
                              <asp:TableCell  CssClass="CellLabelRTW">
                                 <asp:Label runat="server" ID="lblSecurityLevel" CssClass="fontLabel" /></asp:TableCell>
                                <asp:TableCell
                                    CssClass="CellTextBoxR">
                                   <telerik:RadComboBox  ID="cbSecurityLevel" Skin="Vista" runat="server" CausesValidation="true" ></telerik:RadComboBox>
                                
                                    <asp:RequiredFieldValidator ControlToValidate="cbSecurityLevel" runat="server" ID="Securitycv" CssClass="validator"  Display="Dynamic"  ErrorMessage="*"></asp:RequiredFieldValidator>
                                </asp:TableCell></asp:TableRow>
                    <asp:TableRow>
                        <asp:TableCell ColumnSpan="4">
                            <asp:Label ID="lblValidationText" CssClass="validator" runat="server" Font-Italic="true"></asp:Label>
                        </asp:TableCell></asp:TableRow>
                </asp:Table>
            </telerik:RadPageView>
            <telerik:RadPageView ID="RadPageViewUser" runat="server"  Width="100%">
             <div class="TabTitle">
                <asp:Label ID="lblTitleTab1" runat="server"></asp:Label>
            </div>
                <asp:Table ID="Table2" CssClass="EditFormTable" runat="server">
                    <asp:TableRow ID="MandatorySearchRow" runat="server">
                        <asp:TableCell Width="100%">
                            <div style="width: 98%">
                                <div style="width: 100%; border-color: #B8E3FB; border-style: solid; border-width: 1px;">
                                    <center>
                                        <asp:Label ID="lblDefineMandatorySearch" CssClass="titleMandatory" runat="server"></asp:Label></center>
                                    <telerik:RadFilter ID="radMandatorySearch" runat="server" ShowApplyButton="true"
                                        ExpressionPreviewPosition="Bottom">
                                        <ClientSettings> <ClientEvents  OnFilterCreated="filterCreated"/></ClientSettings>
                                        
                                    </telerik:RadFilter>
                                </div>
                                <br />
                                <div style="width: 100%;">
                                    <center>
                                        <asp:Label ID="lblDefinedMandatorySearch" CssClass="titleMandatory" runat="server"></asp:Label>
                                        <asp:ImageButton ImageUrl="~/UI/Images/cross.png" ID="btnRemove"  runat="server"
                                            OnClick="btnRemove_Click" /></center>
                                    <br />
                                    <center>
                                        <asp:Label ID="txtMandatorySearch" CssClass="fontLabel"  
                                            runat="server"></asp:Label></center>
                                </div>
                            </div>
                        </asp:TableCell></asp:TableRow>
                </asp:Table>
            </telerik:RadPageView>
        </telerik:RadMultiPage></div>
    <div class="footerSave" runat="server">
        <asp:Table runat="server" Width="100%" HorizontalAlign="Right">
            <asp:TableRow>
                <asp:TableCell HorizontalAlign="center">
                    <telerik:RadButton ID="btnSave" runat="server" Skin="Vista" Width="100px" OnClick="btnSave_OnClick" />
                    <telerik:RadButton ID="btnCancel" runat="server" Skin="Vista" Width="100px" CausesValidation="False"
                        ToolTip="Cancel" OnClientClicked="CancelEdit" />
                         <telerik:RadButton ID="btnDelete" runat="server" Skin="Vista" Width="100px" CausesValidation="False"
                        ToolTip="Remove current User"   OnClick="btnDelete_OnClick" />
                  
                </asp:TableCell></asp:TableRow>
        </asp:Table>
    </div>
    
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true">
            <Windows>
                <telerik:RadWindow ID="UserListDialog" runat="server" Height="600px" Width="900px"
                    Left="15%" ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true" VisibleStatusbar="True"
                    Behaviors="Close" />
            </Windows>
        </telerik:RadWindowManager>
    </form>
</body>
</html>



And .cs:
using System;
using System.Globalization;
using System.Resources;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using WebSearch.Components;
using WebSearch.SecurityModel;

namespace WebSearch.UI.Admin
{
    public partial class UserForm : Page
    {

        #region Properties&Variables

        private smOrganization _organization = new smOrganization();
        private string _culture;
        private ResourceManager _resources;
     

        #endregion

        #region Events
        
        protected void Page_Load(object sender, EventArgs e)
        {

            if (Page.IsPostBack) return;

            LoadSettings();
            FillComboBox();

            if (Request.QueryString["ID"] != null)
            {
                Session["ID"] = Request.QueryString["ID"];
                LoadUser();
            }
            else
            {
                btnDelete.Visible = false;
                Page.Title = _resources.GetString("AddFull", new CultureInfo(_culture));
            }
        }

        protected void btnDelete_OnClick(object sender, EventArgs e)
        {
            try
            {
                if (_organization.IsSuperUser(Convert.ToInt16(GetId())))
                {
                    if (_organization.IsUniqueSuper())
                    {
                        RadWindowManager1.RadAlert(_resources.GetString("ErrorDelete", new CultureInfo(_culture)), 330, 100, _resources.GetString("ErrorTitleDelete", new CultureInfo(_culture)), "");

                    }
                }

                else
                {
                    RadWindowManager1.RadConfirm(_resources.GetString("confirmText", new CultureInfo(_culture)), "confirmCallBackFn", 330, 100, null, _resources.GetString("confirmTitle", new CultureInfo(_culture)));
                }

               
            }
            catch (Exception ex)
            {
                throw new Exception(ex.ToString());
            }
           
            
        }


        protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
        {
            if (e.Argument == "Remove") //delete users
            {
                //    _organization.RemoveUser(Convert.ToInt16(Session["ID"]));

                ClientScript.RegisterStartupScript(Page.GetType(), "mykey2", "CloseAndRebind();", true);
            }

          
        }



        protected void Page_Init(object sender, EventArgs e)
        {
            GetInfo();
           
            radMandatorySearch.Culture = new CultureInfo(_culture);
            radMandatorySearch.PreRender += NewFilterPreRender;
            radMandatorySearch.ApplyExpressions += NewFilterApplyExpressions;

            CommonFunctions.CreateFieldSearch(radMandatorySearch, _culture, SecurityModel.smDocumentType.DocType.Email);
            radMandatorySearch.ApplyButtonText = _resources.GetString("ApplyButton", new CultureInfo(_culture));
        }

        protected void btnRemove_Click(object sender, ImageClickEventArgs e)
        {
            txtMandatorySearch.Text = null;
        }
        
        protected void cvLoginId_ServerValidate(object sender, ServerValidateEventArgs e)
        {
            e.IsValid = !_organization.ExistLogin(e.Value.ToString(), GetId());
        }

       

        protected void cvEmail_ServerValidate(object sender, ServerValidateEventArgs e)
        {
           e.IsValid = !_organization.ExistEmail(e.Value.ToString(), GetId());
        }
        
        protected void btnSave_OnClick(object sender, EventArgs e)
        {
            Page.Validate("Information");
            if (!Page.IsValid)
            {
                RadTabStrip1.Tabs.FindTabByValue("Information").Selected = true;
                RadPageViewInformation.Selected = true;
                return;
            }


            _organization.User = new smUser
                                     {
                                         FirstName = txtFirstName.Text,
                                         MiddleName = txtMiddleName.Text,
                                         LastName = txtLastName.Text,
                                         Email = txtEmail.Text,
                                         Loginid = txtLoginId.Text,
                                         Phone = txtPhone.Text,
                                         CellPhone = txtCellPhone.Text,
                                         Address = txtAddress.Text,
                                         ExternalId = txtExternalId.Text,
                                         MandatorySearch = txtMandatorySearch.Text,
                                         IsSuper = chkIsSuper.Checked,
                                         SecurityLevelId = Convert.ToInt16(cbSecurityLevel.SelectedValue)
                                     };
            
            try
            {
                _organization.Quick = true;

                if (Session["ID"] == null)
                {
                    _organization.CreateUser();
                   
                }
                else
                {
                    _organization.User.Id = Convert.ToInt32(Session["ID"]);
                    _organization.UpdateUser();
                    Session["ID"] = null;
                }
            }
            catch(Exception ex)
            {
                throw  new Exception(ex.ToString());
            }
            finally
            {
                ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "CloseAndRebind();", true);
            }
         }
     
        #endregion

        #region Methods

        private int GetId()
        {
            if (Request.QueryString["ID"] != null)
            {
                Session["ID"] = Request.QueryString["ID"];
            }
            return Convert.ToInt16(Session["ID"] ?? 0);
        }

        private void FillComboBox()
        {
            cbSecurityLevel.DataSource = _organization.GetSecurityLevels();
            cbSecurityLevel.DataTextField = "Name";
            cbSecurityLevel.DataValueField = "Id";
            cbSecurityLevel.DataBind();
        }

        private void LoadUser()
        {
            _organization = new smOrganization();

            smUser currentUser = _organization.GetUser(GetId());

            txtPhone.Text = currentUser.Phone;
            txtMiddleName.Text = currentUser.MiddleName;
            txtMandatorySearch.Text = currentUser.MandatorySearch;
            txtLoginId.Text = currentUser.Loginid;
            txtLastName.Text = currentUser.LastName;
            txtFirstName.Text = currentUser.FirstName;
            txtExternalId.Text = currentUser.ExternalId;
            txtEmail.Text = currentUser.Email;
            txtCellPhone.Text = currentUser.CellPhone;
            txtAddress.Text = currentUser.Address;
            chkIsSuper.Checked = currentUser.IsSuper;
            cbSecurityLevel.SelectedValue = currentUser.SecurityLevelId.ToString();
            
            Page.Title = _resources.GetString("EditFull", new CultureInfo(_culture)) + " " +currentUser.FirstName + "," + currentUser.LastName;

          
        }

        private void GetInfo()
        {
            _culture = App.CurrentCulture();
            _resources = _resources = App.GetAdminResources("UserManagement");
        }

        private void LoadSettings()
        {
            RadTabStrip1.Tabs.FindTabByValue("Information").Text = _resources.GetString("Information", new CultureInfo(_culture));
            RadTabStrip1.Tabs.FindTabByValue("Mandatory").Text = _resources.GetString("Mandatory", new CultureInfo(_culture));
    
            lblFirstName.Text = _resources.GetString(lblFirstName.ID, new CultureInfo(_culture));
            lblMiddleName.Text = _resources.GetString(lblMiddleName.ID, new CultureInfo(_culture));
            lblLastName.Text = _resources.GetString(lblLastName.ID, new CultureInfo(_culture));
            lblCellPhone.Text = _resources.GetString(lblCellPhone.ID, new CultureInfo(_culture));
            lblPhone.Text = _resources.GetString(lblPhone.ID, new CultureInfo(_culture));
            lblAddress.Text = _resources.GetString(lblAddress.ID, new CultureInfo(_culture));
            lblEmail.Text = _resources.GetString(lblEmail.ID, new CultureInfo(_culture));
            lblExternalId.Text = _resources.GetString(lblExternalId.ID, new CultureInfo(_culture));
            lblLoginId.Text = _resources.GetString(lblLoginId.ID, new CultureInfo(_culture));
            lblIsSuper.Text = _resources.GetString(lblIsSuper.ID, new CultureInfo(_culture));

            lblValidationText.Text = _resources.GetString(lblValidationText.ID, new CultureInfo(_culture));
            cvLoginId.ErrorMessage = _resources.GetString(cvLoginId.ID, new CultureInfo(_culture));
            revEmail.ErrorMessage = _resources.GetString(revEmail.ID, new CultureInfo(_culture));
            cvEmail.ErrorMessage = _resources.GetString(cvEmail.ID, new CultureInfo(_culture));
            lblDefineMandatorySearch.Text = _resources.GetString(lblDefineMandatorySearch.ID, new CultureInfo(_culture));
            lblDefinedMandatorySearch.Text = _resources.GetString(lblDefinedMandatorySearch.ID, new CultureInfo(_culture));

            btnSave.Text = _resources.GetString(btnSave.ID, new CultureInfo(_culture));
            btnCancel.Text = _resources.GetString(btnCancel.ID, new CultureInfo(_culture));

            lblTitleTab2.Text = _resources.GetString(lblTitleTab2.ID, new CultureInfo(_culture));
            lblTitleTab1.Text = _resources.GetString(lblTitleTab1.ID, new CultureInfo(_culture));

            chkIsSuper.Visible = App.CurrentUserIsSuper();
            cbSecurityLevel.EmptyMessage = _resources.GetString(cbSecurityLevel.ID, new CultureInfo(_culture));
            lblSecurityLevel.Text = _resources.GetString(lblSecurityLevel.ID, new CultureInfo(_culture));
            //cvSecurityLevel.ErrorMessage = _resources.GetString(cvSecurityLevel.ID, new CultureInfo(_culture));
            btnDelete.Text = _resources.GetString(btnDelete.ID, new CultureInfo(_culture));
        }

        private void NewFilterApplyExpressions(object sender, RadFilterApplyExpressionsEventArgs e)
        {
            RadFilterSqlQueryProvider provider = new RadFilterSqlQueryProvider();
            provider.ProcessGroup(e.ExpressionRoot);

            txtMandatorySearch.Text = txtMandatorySearch.Text + provider.Result;

            radMandatorySearch.RecreateControl();
        }

        protected void NewFilterPreRender(object sender, EventArgs e)
        {

            if (radMandatorySearch.RootGroupItem.Controls[0].Controls[2].Controls.Count > 0)
            {
                radMandatorySearch.RootGroupItem.Controls[0].Controls[2].Controls[1].Visible = false; // remove group option    
            }
        }



        #endregion

       
    }
}
July
Top achievements
Rank 2
 answered on 02 Dec 2011
1 answer
54 views
I've been trying to figure out for quite some time now how to download a document from a gridtableview that is inside of a RadAjaxPanel.  The only way I can get it to work is if I remove the RadAjaxPanel.  Also note that the download fuctionality resided within a detail table of the master grid.  Any help would be appreciated.

Thanks
Maria Ilieva
Telerik team
 answered on 02 Dec 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?