Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
101 views
Hello,

in addition to following post:
http://www.telerik.com/community/forums/aspnet-ajax/editor/overide-telerik-web-ui-editor-commandlist-inserttab-not-working-in-chrome-safari.aspx

i am having another issue with Rad Editor and that is:
NewLineBr = "false" (due to other bugs on IE)

now using CHROME, when is type following in content area:
a
b
c
d

on "inspect element" i found it to be:
<p>a</p>
<p>b</p>
<p>c</p>
<p>d</p>

now when i click "Bullet List" tool bar button it become:
<UL>
<li>a</li>
<li>b</li>
<li>c</li>
<li>d</li>
</UL>

so far its good, but when i click "Bullet List" toolbar button gain, it become:
a
<br/>
b
<br/>
c
<br/>
d

the issue here is i need to reapply <p> tags again as it was before hittin "Bullet List" button first time.

Any/All help will be appreciated.
Rumen
Telerik team
 answered on 15 Oct 2012
1 answer
91 views
I have a RadGrid which I am exporting to excel.

I'm using 
grid.ExportSettings.ExportOnlyData = false;
grid.ExportSettings.Excel.Format = GridExcelExportFormat.Html;

My grid contains custom aggregates.

When I export. The export is missing all my custom aggregates and the footer and group footer rows.
Kostadin
Telerik team
 answered on 15 Oct 2012
1 answer
61 views
Hi,

Your product is awesome but i need an Editor who fully compatible with open office XML so i can convert Editor's html to .docx file format with track changes.
Please guide me that your Editor support these kind of stuff.

Regards,
Sohail Ahmad
Rumen
Telerik team
 answered on 15 Oct 2012
12 answers
799 views
hi,

I have two combo box

the first one has auto post back true so when selected index changed it fills the second combo box

                    <table>
                        <tr>
                            <td>
                                <asp:Label ID="lblDevGroups" runat="server" Text="Groups"></asp:Label></td>
                            <td>
                                    <telerik:RadComboBox ID="ddlDevGroups" runat="server" Width="200px" MarkFirstMatch="true" AutoPostBack="true" />
                                </td>
                            <td>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lblDevices" runat="server" Text="Devices" Visible="False"></asp:Label></td>
                            <td>
                                <telerik:RadComboBox ID="ddlDevices" runat="server" Width="200px" MarkFirstMatch="true" AutoPostBack="false" Visible="false">
                                    <ItemTemplate>   
                                    <table style="border-bottom: 1px dotted #EFEFEF; margin-bottom: 10px; font-size: 11px;" width="98%">     
                                        <tr>       
                                            <td>         
                                                <img src='<%# DataBinder.Eval(Container, "Normal_IconPath")%>' alt="" />       
                                            </td>       
                                            <td>
                                                 <%#DataBinder.Eval(Container, "Serial_No")%>
                                                (<%#DataBinder.Eval(Container, "Device_Name")%>)
                                            </td>     
                                        </tr>   
                                    </table>
                                    </ItemTemplate>
                                </telerik:RadComboBox>
                                </td>
                            <td>
                                <asp:Button ID="btnEditDevices" runat="server" Text="Edit" Visible="False" /></td>
                        </tr>
                    </table>

the ddlDevGroubs (the first combo box) selected index changed event is:

        ddlDevices.Items.Clear()
        Dim strGroupID As String = ddlDevGroups.SelectedValue
        If Not strGroupID = "" Then

            Dim strSQLDevices As String = "Select ds.ID, ds.Device_ID, ds.Device_Name, ds.Serial_No, ds.Icon, dc.Normal_IconPath  from CTS_DeviceSettings ds inner join dbo.CTS_DeviceIcons dc on ds.Icon = dc.id where ds.group_ID=" & strGroupID
            Dim dsDevices As DataSet = clsDB.getData(strSQLDevices)

            If Not dsDevices Is Nothing Then
                If dsDevices.Tables(0).Rows.Count > 0 Then

                    Dim dtDevices As DataTable = dsDevices.Tables(0)
                    'dtDevices.Columns.Add("DevIDName")

                    'Dim i As Integer = 0
                    'For i = 0 To dtDevices.Rows.Count - 1
                    '    Dim strDevName As String

                    '    If IsDBNull(dtDevices.Rows(i)("Device_Name")) Then
                    '        strDevName = ""
                    '    Else
                    '        strDevName = dtDevices.Rows(i)("Device_Name")
                    '    End If

                    '    Dim strDevID As String = dtDevices.Rows(i)("Device_ID")

                    '    Dim strDevSerialNo As String = ""

                    '    If Not IsDBNull(dtDevices.Rows(i)("Serial_No")) Then
                    '        strDevSerialNo = dtDevices.Rows(i)("Serial_No")
                    '    Else
                    '        strDevSerialNo = ""
                    '    End If

                    '    If Not strDevName = "" Then
                    '        dtDevices.Rows(i)("DevIDName") = strDevSerialNo & " (" & strDevName & ")"
                    '    Else
                    '        dtDevices.Rows(i)("DevIDName") = strDevSerialNo
                    '    End If

                    'Next

                    For Each row As DataRow In dtDevices.Rows
                        row("Normal_IconPath") = Page.ResolveClientUrl(row("Normal_IconPath").ToString())
                    Next

                    ddlDevices.DataSource = dtDevices
                    'ddlDevices.DataTextField = "DevIDName"
                    'ddlDevices.DataValueField = "ID"
                    ddlDevices.DataBind()
                    lblMessage.Visible = False
                    lblDevices.Visible = True
                    ddlDevices.Visible = True
                    ddlDevices.Visible = True
                    btnEditDevices.Visible = True
                    btnEditDevices.Visible = True
                    lblDevices.Visible = True
                Else
                    'No Device Records
                    lblMessage.Text = "No Devices have been Found"
                    lblMessage.Visible = True
                    pnlInfo.Visible = False
                    ddlDevices.Visible = False
                    btnEditDevices.Visible = False
                    lblDevices.Visible = False
                    clsLog.WriteNoRecords("/Members/Devices/Configuration.aspx", strSQLDevices)
                End If

            Else
                'error Devices
                lblMessage.Text = "Error While retriving Devices information"
                lblMessage.Visible = True
                clsLog.WriteSQLError("/Members/Devices/Configuration.aspx", strSQLDevices)
            End If
        Else
            lblMessage.Text = "Please select a group"
            lblMessage.Visible = True
            ddlDevices.Visible = False
            btnEditDevices.Visible = False
            lblDevices.Visible = False
        End If

now after all I got this error:

DataBinding: 'Telerik.Web.UI.RadComboBoxItem' does not contain a property with the name 'Normal_IconPath'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: DataBinding: 'Telerik.Web.UI.RadComboBoxItem' does not contain a property with the name 'Normal_IconPath'.

Source Error:

Line 90:                                         <tr>       
Line 91:                                             <td>         
Line 92:                                                 <img src='<%# DataBinder.Eval(Container, "Normal_IconPath")%>' alt="" />       
Line 93:                                             </td>       
Line 94:                                             <td><%#DataBinder.Eval(Container, "Serial_No")%>

so any help please?
Nencho
Telerik team
 answered on 15 Oct 2012
1 answer
296 views
I have the  following scenario.
See Captura1.


1- RadListBox
2- UserGrid
3- Custom transfer buttons.
4- Add Button.

All is working fine except the steps defined in captura1.

I click on Add Button --> Open a new RadWindows, Save, Close this windows and execute AjaxRequest ( THIS WORKS PERFECT!!)
AjaxRequest execute a methods whose reload RadListBox, in debug mode I saw the new User , but in UI RadListBox does not show the new User.


this is my ascx:

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="AssociateUsers.ascx.cs"
    Inherits="WebSearch.UI.Admin.UserControls.Community.AssociateUsers" %>
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">


        function GridCreated() {
            grid = $find("<%=UserGrid.ClientID%>");
            var btnEdit = $find("<%=btnEditUser.ClientID%>");
            var selectedRows = grid.MasterTableView.get_selectedItems();
            if (selectedRows.length == 1 & btnEdit != null) {
                btnEdit.set_visible(true);
                
            } else { btnEdit.set_visible(false) };
        }
        function RowSelected(sender, eventArgs) {
            HideShowEditButton(sender, eventArgs);
        }


        function RowDeselected(sender, eventArgs) {
            HideShowEditButton(sender, eventArgs);
        }


        function HideShowEditButton(sender, eventArgs) {
            var grid = sender;




            var btnEdit = $find("<%=btnEditUser.ClientID%>");
            var selectedRows = grid.MasterTableView.get_selectedItems();
            if (selectedRows.length == 1) {
                btnEdit.set_visible(true);


                var grid = $find("<%=UserGrid.ClientID %>");
                debugger;


                var selectedItem = grid.MasterTableView.get_selectedItems()[0];


                document.getElementById('associateUsers_UserId').value = selectedItem.getDataKeyValue("Id");
                var currentTooltip = btnEdit.get_toolTip();
                var userFullName = selectedItem.getDataKeyValue("FullName");
                if (currentTooltip.indexOf("{UserFullName}") > 0) {
                    currentTooltip = currentTooltip.replace("{UserFullName}", userFullName);
                   
                }
                else {
                    if (currentTooltip.indexOf(document.getElementById('associateUsers_UserNameBefore').value) > 0) {
                        var token = document.getElementById('associateUsers_UserNameBefore').value;
                        currentTooltip = currentTooltip.replace(token, userFullName);
                    } 
                }


                document.getElementById('associateUsers_UserNameBefore').value = userFullName;
                
               
     
                btnEdit.set_toolTip(currentTooltip);  
                


            } else { btnEdit.set_visible(false); }
        }


        function editUser() {


            var id = document.getElementById('associateUsers_UserId').value;
            if (id != null) {
                var oBrowserWnd = GetRadWindow().BrowserWindow;
                var oWindow = oBrowserWnd.radopen("UserForm.aspx?ID=" + id, "UserFormDialog");
                oWindow.set_modal(true);
                oWindow.set_visibleStatusbar(false);
                oWindow.set_behaviors(Telerik.Web.UI.WindowBehaviors.Move + Telerik.Web.UI.WindowBehaviors.Close);
                oWindow.setSize(800, 600);
                oWindow.center();
            }




            return false;
        }


        function addUser() {


            var oBrowserWnd = GetRadWindow().BrowserWindow;
            var oWindow = oBrowserWnd.radopen("UserForm.aspx", "UserFormDialog");
            oWindow.set_modal(true);
            oWindow.set_visibleStatusbar(false);
            oWindow.set_behaviors(Telerik.Web.UI.WindowBehaviors.Move + Telerik.Web.UI.WindowBehaviors.Close);
            oWindow.setSize(800, 600);
            oWindow.center();
            return false;
        }




        function rbtnClear_OnClientClicking(sender, eventArgs) {
            clearFilterText();
            var listbox = $find("<%=rlbAvailableUser.ClientID%>");
            clearListEmphasis(listbox);
            createMatchingList(listbox, "");
        }


        function rlbAvailableUser_OnClientTransferring(sender, eventArgs) {
            clearListEmphasis(sender);
            clearFilterText();
            createMatchingList(sender, "");
            reDesignControls();
        }








        function filterList() {


            var listbox = $find("<%=rlbAvailableUser.ClientID%>");
            var textbox = $find('<%=tbAvailableFilterUser.ClientID%>');


            clearListEmphasis(listbox);
            createMatchingList(listbox, textbox.get_textBoxValue());
        }


        function clearListEmphasis(listbox) { ClearListEmphasis(listbox); }


        function createMatchingList(listbox, filterText) { CreateMatchingList(listbox, filterText); }


        // Clears the text from the filter.
        function clearFilterText() {
            var textbox = $find('<%=tbAvailableFilterUser.ClientID%>');
            textbox.clear();
        }


    </script>
</telerik:RadCodeBlock>
<asp:Table ID="Table1" runat="server" CssClass="mainTable">
    <asp:TableRow>
        <asp:TableCell CssClass="titleColumnLeftButton">
            <telerik:RadButton ID="btnAddUser" runat="server" Skin="Vista" AutoPostBack="false"
                OnClientClicked="addUser">
                <Icon PrimaryIconUrl="/UI/Images/add.png" PrimaryIconWidth="21px" PrimaryIconHeight="25px"
                    PrimaryIconTop="3px" PrimaryIconLeft="9px" />
            </telerik:RadButton>
        </asp:TableCell>
        <asp:TableCell CssClass="titleColumnRightButton">
            <telerik:RadButton ID="btnEditUser" runat="server" Skin="Vista" AutoPostBack="false"
                OnClientClicked="editUser">
                <Icon PrimaryIconUrl="/UI/Images/pencil.png" PrimaryIconWidth="21px" PrimaryIconHeight="25px"
                    PrimaryIconTop="3px" PrimaryIconLeft="9px" />
            </telerik:RadButton>
        </asp:TableCell>
    </asp:TableRow>
    <asp:TableRow>
        <asp:TableCell CssClass="titleColumnLeft">
            <asp:Literal runat="server" ID="litAvailable" /></asp:TableCell>
        <asp:TableCell CssClass="titleColumnRight">
            <span style="white-space: normal;">
                <asp:Label runat="server" ID="litSelected" />
            </span>
        </asp:TableCell>
    </asp:TableRow>
   
    <asp:TableRow>
        <asp:TableCell ColumnSpan="2" CssClass="listBoxTable">
            <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="100%" Width="100%"
                LoadingPanelID="LoadCombo">
                <asp:Table runat="server" ID="tblListBox" CssClass="subTable" >
                    <asp:TableRow>
                        <asp:TableCell CssClass="searchColumnLeft">
                            <asp:Table runat="server" ID="Table2"  CssClass="subTable" >
                                <asp:TableRow>
                                    <asp:TableCell ColumnSpan="2">
                                        <div class="cellTextBoxSearchL">
                                            <telerik:RadTextBox ID="tbAvailableFilterUser" runat="server" Width="100%" autocomplete="on"
                                                onkeyup="filterList();" />
                                        </div>
                                        <div class="cellLabelSearchL">
                                            <telerik:RadButton ID="rbtnClear" runat="server" Width="19px" AutoPostBack="false"
                                                OnClientClicking="rbtnClear_OnClientClicking" Style="margin-left: 1px">
                                                <Icon PrimaryIconUrl="/UI/Images/cross.png" PrimaryIconWidth="18px" PrimaryIconTop="3px"
                                                    PrimaryIconLeft="3px" />
                                            </telerik:RadButton>
                                        </div>
                                    </asp:TableCell>
                                </asp:TableRow>
                                 <asp:TableRow>
                                   <asp:TableCell CssClass="leftColumn">
                            <telerik:RadListBox ID="rlbAvailableUser" runat="server" Width="100%" AllowTransferOnDoubleClick="true"
                                SelectionMode="Multiple" Height="100%" EnableDragAndDrop="true" Sort="Ascending"
                                OnClientTransferring="rlbAvailableUser_OnClientTransferring" AutoPostBackOnTransfer="true">
                            </telerik:RadListBox>
                        </asp:TableCell>
                        <asp:TableCell CssClass="centerColumn">
                            <telerik:RadButton ID="btnToRight" runat="server" Width="19px" AutoPostBack="true"
                                OnClick="btnToRight_Click" Style="margin-left: 1px">
                                <Icon PrimaryIconUrl="/UI/Images/toRight.png" PrimaryIconWidth="16px" PrimaryIconTop="3px"
                                    PrimaryIconLeft="3px" />
                            </telerik:RadButton>
                            <br />
                            <br />
                            <telerik:RadButton ID="btnToLeft" runat="server" Width="19px" AutoPostBack="true"
                                Style="margin-left: 1px" OnClick="btnToLeft_Click">
                                <Icon PrimaryIconUrl="/UI/Images/toLeft.png" PrimaryIconWidth="16px" PrimaryIconTop="3px"
                                    PrimaryIconLeft="3px" />
                            </telerik:RadButton>
                            <br />
                            <br />
                            <telerik:RadButton ID="btnAllToRight" runat="server" Width="19px" AutoPostBack="true"
                                Style="margin-left: 1px" OnClick="btnAllToRight_Click">
                                <Icon PrimaryIconUrl="/UI/Images/allToRight.png" PrimaryIconWidth="16px" PrimaryIconTop="3px"
                                    PrimaryIconLeft="3px" />
                            </telerik:RadButton>
                            <br />
                            <br />
                            <telerik:RadButton ID="btnAllToLeft" runat="server" Width="19px" AutoPostBack="true"
                                Style="margin-left: 1px" OnClick="btnAllToLeft_Click">
                                <Icon PrimaryIconUrl="/UI/Images/allToLeft.png" PrimaryIconWidth="16px" PrimaryIconTop="3px"
                                    PrimaryIconLeft="3px" />
                            </telerik:RadButton>
                            <br />
                        </asp:TableCell>
                                  </asp:TableRow>
                            </asp:Table>
                        </asp:TableCell>
                        <asp:TableCell CssClass="searchColumnRight">
               <telerik:RadGrid ID="UserGrid" runat="server" AutoGenerateColumns="false" Skin="Vista"
                                AllowMultiRowSelection="True" PageSize="10" AllowPaging="true" EnableViewState="false">
                                <MasterTableView DataKeyNames="Id,FullName" ClientDataKeyNames="Id,FullName" CommandItemDisplay="None"
                                    EditMode="InPlace">
                                    <Columns>
                                        <telerik:GridClientSelectColumn CommandName="Select" UniqueName="Select" HeaderStyle-Width="30px"
                                            Resizable="false" />
                                        <telerik:GridTemplateColumn DataField="Id" HeaderText="Id" UniqueName="Id" Visible="false"
                                            ConvertEmptyStringToNull="true">
                                            <InsertItemTemplate>
                                                <telerik:RadTextBox ID="lblId" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Id") %> '
                                                    Width="150px" ReadOnly="true" Enabled="false" CssClass="labelGrid" />
                                            </InsertItemTemplate>
                                             
                                            <EditItemTemplate>
                                                <telerik:RadTextBox ID="txtId" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Id") %> '
                                                    Width="150px" CssClass="labelGrid" ReadOnly="true" />
                                            </EditItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn UniqueName="FullName" DataField="FullName" HeaderStyle-Width="60%">
                                            <ItemTemplate>
                                                <asp:Label ID="lblFullName" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "FullName") %>'></asp:Label>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn UniqueName="IsAdmin" DataField="IsInput" DataType="System.Boolean"
                                            HeaderStyle-Width="30%">
                                            <ItemTemplate>
                                                <asp:CheckBox ID="chkIsAdmin" Width="120px" runat="server" Checked='<%# (DataBinder.Eval(Container.DataItem,"IsAdmin") is DBNull ?false:Eval("IsAdmin")) %>'
                                                    OnCheckedChanged="chkIsAdmin_Checked" AutoPostBack="true" />
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                    </Columns>
                                </MasterTableView>
                                <ClientSettings>
                                    <ClientEvents OnGridCreated="GridCreated" OnRowSelected="RowSelected" OnRowDeselected="RowDeselected" />
                                </ClientSettings>
                            </telerik:RadGrid>
                        </asp:TableCell>
                      
                     
                    </asp:TableRow>
                </asp:Table>
            </telerik:RadAjaxPanel>
        </asp:TableCell>
    </asp:TableRow>
</asp:Table>
<asp:HiddenField ID="CommunityId" runat="server" />
<asp:HiddenField ID="UserId" runat="server"  />


<asp:HiddenField ID="UserNameBefore" runat="server"  />


this is my ascx.cs

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Resources;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using WebSearch.Components.CommonFunctions;
using WebSearch.Components.GeneralFunctions;
using WebSearch.SecurityModel;
using WebSearch.UI.UserControls;


namespace WebSearch.UI.Admin.UserControls.Community
{
    public partial class AssociateUsers : System.Web.UI.UserControl
    {


        #region Properties&Variables


        private string _culture;


        private ResourceManager _resources;


        private RadAjaxManager AjaxManager { get; set; }


        private RadAjaxLoadingPanel Loading { get; set; }


        public WSOrganization Organization = new WSOrganization();




        public int Id
        {
            get { return Convert.ToInt16(CommunityId.Value); } 
            set { CommunityId.Value = value.ToString(); }
        }




        public Notification _notification  = new Notification();


        public List<WSUser> GetUserAssociated
        {
            get { return CommunityUsers; }
            
        }




        protected List<WSUser> CommunityUsers
        {
            get
            {
                try
                {
                    object obj = Session["CommunityUsers"];


                    if (obj == null )
                    {
                        obj = Organization.GetUsersOfCommunity(Id);


                        if (obj != null)
                        {
                            Session["CommunityUsers"] = obj;
                        }
                        else
                        {
                            obj = new List<WSUser>();
                        }
                    }


                    return (List<WSUser>)obj;
                }
                catch
                {
                    Session["CommunityUsers"] = null;
                }
                return new List<WSUser>();
            }
            set { Session["CommunityUsers"] = value; }
        }


        protected List<WSUser> AvailableUsers
        {
            get
            {
                try
                {
                    object obj = Session["AvailableUsers"];
                    if (obj == null)
                    {
                        obj = Organization.GetAvailableUsers(Id);


                        if (obj != null)
                        {
                            Session["AvailableUsers"] = obj;
                        }
                        else
                        {
                            obj = new List<WSUser>();
                        }
                    }
                    return (List<WSUser>)obj;
                }
                catch
                {
                    Session["AvailableUsers"] = null;
                }
                return new List<WSUser>();
            }


            set { Session["AvailableUsers"] = value; }
        }
        


        #endregion




        #region Events


        #region Page


        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                LoadAjax();
                
            }
            catch(Exception ex)
            {
                _notification.LoadCatchNotification(ex, typeof(CommunityForm).FullName);
            }
           
        }


      


        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);


            GetInfo();
            LoadSettings();




            UserGrid.NeedDataSource += UserGrid_NeedSource;
            UserGrid.ItemCommand += UserGrid_ItemCommand;


        }


        private void UserGrid_ItemCommand(object sender, GridCommandEventArgs e)
        {
           if (e.CommandName == RadGrid.SelectCommandName && e.Item is GridDataItem)
           {
               var a = 1;
           }


        }


        #endregion


        #region Buttons


        protected void btnToRight_Click(object sender, EventArgs e)
        {
             List<WSUser> avalible = AvailableUsers;
             List<WSUser> communityUsers = CommunityUsers;


           foreach(RadListBoxItem item in  rlbAvailableUser.SelectedItems)
           {
               int userId = Convert.ToInt16(item.Value);


               communityUsers.Insert(0, GetUser(AvailableUsers, userId));
               avalible.Remove(GetUser(AvailableUsers, userId));


           }


            AvailableUsers = avalible;
            CommunityUsers = communityUsers;


            FillAvailableUsers();
            UserGrid.DataSource = CommunityUsers;
            UserGrid.Rebind();
            UserGrid.MasterTableView.ClearSelectedItems();


        }




        protected void btnToLeft_Click(object sender, EventArgs e)
        {
            List<WSUser> avalible = AvailableUsers;
            List<WSUser> communityUsers = CommunityUsers;


            foreach (GridDataItem  item in UserGrid.MasterTableView.GetSelectedItems())
            {
                int userId = Convert.ToInt16(item.GetDataKeyValue("Id"));


                avalible.Insert(0, GetUser(CommunityUsers, userId));
                communityUsers.Remove(GetUser(CommunityUsers, userId));


            }


            AvailableUsers = avalible;
            CommunityUsers = communityUsers;


            FillAvailableUsers();
            UserGrid.DataSource = CommunityUsers;
            UserGrid.Rebind();
            UserGrid.MasterTableView.ClearSelectedItems();
        }




        protected void btnAllToRight_Click(object sender, EventArgs e)
        {
            List<WSUser> avalible = AvailableUsers;
            List<WSUser> communityUsers = CommunityUsers;


            foreach (RadListBoxItem item in rlbAvailableUser.Items)
            {
                int userId = Convert.ToInt16(item.Value);


                communityUsers.Insert(0, GetUser(AvailableUsers, userId));
                avalible.Remove(GetUser(AvailableUsers, userId));


            }


            AvailableUsers = avalible;
            CommunityUsers = communityUsers;


            FillAvailableUsers();
            UserGrid.DataSource = CommunityUsers;
            UserGrid.Rebind();
            UserGrid.MasterTableView.ClearSelectedItems();
        }


        protected void btnAllToLeft_Click(object sender, EventArgs e)
        {
            List<WSUser> avalible = AvailableUsers;
            List<WSUser> communityUsers = CommunityUsers;


            foreach (GridDataItem item in UserGrid.MasterTableView.Items)
            {
                int userId = Convert.ToInt16(item.GetDataKeyValue("Id"));


                avalible.Insert(0, GetUser(CommunityUsers, userId));
                communityUsers.Remove(GetUser(CommunityUsers, userId));


            }


            AvailableUsers = avalible;
            CommunityUsers = communityUsers;


            FillAvailableUsers();
            UserGrid.DataSource = CommunityUsers;
            UserGrid.Rebind();
            UserGrid.MasterTableView.ClearSelectedItems();
        }


        #endregion


        #region grid


        protected void UserGrid_NeedSource(object sender, GridNeedDataSourceEventArgs e)
        {
            UserGrid.DataSource = CommunityUsers;
        }


      


        protected void chkIsAdmin_Checked(object sender, EventArgs e)
        {
            CheckBox chkIsAdmin = (CheckBox)sender;
            
            string Id = (chkIsAdmin.Parent.NamingContainer as GridDataItem).GetDataKeyValue("Id").ToString();


            List<WSUser> communityUsers = CommunityUsers;


           (GetUser(CommunityUsers, Convert.ToInt16(Id))).IsAdmin =  chkIsAdmin.Checked;


            CommunityUsers = communityUsers;
        }


        #endregion


        #region ListBox


        protected void rlbChosenUser_SelectedIndexChange(object sender, EventArgs e)
        {
            try
            {


            }
            catch (Exception ex)
            {
                _notification.LoadCatchNotification(ex, typeof(AssociateUsers).FullName);
            }
        }


        protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
        {
            switch (e.Argument)
            {
                case "RefeshForm":
                    UpdateSession();
                    
                    break;


                
            }
        }


        #endregion
        #endregion


        #region Methods


        #region Page


        private void UpdateSession()
        {
           


            List<WSUser> avalible =AvailableUsers;
            List<WSUser> comunityUsers = CommunityUsers;


            avalible = Organization.GetAvailableUsers(Id);
            comunityUsers = Organization.GetUsersOfCommunity(Id);




            AvailableUsers = avalible;
            CommunityUsers = comunityUsers;
            FillAvailableUsers();
            UserGrid.DataSource = CommunityUsers;
            UserGrid.Rebind();


            foreach(GridDataItem  item in UserGrid.Items)
            {
                if (item.GetDataKeyValue("Id").ToString() == UserId.Value)
                {
                    item.Selected = true;


                   btnEditUser.ToolTip =
                    _resources.GetString(btnEditUser.ID + "_ToolTip", new CultureInfo(_culture)).Replace("{UserFullName}",
                                                                                            item.GetDataKeyValue("FullName").ToString());


                }
            }


            //if (items.Count() > 0)
            //{
            //    foreach (GridDataItem item in items)
            //    {
                    
            //        foreach (GridDataItem row in UserGrid.Items)
            //        {
            //            if (row.GetDataKeyValue("Id").ToString() == item.GetDataKeyValue("Id").ToString())
            //            {
            //                row.Selected = true;
            //            }


            //        }


            //    }
            //}




            //if (items.Count() == 1)
            //{
            //    //string userFullName = items[0].GetDataKeyValue("FullName").ToString();


            //    //btnEditUser.ToolTip =
            //    //_resources.GetString(btnEditUser.ID + "_ToolTip", new CultureInfo(_culture)).Replace("{UserFullName}",
            //    //                                                                        userFullName);
            
            //}


            






        }


        private void PageSettings()
        {
            btnAddUser.Text = _resources.GetString(btnAddUser.ID, new CultureInfo(_culture));
            btnEditUser.Text = _resources.GetString(btnEditUser.ID, new CultureInfo(_culture));
            btnEditUser.ToolTip = _resources.GetString(btnEditUser.ID + "_ToolTip", new CultureInfo(_culture));




            litAvailable.Text = _resources.GetString(litAvailable.ID, new CultureInfo(_culture));
            litSelected.Text = _resources.GetString(litSelected.ID, new CultureInfo(_culture));


            tbAvailableFilterUser.EmptyMessage = _resources.GetString(tbAvailableFilterUser.ID , new CultureInfo(_culture));


            ButtonsSetting();
        }


        private void ButtonsSetting()
        {
            btnToRight.ToolTip = _resources.GetString(btnToRight.ID, new CultureInfo(_culture));
            btnToLeft.ToolTip = _resources.GetString(btnToLeft.ID, new CultureInfo(_culture));
            btnAllToRight.ToolTip = _resources.GetString(btnAllToRight.ID, new CultureInfo(_culture));
            btnAllToLeft.ToolTip = _resources.GetString(btnAllToLeft.ID, new CultureInfo(_culture));
            //if (!Page.IsPostBack) btnEditUser.Visible = false;
        }


        private void LoadAjax()
        {
            AjaxManager = Page.FindControl("RadAjaxManager1") as RadAjaxManager;
            AjaxManager.AjaxRequest += RadAjaxManager1_AjaxRequest;


            Loading = Page.FindControl("LoadCombo") as RadAjaxLoadingPanel;


            if (AjaxManager == null || Loading == null) return;


            AjaxManager.AjaxSettings.AddAjaxSetting(UserGrid, UserGrid);
           
            AjaxManager.AjaxSettings.AddAjaxSetting(AjaxManager, UserGrid);
            AjaxManager.AjaxSettings.AddAjaxSetting(AjaxManager, btnEditUser);
            AjaxManager.AjaxSettings.AddAjaxSetting(btnEditUser, UserGrid);
          
         
        }


        private void GetInfo()
        {
            _culture = Variables.CurrentCulture();
            _resources = Components.GeneralFunctions.Resources.GetAdminUserControlResources("AssociateUsers", "Community");
        }
        
        private void LoadSettings()
        {
            if (string.IsNullOrEmpty(_culture) || _resources == null) GetInfo();
            PageSettings();
            GridSettings();
            
            FillAvailableUsers();
        }




        private static WSUser GetUser(IEnumerable<WSUser> fieldsToSearchIn, int userId)
        {
            return fieldsToSearchIn.FirstOrDefault(x => x.Id == userId);
        }


        #endregion


        #region grid


        private void GridSettings()
        {
            CustomProperties(UserGrid); /* use common properties */
            GridFunction.SetHeaderNameUnCommonGrid(UserGrid, _resources, null,1);
            GridFunction.GridOptions(UserGrid);


        }


        public void CustomProperties(RadGrid grid)
        {
            grid.AllowPaging = true;
            grid.AllowSorting = true;
            grid.CellSpacing = 0;
            grid.EnableHeaderContextMenu = false;
            grid.EnableHeaderContextFilterMenu = false;




            grid.AllowFilteringByColumn = true;
            grid.GridLines = GridLines.None;
            grid.Skin = "Vista";
            grid.Width = Unit.Percentage(100);
            grid.PageSize = 10;




            grid.ItemStyle.VerticalAlign = VerticalAlign.Middle;
            grid.GroupingSettings.CaseSensitive = false;


            grid.PagerStyle.AlwaysVisible = false;
            grid.PagerStyle.Mode = GridPagerMode.NumericPages;




            grid.ClientSettings.ActiveRowIndex = "true";
            grid.ClientSettings.AllowColumnHide = false;


            grid.ClientSettings.Resizing.AllowColumnResize = false;
            grid.ClientSettings.Resizing.ClipCellContentOnResize = true;
            grid.ClientSettings.Resizing.EnableRealTimeResize = true;


            grid.ClientSettings.Scrolling.AllowScroll = false;


            grid.ClientSettings.Scrolling.UseStaticHeaders = true;


            grid.Culture = new CultureInfo(_culture);
            grid.ClientSettings.Selecting.AllowRowSelect = true;


            grid.MasterTableView.GetColumnSafe("RowIndicator").Display = false;
            grid.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;
            
            grid.MasterTableView.Width = Unit.Percentage(100);
            grid.MasterTableView.EnableHeaderContextMenu = false;
        }


       


        #endregion


        #region ListBox


        private void FillAvailableUsers()
        {
            
            RadListBoxItem item;
            rlbAvailableUser.Items.Clear();


            foreach (WSUser cUser in AvailableUsers)
            {
                string textItem;


                if (cUser.FullName.Length > 25)
                {
                    textItem = StringFunction.TruncateString(cUser.FullName, 25);
                }
                else
                {
                    textItem = cUser.FullName;
                }
                item = new RadListBoxItem
                {
                    Text = textItem,
                    Value = cUser.Id.ToString(),
                    ToolTip = cUser.FullName
                };


                rlbAvailableUser.Items.Add(item);
            }
        }


        #endregion


        #endregion


       
    }
}




I tried Remove RadAjaxPanel, and Add

AjaxManager.AjaxSettings.AddAjaxSetting(btnAddUser, rlbAvailableUsers); --> BUT ListBox disappear show a gray  
 line.
And then I added 

AjaxManager.AjaxSettings.AddAjaxSetting(btnToleft, rlbAvailableUsers); -->ListBox disappear show a  gray  
line.
 

AjaxManager.AjaxSettings.AddAjaxSetting(btnAllToleft, rlbAvailableUsers);  -->ListBox disappear show a gray line. 





I need help!!! Please!!!
regards
           


Nencho
Telerik team
 answered on 15 Oct 2012
6 answers
136 views
hi i have usercontrol(cascading dropdown) in radgrid edit template
if i use
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">

 <AjaxSettings>

 <telerik:AjaxSetting AjaxControlID="RadGrid1">

 <UpdatedControls>

 <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />

 </UpdatedControls>

 </telerik:AjaxSetting>

 </AjaxSettings>

 </telerik:RadAjaxManagerProxy>
works fine, but does not work RadAjaxLoadingPanel1
if i use

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

 <AjaxSettings>

 <telerik:AjaxSetting AjaxControlID="RadGrid1">

 <UpdatedControls>

 <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />

 </UpdatedControls>

 </telerik:AjaxSetting>

 </AjaxSettings>

 </telerik:RadAjaxManager>
does not work and gives me a javascript error.
is there a solution? thanks

 

 

 

 

 

Eyup
Telerik team
 answered on 15 Oct 2012
2 answers
94 views
Is there anyone who knows how to do this. I have a navigation menu and I want to load the links in their respective category tabs. ie. report.aspx goes to Report tab and parameter.aspx goes to Parameter tab. I've tried doing it with the radsplitter and radpane but for some reason the width and height of the page gets resized down even when set to 100%.

Here's what i'm trying to do. 
<telerik:RadTabStrip runat="server" MultiPageID="RadMultiPage1" SelectedIndex="0"
                            ID="radstrip1">
                            <Tabs>
                                <telerik:RadTab runat="server" Text="Reports" Selected="true">
                                </telerik:RadTab>
                                <telerik:RadTab runat="server" Text="Parameters">
                                </telerik:RadTab>
                            </Tabs>
                        </telerik:RadTabStrip>
                        <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" Height="100%"
                            Width="100%">
                            <telerik:RadPageView ID="pageview1" runat="server" Width="100%" Height="100%">
                                <telerik:RadSplitter ID="radSplitter1" runat="server" Width="100%" Height="100%">
                                    <telerik:RadPane runat="server" ID="radpane1" ContentUrl="Blank.aspx" Scrolling="None">
                                    </telerik:RadPane>
                                </telerik:RadSplitter>
                            </telerik:RadPageView>
                            <telerik:RadPageView ID="pageview2" runat="server" Width="100%" Height="100%">
                                <telerik:RadSplitter ID="radSplitter2" runat="server" Width="100%" Height="100%">
                                    <telerik:RadPane runat="server" ID="radpane2" ContentUrl="Blank.aspx" Scrolling="None">
                                    </telerik:RadPane>
                                </telerik:RadSplitter>
                            </telerik:RadPageView>
                        </telerik:RadMultiPage>

Code Behind goes something like this..
If link.Report Then
target ="radpane1"
ElseIf link.ParmSelect Then
target="radpane2"

Greatly appreciated if anyone could help :)
Charles
Top achievements
Rank 1
 answered on 15 Oct 2012
1 answer
219 views
The problem is easily reproduced with the following example:
ASPX:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="Sample.Test" %> 

<!DOCTYPE html> 

<head runat="server">
    <title></title>
</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>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="DropDownList1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadAjaxPanel1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <div>
            <asp:DropDownList ID="DropDownList1" runat="server" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged"
                AutoPostBack="True" CssClass="inputField">
                <asp:ListItem Text="-Select-"></asp:ListItem>
                <asp:ListItem Text="1" Value="1"></asp:ListItem>
                <asp:ListItem Text="2" Value="2"></asp:ListItem>
            </asp:DropDownList>
            <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
                <asp:Panel ID="Panel1" runat="server" Visible="False" Height="100px" Width="300px">
                    panel 1
                <br />
                    <telerik:RadNumericTextBox ID="tbNum1" runat="server" MinValue="1">
                        <NumberFormat DecimalDigits="0"></NumberFormat>
                    </telerik:RadNumericTextBox>
                </asp:Panel>
                <asp:Panel ID="Panel2" runat="server" Visible="False">
                    panel 2
                </asp:Panel>
            </telerik:RadAjaxPanel>
            <telerik:RadButton ID="RadButton1" runat="server" Text="RadButton" OnClick="RadButton1_Click"></telerik:RadButton>
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Metro">
            </telerik:RadAjaxLoadingPanel>
        </div>
    </form>
</body>
</html>

Code behind:
using System;
 
namespace Sample
{
    public partial class Test : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
 
        }
 
        protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            System.Threading.Thread.Sleep(500);
            switch (DropDownList1.SelectedIndex)
            {
                case 1:
                    {
                        Panel1.Visible = true;
                        Panel2.Visible = false;
                        break;
                    }
                case 2:
                    {
                        Panel1.Visible = false;
                        Panel2.Visible = true;
                        break;
                    }
                default:
                    {
                        Panel1.Visible = false;
                        Panel2.Visible = false;
                        break;
                    }
            }
        }
 
        protected void RadButton1_Click(object sender, EventArgs e)
        {
 
        }
    }
}

After selecting option "1" from the dropdownlist, you see a RadNumericTextBox, in which you can enter any character and not only numbers.(same goes for other controls that use javascript such as DatePicker)
After clicking the button, the controls works like they should.

I've found out that placing the dropdownlist inside the RadAjaxPanel solves the problem, but that's not really what I want in my real web page. 
So I'd like to know if I'm not doing it right (I'm not very experienced with the Telerik Ajax controls), or is this a bug?
Tsvetina
Telerik team
 answered on 15 Oct 2012
2 answers
455 views
Hi,

Is there a way to unselect and uncheck items in a listbox client side without looping through every item in the list?  I see that there is a clearSelection option but this does not uncheck any of the items.
I was hoping to loop through the checked items using the get_checkeditems option but I can't figure out how to loop through the get_checkeditems collection and then uncheck them in javascript.

Thank You
Tracy
Tracy
Top achievements
Rank 1
 answered on 15 Oct 2012
1 answer
100 views
I've been working on a grid with a dynamic number of columns. One of the columns required a sum across columns with a total in a new calculated column. I implemented this and when the expressions for the miscalculation become too large (not very bit at all) it will crash iis with a stack overflow exception.

It's important to note I'm working around another bug where is one of the data values is null calculated expressions don't work.

So I was dynamically defining the expression for the calculated column like so:

for (int i = 0; i < dataColumns.Count; i++)
{
    expression += String.Format("({{{0}}} == null ? 0 : {{{0}}})+", IntFormatter.ToString(i));
}
expression = StringFormatter.Left(expression, expression.Length - 1);
ccol.Expression = expression;

When I have 10ish (or more) iterations of the above loop then I get the stack overflow exception from this:

//rebind
RadGridSearch.Rebind();

Removing the calculation allows this to work properly.

I'm reworking my implementation to do the calculation on the database side but thought I should mention this in case anyone else runs into this problem.

Our solution is using a slightly older build: Telerik.Web.UI_2011_2_712_Dev
Vasil
Telerik team
 answered on 15 Oct 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?