Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
370 views
I have a listbox that call a java function that executes a SQL Stored Procedure. Everything works fine, however, I can't seem to get the listbox to refresh. Any help apprciated.

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="aeries_users.aspx.vb" Inherits="_Default" culture="auto" meta:resourcekey="PageResource1" uiculture="auto" %>
  
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head id="Head1" runat="server">
    <title>IT Central</title>
<link rel="stylesheet" type="text/css" href="~/includes/ITC_Main.css" /> 
  
  
  
  
  
  
  
</head>
<body>
    <form id="form1" runat="server">
  
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
          
        <script type="text/javascript">
          
        function SiteAdd() {
            var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
            ajaxManager.ajaxRequest();
        }
        </script
  
    </telerik:RadCodeBlock>
  
    <div id="header">
  
        <table cellpadding="0" cellspacing="0" style="width: 100%; height: 40px;">
            <tr>
                <td style="width: 200px; vertical-align: middle; text-align: center;">
                    <img alt="" src="../../images/aalogo.gif" style="width: 169px; height: 35px" /></td>
                <td style="text-align: center;">
  
  
  
                    <datelbl:ShowDate ID="ShowDate1" runat="server" />
                </td>
                <td style="width: 300px; text-align: center;">
  
  
  
                                        <table cellpadding="2" cellspacing="0" 
                          
                        style="width: 292px; height: 40px; background-image: url('../../images/headerinset.gif'); text-align: center;">
                        <tr>
                            <td style="font-weight: bold; font-size: small; font-family: Arial, Helvetica, sans-serif; color: #00B000; text-align: center;">
                                Logged in as: 
                                <asp:LoginName ID="LoginName1" runat="server" Font-Names="Arial" 
                                    Font-Size="Small" ForeColor="#597791" 
                                    meta:resourcekey="LoginName1Resource1" />
                                     
                                <asp:LoginStatus ID="LoginStatus1" runat="server" CssClass="login" 
                                    meta:resourcekey="LoginStatus1Resource1" />
                            </td>
                        </tr>
                    </table></td>
                <td style="text-align: center; vertical-align: middle; width: 175px;">
                    <img alt="" src="../../images/aatusdlogo.gif" style="width: 152px; height: 36px" /></td>
            </tr>
        </table>
  
    </div>
        <div id="subheader">
  
    </div>
            <div>
        <table cellpadding="0" cellspacing="0" style="width: 100%">
            <tr>
                <td style="width: 250px; background-image: url('../../images/menuback.gif'); background-color: #E6E6E6; border-bottom-style: solid; border-bottom-width: thin; border-bottom-color: #000000;" 
                    valign="top">
                    <telerik:RadPanelBar ID="rpb_AA_Menu" Runat="server" DataFieldID="DataFieldID" 
                        DataFieldParentID="DataFieldParentID" 
                        DataNavigateUrlField="DataNavigateUrlField" DataSourceID="sds_AA_Menu" 
                        DataTextField="DataTextField" DataValueField="DataTextField" Width="250px" 
                        PersistStateInCookie="True" Skin="Office2007">
                        <DataBindings>
                            <telerik:RadPanelItemBinding SelectedImageUrlField="ImageURL" 
                                ExpandedImageUrlField="ImageURL" HoveredImageUrlField="ImageURL" 
                                ImageUrlField="ImageURL" />
                            <telerik:RadPanelItemBinding ImageUrlField="ImageURL" />
                        </DataBindings>
                    </telerik:RadPanelBar>
                      
                </td>
                <td valign="top" 
                    style="background-color: #FFFFFF; border-bottom-style: solid; border-bottom-width: thin; border-bottom-color: #000000;">
                    <table cellpadding="0" cellspacing="0" style="width: 100%">
                        <tr>
                            <td style="padding: 10px">
     <h1>
                    User Manager - Users</h1>
                                <table cellpadding="0" cellspacing="0" style="width: 100%">
                                    <tr>
                                        <td class="tbltdHeader">
                                            Year</td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <telerik:RadComboBox ID="rcb_Database" Runat="server" 
                                                DataSourceID="sds_Database" DataTextField="DatabaseName" 
                                                DataValueField="DatabaseName" AutoPostBack="True" AppendDataBoundItems="True">
                                                <Items>
                                                    <telerik:RadComboBoxItem Value = "" Text="Select" />
                                                </Items>
                                            </telerik:RadComboBox>
                                            <telerik:RadComboBox ID="rcb_Database0" Runat="server" 
                                                DataSourceID="sds_Database" DataTextField="DatabaseName" 
                                                DataValueField="DatabaseName" AutoPostBack="True" 
                                                AppendDataBoundItems="True" SelectedValue='<%#Session("DBName") %>'>
                                                <Items>
                                                    <telerik:RadComboBoxItem Value = "" Text="Select" />
                                                </Items>
                                            </telerik:RadComboBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="height: 16px">
                                            </td>
                                    </tr>
                                    <tr>
                                        <td class="tbltdHeader">
                                            User Details</td>
                                    </tr>
                                    <tr>
                                        <td>
                                             </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <telerik:RadComboBox ID="rcb_Users" Runat="server" DataTextField="memberName" 
                                                DataValueField="memberName" AutoPostBack="True" Height="300px" 
                                    AppendDataBoundItems="True">
                                                <Items>
                                                    <telerik:RadComboBoxItem Value = "" Text="Select" />
                                                </Items>
                                            </telerik:RadComboBox>
                                        </td>
                                    </tr>
                                </table>
                                <p>
                                    <asp:FormView ID="fvw_UserDetails" runat="server" DataSourceID="sds_UserDetails" 
                                        Width="750px">
                                        <ItemTemplate>
                                            <table cellpadding="0" cellspacing="0" style="width: 100%">
                                                <tr>
                                                    <td class="tbltd" style="width: 87px">
                                                        Full Name:</td>
                                                    <td style="width: 220px">
                                                        <asp:Label ID="FullNameLabel" runat="server" Text='<%# Bind("FullName") %>' />
                                                    </td>
                                                    <td class="tbltd" style="width: 75px">
                                                        Site:</td>
                                                    <td>
                                                        <asp:Label ID="OfficeLabel" runat="server" Text='<%# Bind("Site") %>' />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td class="tbltd" style="width: 87px">
                                                        User Name:
                                                    </td>
                                                    <td style="width: 220px">
                                                        <asp:Label ID="UserNameLabel" runat="server" Text='<%# Bind("UserName") %>' />
                                                    </td>
                                                    <td class="tbltd" style="width: 75px">
                                                        IP Phone:</td>
                                                    <td>
                                                        <asp:Label ID="IP_PhoneLabel" runat="server" Text='<%# Bind("PhoneIP") %>' />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td class="tbltd" style="width: 87px">
                                                        Job Title:</td>
                                                    <td style="width: 220px">
                                                        <asp:Label ID="Job_TitleLabel" runat="server" Text='<%# Bind("JobTitle") %>' />
                                                    </td>
                                                    <td class="tbltd" style="width: 75px">
                                                        Phone:</td>
                                                    <td>
                                                        <asp:Label ID="Phone_NumberLabel" runat="server" Text='<%# Bind("Phone1") %>' />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td class="tbltd" style="width: 87px">
                                                        Department:</td>
                                                    <td style="width: 220px">
                                                        <asp:Label ID="DepartmentLabel" runat="server" 
                                                            Text='<%# Bind("Department") %>' />
                                                    </td>
                                                    <td class="tbltd" style="width: 75px">
                                                        Email:</td>
                                                    <td>
                                                         <asp:HyperLink NavigateUrl='<%# Bind("EmailAddress", "mailto:{0}") %>'
                                                         Text='<%# Bind("EmailAddress") %>' runat="server" ID="hlEmail"></asp:HyperLink>
                                                           
                                                    </td>
                                                </tr>
                                            </table>
                                        </ItemTemplate>
                                    </asp:FormView>
                                </p>
                                <h2>
                                    Roles</h2>
  
                                <hr color="#7698BA" class="hrblue"/>
                                <table cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td style="width: 250px; vertical-align: top;" class="tbltdHeader">
  
  
                                            Job Roles</td>
                                        <td style="width: 250px; vertical-align: top;" class="tbltdHeader">
  
  
                                            <table cellpadding="0" cellspacing="0" style="width: 100%">
                                                <tr>
                                                    <td style="width: 92px">
  
  
                                            Task Roles</td>
                                                    <td>
                                                        <asp:ImageButton 
                                                ID="ImageButton1" runat="server" ImageUrl="~/images/i-icon.gif" />
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                        <td style="width: 250px; vertical-align: top;" class="tbltdHeader">
                                            Explicit Task Roles</td>
                                    </tr>
                                    <tr>
                                        <td style="width: 250px; vertical-align: top;">
  
  
                                    <telerik:RadListBox ID="rlb_JobRole" runat="server"
                                    DataKeyField="DbRole" 
                                                DataSortField="DbRole"  DataTextField="DbRole" 
                                                DataValueField="DbRole" Width="245px" AutoPostBack="True" 
                                                AllowAutomaticUpdates="True">
                                    </telerik:RadListBox>
  
  
  
  
  
  
                                            <table cellpadding="0" cellspacing="0" style="width: 100%">
                                                <tr>
                                                    <td>
                                                         </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <asp:Button ID="btn_DeleteJobRole" runat="server" Text="Delete Job" />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td style="text-align: center">
  
                                                         </td>
                                                </tr>
                                                <tr>
                                                    <td class="tbltdHeader">
  
                                                        Add Job Role</td>
                                                </tr>
                                                <tr>
                                                    <td>
  
                                             <telerik:RadComboBox ID="rcb_JobRoles" Runat="server" 
                                                DataTextField="DbRole" 
                                                DataValueField="DbRole" AppendDataBoundItems="True" 
                                                 Height="300px">
                                                <Items>
                                                    <telerik:RadComboBoxItem Value = "" Text="Select" />
                                                </Items>
                                            </telerik:RadComboBox>
  
  
  
  
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                         </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <asp:Button ID="btn_AddJobRole" runat="server" Text="Add Job" />
                                                    </td>
                                                </tr>
                                                </table>
  
                                        </td>
                                        <td style="width: 250px; vertical-align: top;">
  
  
                                    <telerik:RadListBox ID="rlb_TaskRole" runat="server" 
                                    DataKeyField="dbRole" 
                                                DataSortField="dbRole"  DataTextField="dbRole" 
                                                DataValueField="dbRole" Width="245px">
                                    </telerik:RadListBox>
  
  
  
  
  
  
                                        </td>
                                        <td style="width: 250px; vertical-align: top;">
  
  
                                    <telerik:RadListBox ID="rlb_ExplicitTaskRole" runat="server"
                                    DataKeyField="DbRole" 
                                                DataSortField="DbRole"  DataTextField="DbRole" 
                                                DataValueField="DbRole" Width="245px" 
                                                AllowAutomaticUpdates="True">
                                    </telerik:RadListBox>
  
  
  
  
  
  
                                            <table cellpadding="0" cellspacing="0" style="width: 100%">
                                                <tr>
                                                    <td>
                                                         </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <asp:Button ID="btn_DeleteTaskRole" runat="server" Text="Delete Task" />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td style="text-align: center">
  
                                                         </td>
                                                </tr>
                                                <tr>
                                                    <td class="tbltdHeader">
  
                                                        Add Task Role</td>
                                                </tr>
                                                <tr>
                                                    <td>
  
                                             <telerik:RadComboBox ID="rcb_TaskRoles" Runat="server" 
                                                DataTextField="DbRole" 
                                                DataValueField="DbRole" AppendDataBoundItems="True" 
                                                 Height="300px">
                                                <Items>
                                                    <telerik:RadComboBoxItem Value = "" Text="Select" />
                                                </Items>
                                            </telerik:RadComboBox>
  
  
  
  
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                         </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <asp:Button ID="btn_AddTaskRole" runat="server" Text="Add Task" />
                                                    </td>
                                                </tr>
                                                </table>
  
  
  
  
  
  
                                        </td>
                                    </tr>
                                    </table>
  
                                <hr class="hrblue"/>
                                <table cellpadding="0" cellspacing="0" style="width: 100%">
                                    <tr>
                                        <td class="tbltdHeader" valign="top" width="275px">
                                            Assigned Sites</td>
                                            <td class="tbltdHeader" valign="top">
                                                Available Sites</td>
                                        </tr>
                                        <tr>
                                            <td valign="top" width="275px">
  
  
                                    <telerik:RadListBox ID="rlb_UserSites" runat="server"
                                                DataKeyField="SiteName" DataSortField="SiteName"  DataTextField="SiteName" 
                                                DataValueField="SiteName" Width="245px" AllowAutomaticUpdates="True">
                                            <ItemTemplate>
                                                <div>
                                                <table cellpadding="0" cellspacing="0" style="padding: 0px; margin: 0px; width: 100%; border-collapse: collapse; border-spacing: 0px;">
                                                    <tr>
                                                        <td style="width: 20px">
                                                            <%# DataBinder.Eval(Container.DataItem, "IDSite")%></td>
                                                        <td style="width: 8px; border-left-style: solid; border-left-width: 1px; border-left-color: #000000; ">
                                                             </td>
                                                        <td>
                                                            <%# DataBinder.Eval(Container.DataItem, "SiteName")%></td>
                                                    </tr>
                                                </table>
                                                </div>
                                            </ItemTemplate>
                                    </telerik:RadListBox>
  
                                            </td>
                                            <td valign="top">
  
                                    <telerik:RadListBox ID="rlb_UserNotInSites" runat="server"
                                                DataKeyField="SiteName" DataSortField="SiteName"  DataTextField="SiteName" 
                                                DataValueField="SiteName" Width="245px" AllowAutomaticUpdates="True" 
                                                    onclientitemdoubleclicked="SiteAdd" AutoPostBack="True">
                                            <ItemTemplate>
                                                <div>
                                                <table cellpadding="0" cellspacing="0" style="padding: 0px; margin: 0px; width: 100%; border-collapse: collapse; border-spacing: 0px;">
                                                    <tr>
                                                        <td style="width: 20px">
                                                            <%# DataBinder.Eval(Container.DataItem, "IDSite")%></td>
                                                        <td style="width: 8px; border-left-style: solid; border-left-width: 1px; border-left-color: #000000; ">
                                                             </td>
                                                        <td>
                                                            <%# DataBinder.Eval(Container.DataItem, "SiteName")%></td>
                                                    </tr>
                                                </table>
                                                </div>
                                            </ItemTemplate>
                                    </telerik:RadListBox>
  
  
  
                                            </td>
                                        </tr>
                                </table>
  
                                <hr class="hrblue"/>
                                <h2>
                                    User Notes</h2>
                <telerik:RadGrid ID="rgd_UserNotes" runat="server" DataSourceID="sds_UserNotes" 
                                    GridLines="None" AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True" 
                                    Width="900px" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" 
                                    AllowAutomaticUpdates="True" CssClass="radgrid" Skin="Telerik">
<MasterTableView CommandItemDisplay="Bottom" AutoGenerateColumns="False" DataKeyNames="IDUserNotes" DataSourceID="sds_UserNotes">
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
  
<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
<CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
    <Columns>
        <telerik:GridBoundColumn DataField="EnterDate" DefaultInsertValue="" HeaderText=" " SortExpression="EnterDate" UniqueName="EnterDate" ItemStyle-VerticalAlign="Middle" ItemStyle-Width="75px" DataFormatString="{0:d}">
<ItemStyle VerticalAlign="Middle"></ItemStyle>
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="UserName" DefaultInsertValue="" HeaderText="UserName" SortExpression="UserName" UniqueName="UserName" ItemStyle-VerticalAlign="Middle" Visible="False">
<ItemStyle VerticalAlign="Middle"></ItemStyle>
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Notes" DefaultInsertValue="" HeaderText=" " SortExpression="Notes" UniqueName="Notes" Visible="True">
        </telerik:GridBoundColumn>
    </Columns>
                    <EditFormSettings EditFormType="Template">
                <FormTemplate>
  
  
                                                                 <h2>
                                    Item</h2>
                                <table cellpadding="0" cellspacing="0" style="width: 100%">
                                    <tr>
                                        <td class="tbltd" style="width: 98px">
                                            User Name:</td>
                                        <td style="width: 210px">
                                            <asp:TextBox ID="tbx_UserName" Text='<%# Bind("UserName") %>' runat="server"></asp:TextBox>
                                        </td>
                                        <td class="tbltd">
                                             </td>
                                    </tr>
                                    <tr>
                                        <td class="tbltd" style="width: 98px">
                                            Notes</td>
                                        <td style="width: 210px">
                                            <asp:TextBox ID="tbx_Notes" Text='<%# Bind("Notes") %>' runat="server"></asp:TextBox>
                                        </td>
                                          
                                    </tr>
                                </table>
                                <table cellpadding="0" cellspacing="0" style="width: 100%">
                                    <tr>
                                        <td style="width: 66px">
                                            <asp:Button ID="btnUpdate" Text='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "Insert", "Update") %>' runat="server" CommandName='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "PerformInsert", "Update")%>'></asp:Button>
                                        </td>
                                        <td>
                                            <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel"></asp:Button>
                                        </td>
                                        <td>
                                             </td>
                                    </tr>
                                </table>
                                <br />
  
                </FormTemplate>
            </EditFormSettings>
</MasterTableView>
                </telerik:RadGrid>
  
                                <p>
                                    </p>
                                <p>
                                     </p>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </div>
            <div id="footer">
  
    </div>
        <telerik:RadToolTip ID="RadToolTip4" runat="server" Height="25px" Width="150px"
        TargetControlID="ImageButton1" RelativeTo="Element" 
         Position="TopCenter" EnableShadow="true" Sticky="True" >
             Click on a Job Role to<br />  display its associated<br />  Task Roles.
    </telerik:RadToolTip>
  
  
        <asp:SqlDataSource ID="sds_AA_Menu" runat="server" 
        ConnectionString="<%$ ConnectionStrings:AeriesAdmin_ConnectionString %>" 
        SelectCommand="SELECT [DataFieldID], [DataFieldParentID], [DataTextField], [DataNavigateUrlField], [ImageURL], [UserLevel] FROM [AA_Menu] WHERE ([UserLevel] LIKE '%' + @UserLevel + '%')">
            <SelectParameters>
                <asp:SessionParameter Name="UserLevel" SessionField="RoleName" Type="String" />
            </SelectParameters>
    </asp:SqlDataSource>
      
    <telerik:RadScriptManager ID="rsm_AeriesAdmin" Runat="server">
    </telerik:RadScriptManager>
    <telerik:RadFormDecorator ID="rfd_AeriesAdmin" Runat="server" Skin="WebBlue" />
      
    <br />
  
  
  
    <asp:SqlDataSource ID="sds_UserDetails" runat="server" 
        ConnectionString="<%$ ConnectionStrings:AeriesAdmin_ConnectionString %>" 
        SelectCommand="SELECT [FullName], [UserName], [EmailAddress], [JobTitle], [Phone1], [Site], [Department], [PhoneIP] FROM [vw_AA_Users] WHERE ([UserName] = @UserName)">
        <SelectParameters>
            <asp:ControlParameter ControlID="rcb_Users" Name="UserName" 
                PropertyName="SelectedValue" Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>
  
  
    <asp:SqlDataSource ID="sds_Database" runat="server" 
        ConnectionString="<%$ ConnectionStrings:AeriesAdmin_ConnectionString %>" 
        SelectCommand="SELECT DISTINCT [DatabaseName] FROM [vw_AA_Databases] ORDER BY [DatabaseName]">
        </asp:SqlDataSource>
  
  
    <asp:SqlDataSource ID="sds_UserNotes" runat="server" 
        ConnectionString="<%$ ConnectionStrings:AeriesAdmin_ConnectionString %>" 
        DeleteCommand="DELETE FROM [AA_UserNotes] WHERE [IDUSerNotes] = @IDUSerNotes" 
        InsertCommand="INSERT INTO [AA_UserNotes] ([UserName], [Notes]) VALUES (@UserName, @Notes)" 
        SelectCommand="SELECT [IDUSerNotes], [EnterDate], [UserName], [Notes] FROM [AA_UserNotes] WHERE ([UserName] = @UserName)" 
        UpdateCommand="UPDATE [AA_UserNotes] SET [UserName] = @UserName, [Notes] = @Notes WHERE [IDUSerNotes] = @IDUSerNotes">
        <DeleteParameters>
            <asp:Parameter Name="IDUSerNotes" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="UserName" Type="String" />
            <asp:Parameter Name="Notes" Type="String" />
        </InsertParameters>
        <SelectParameters>
            <asp:ControlParameter ControlID="rcb_Users" Name="UserName" 
                PropertyName="SelectedValue" Type="String" />
        </SelectParameters>
        <UpdateParameters>
            <asp:Parameter Name="UserName" Type="String" />
            <asp:Parameter Name="Notes" Type="String" />
            <asp:Parameter Name="IDUSerNotes" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>
  
  
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="rlb_UserNotInSites">
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
  
  
    <br />
  
    <br />
      
    </form>
      
    </body>
</html>

Imports System.Data
Imports System.Data.SqlClient
Imports Telerik.Web.UI
Imports System.CodeDom
Imports System.Web
Imports System.Web.Security
Imports System.Web.Security.Roles
Imports System.Web.Security.Membership
Imports System.Security
Imports System.Security.Principal.WindowsIdentity
Imports System.Drawing
Imports System.Threading
  
Partial Class _Default
    Inherits System.Web.UI.Page
  
    'Protected Sub RadPanelBar1_DataBound1(ByVal sender As Object, ByVal e As System.EventArgs) Handles rpb_AA_Menu.DataBound
    '    rpb_AA_Menu.Items(0).Expanded = True
    '    rpb_AA_Menu.Items(1).Expanded = True
    'End Sub
  
    '**********************************************************************
    'Format combo boxes
    '**********************************************************************
  
    Protected Sub rcb_Roles_DataBound(sender As Object, e As System.EventArgs) Handles rcb_JobRoles.DataBound
  
        Dim cbox = DirectCast(sender, RadComboBox)
        Dim MaxWidth As Integer = 155
  
        For Each item As RadComboBoxItem In cbox.Items
            Dim Width As Integer = TextWidth(item.Text)
            If Width > MaxWidth Then
                MaxWidth = Width
            End If
        Next
  
        cbox.DropDownWidth = New Unit(MaxWidth)
    End Sub
  
  
    Protected Sub rcb_TaskRoles_DataBound(sender As Object, e As System.EventArgs) Handles rcb_TaskRoles.DataBound
  
        Dim cbox = DirectCast(sender, RadComboBox)
        Dim MaxWidth As Integer = 155
  
        For Each item As RadComboBoxItem In cbox.Items
            Dim Width As Integer = TextWidth(item.Text)
            If Width > MaxWidth Then
                MaxWidth = Width
            End If
        Next
  
        cbox.DropDownWidth = New Unit(MaxWidth)
    End Sub
  
    Public Shared Function TextWidth(TheText As [String]) As Integer
  
        Dim DrawFont As Font = Nothing
        Dim DrawGraphics As Graphics = Nothing
        Dim TextBitmap As Bitmap = Nothing
        Try
            TextBitmap = New Bitmap(1, 1)
            DrawGraphics = Graphics.FromImage(TextBitmap)
            DrawFont = New Font("Segoe UI", 12)
  
            Dim Width As Integer = CInt(DrawGraphics.MeasureString(TheText, DrawFont).Width)
  
            Return Width
        Finally
            TextBitmap.Dispose()
            DrawFont.Dispose()
            DrawGraphics.Dispose()
        End Try
  
    End Function
  
  
  
    Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
  
        If Not Page.IsPostBack Then
            rcb_Database.Visible = True
        ElseIf Page.IsPostBack Then
            rcb_Database.Visible = False
        End If
  
        If Not Page.IsPostBack Then
            rcb_Database0.Visible = False
        ElseIf Page.IsPostBack Then
            rcb_Database0.Visible = True
  
        End If
  
  
  
    End Sub
  
  
  
  
  
  
    '**********************************************************************
    'Select year and populate user data combo box
    '**********************************************************************
  
  
    Protected Sub rcb_Database_SelectedIndexChanged(o As Object, e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles rcb_Database.SelectedIndexChanged
  
        Dim DatabaseName As String = rcb_Database.SelectedValue
        Session("DBName") = DatabaseName
  
        rcb_Users.DataSource = GetUsers()
        rcb_Users.DataBind()
  
  
    End Sub
  
    Protected Sub rcb_Database0_SelectedIndexChanged(o As Object, e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles rcb_Database0.SelectedIndexChanged
  
        Dim DatabaseName As String = rcb_Database0.SelectedValue
        Session("DBName") = DatabaseName
  
        rcb_Users.DataSource = GetUsers()
        rcb_Users.DataBind()
  
        rlb_JobRole.Items.Clear()
        rlb_JobRole.DataSource = GetJobRoles()
        rlb_JobRole.DataBind()
  
        rlb_ExplicitTaskRole.DataSource = GetExplicitTaskRole()
        rlb_ExplicitTaskRole.DataBind()
  
        rcb_JobRoles.DataSource = GetJobRoleList()
        rcb_JobRoles.DataBind()
  
        rcb_TaskRoles.DataSource = GetTaskRoleList()
        rcb_TaskRoles.DataBind()
  
        rlb_UserSites.DataSource = GetUsersInSites()
        rlb_UserSites.DataBind()
  
        rlb_UserNotInSites.DataSource = GetUsersNotInSites()
        rlb_UserNotInSites.DataBind()
  
    End Sub
  
  
    Private Function GetUsers() As DataTable
  
        Dim DatabaseName As String = Session("DBName")
  
        Dim connectionString = New SqlConnection("server=DO-IT-AB\MSSQLAB;database=AeriesAdmin;UID=itc.sysadmin;PWD=m1s.@dm1n6;")
        Dim command = New SqlCommand("aa_users", connectionString)
  
        command.CommandType = CommandType.StoredProcedure
  
        command.Parameters.Add("@dbname", SqlDbType.VarChar).Value = DatabaseName + "."
  
        command.Connection.Open()
  
        Dim myDataAdapter As New SqlDataAdapter(command)
        Dim myDataSet As New DataSet
        Dim dtData As New DataTable
        myDataAdapter.Fill(myDataSet)
        Return myDataSet.Tables(0)
  
        command.Connection.Close()
  
    End Function
  
  
  
    '**********************************************************************
    'Get User's Job Roles
    '**********************************************************************
  
  
    Protected Sub rcb_Users_SelectedIndexChanged(o As Object, e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles rcb_Users.SelectedIndexChanged
  
        Dim UserName As String = rcb_Users.SelectedValue
        Session("UserInRoleName") = UserName
  
        rlb_JobRole.DataSource = GetJobRoles()
        rlb_JobRole.DataBind()
  
        rlb_ExplicitTaskRole.DataSource = GetExplicitTaskRole()
        rlb_ExplicitTaskRole.DataBind()
  
        rcb_JobRoles.DataSource = GetJobRoleList()
        rcb_JobRoles.DataBind()
  
        rcb_TaskRoles.DataSource = GetTaskRoleList()
        rcb_TaskRoles.DataBind()
  
        rlb_UserSites.DataSource = GetUsersInSites()
        rlb_UserSites.DataBind()
  
        rlb_UserNotInSites.DataSource = GetUsersNotInSites()
        rlb_UserNotInSites.DataBind()
  
    End Sub
  
  
  
    Private Function GetJobRoles() As DataTable
  
        Dim DatabaseName As String = Session("DBName")
        Dim MemberName As String = Session("UserInRoleName")
  
        Dim connectionString = New SqlConnection("server=DO-IT-AB\MSSQLAB;database=AeriesAdmin;UID=itc.sysadmin;PWD=m1s.@dm1n6;")
        Dim command = New SqlCommand("aa_user_in_job_role", connectionString)
  
        command.CommandType = CommandType.StoredProcedure
  
        command.Parameters.Add("@dbname", SqlDbType.VarChar).Value = DatabaseName + "."
        command.Parameters.Add("@rolename", SqlDbType.VarChar).Value = MemberName
  
        command.Connection.Open()
  
        Dim myDataAdapter As New SqlDataAdapter(command)
        Dim myDataSet As New DataSet
        Dim dtData As New DataTable
        myDataAdapter.Fill(myDataSet)
        Return myDataSet.Tables(0)
  
        command.Connection.Close()
  
    End Function
  
  
    '**********************************************************************
    'Get User's Task Roles
    '**********************************************************************
  
  
    Protected Sub rlb_JobRole_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles rlb_JobRole.SelectedIndexChanged
  
        Session("JobRole") = rlb_JobRole.SelectedValue
  
        rlb_TaskRole.DataSource = GetTaskRoles()
        rlb_TaskRole.DataBind()
  
    End Sub
  
  
    Private Function GetTaskRoles() As DataTable
  
        Dim DatabaseName As String = Session("DBName")
        Dim RoleName As String = Session("JobRole")
  
        Dim connectionString = New SqlConnection("server=DO-IT-AB\MSSQLAB;database=AeriesAdmin;UID=itc.sysadmin;PWD=m1s.@dm1n6;")
        Dim command = New SqlCommand("aa_user_in_task_role", connectionString)
  
        command.CommandType = CommandType.StoredProcedure
  
        command.Parameters.Add("@dbname", SqlDbType.VarChar).Value = DatabaseName + "."
        command.Parameters.Add("@rolename", SqlDbType.VarChar).Value = RoleName
  
        command.Connection.Open()
  
        Dim myDataAdapter As New SqlDataAdapter(command)
        Dim myDataSet As New DataSet
        Dim dtData As New DataTable
        myDataAdapter.Fill(myDataSet)
        Return myDataSet.Tables(0)
  
        command.Connection.Close()
  
    End Function
  
  
    '**********************************************************************
    'Get Explicit Task Roles
    '**********************************************************************
  
  
    Private Function GetExplicitTaskRole() As DataTable
  
        Dim DatabaseName As String = Session("DBName")
        Dim MemberName As String = Session("UserInRoleName")
  
        Dim connectionString = New SqlConnection("server=DO-IT-AB\MSSQLAB;database=AeriesAdmin;UID=itc.sysadmin;PWD=m1s.@dm1n6;")
        Dim command = New SqlCommand("aa_user_in_explicit_task_role", connectionString)
  
        command.CommandType = CommandType.StoredProcedure
  
        command.Parameters.Add("@dbname", SqlDbType.VarChar).Value = DatabaseName + "."
        command.Parameters.Add("@rolename", SqlDbType.VarChar).Value = MemberName
  
        command.Connection.Open()
  
        Dim myDataAdapter As New SqlDataAdapter(command)
        Dim myDataSet As New DataSet
        Dim dtData As New DataTable
        myDataAdapter.Fill(myDataSet)
        Return myDataSet.Tables(0)
  
        command.Connection.Close()
  
    End Function
  
  
    '**********************************************************************
    'Populate lists
    '**********************************************************************
  
  
    Private Function GetJobRoleList() As DataTable
  
        Dim DatabaseName As String = Session("DBName")
  
        Dim connectionString = New SqlConnection("server=DO-IT-AB\MSSQLAB;database=AeriesAdmin;UID=itc.sysadmin;PWD=m1s.@dm1n6;")
        Dim command = New SqlCommand("aa_roles_jobs", connectionString)
  
        command.CommandType = CommandType.StoredProcedure
  
        command.Parameters.Add("@dbname", SqlDbType.VarChar).Value = DatabaseName + "."
  
        command.Connection.Open()
  
        Dim myDataAdapter As New SqlDataAdapter(command)
        Dim myDataSet As New DataSet
        Dim dtData As New DataTable
        myDataAdapter.Fill(myDataSet)
        Return myDataSet.Tables(0)
  
        command.Connection.Close()
  
    End Function
  
  
    Private Function GetTaskRoleList() As DataTable
  
        Dim DatabaseName As String = Session("DBName")
  
        Dim connectionString = New SqlConnection("server=DO-IT-AB\MSSQLAB;database=AeriesAdmin;UID=itc.sysadmin;PWD=m1s.@dm1n6;")
        Dim command = New SqlCommand("aa_roles_tasks", connectionString)
  
        command.CommandType = CommandType.StoredProcedure
  
        command.Parameters.Add("@dbname", SqlDbType.VarChar).Value = DatabaseName + "."
  
        command.Connection.Open()
  
        Dim myDataAdapter As New SqlDataAdapter(command)
        Dim myDataSet As New DataSet
        Dim dtData As New DataTable
        myDataAdapter.Fill(myDataSet)
        Return myDataSet.Tables(0)
  
        command.Connection.Close()
  
    End Function
  
  
    Private Function GetUsersInSites() As DataTable
  
        Dim DatabaseName As String = Session("DBName")
        Dim MemberName As String = Session("UserInRoleName")
  
        Dim connectionString = New SqlConnection("server=DO-IT-AB\MSSQLAB;database=AeriesAdmin;UID=itc.sysadmin;PWD=m1s.@dm1n6;")
        Dim command = New SqlCommand("aa_users_in_sites", connectionString)
  
        command.CommandType = CommandType.StoredProcedure
  
        command.Parameters.Add("@dbname", SqlDbType.VarChar).Value = DatabaseName
        command.Parameters.Add("@UserName", SqlDbType.VarChar).Value = MemberName
  
        command.Connection.Open()
  
        Dim myDataAdapter As New SqlDataAdapter(command)
        Dim myDataSet As New DataSet
        Dim dtData As New DataTable
        myDataAdapter.Fill(myDataSet)
        Return myDataSet.Tables(0)
  
        command.Connection.Close()
  
    End Function
  
  
    Private Function GetUsersNotInSites() As DataTable
  
        Dim DatabaseName As String = Session("DBName")
        Dim MemberName As String = Session("UserInRoleName")
  
        Dim connectionString = New SqlConnection("server=DO-IT-AB\MSSQLAB;database=AeriesAdmin;UID=itc.sysadmin;PWD=m1s.@dm1n6;")
        Dim command = New SqlCommand("aa_users_not_in_sites", connectionString)
  
        command.CommandType = CommandType.StoredProcedure
  
        command.Parameters.Add("@dbname", SqlDbType.VarChar).Value = DatabaseName
        command.Parameters.Add("@UserName", SqlDbType.VarChar).Value = MemberName
  
        command.Connection.Open()
  
        Dim myDataAdapter As New SqlDataAdapter(command)
        Dim myDataSet As New DataSet
        Dim dtData As New DataTable
        myDataAdapter.Fill(myDataSet)
        Return myDataSet.Tables(0)
  
        command.Connection.Close()
  
    End Function
  
    '**********************************************************************
    'Button click events
    '**********************************************************************
  
  
    Protected Sub btn_DeleteJobRole_Click(sender As Object, e As System.EventArgs) Handles btn_DeleteJobRole.Click
  
        For Each item As RadListBoxItem In rlb_JobRole.SelectedItems
            Session("DropJobRole") = item.Value.ToString()
        Next
  
        Dim DatabaseName As String = Session("DBName")
        Dim MemberName As String = Session("UserInRoleName")
  
        Dim connectionString = New SqlConnection("server=DO-IT-AB\MSSQLAB;database=AeriesAdmin;UID=itc.sysadmin;PWD=m1s.@dm1n6;")
        Dim command = New SqlCommand("aa_user_job_role_drop", connectionString)
  
        command.CommandType = CommandType.StoredProcedure
  
        command.Parameters.Add("@dbname", SqlDbType.VarChar).Value = DatabaseName + "."
        command.Parameters.Add("@membername", SqlDbType.VarChar).Value = MemberName
        command.Parameters.Add("@rolename", SqlDbType.VarChar).Value = Session("DropJobRole")
  
        command.Connection.Open()
        command.ExecuteScalar()
        command.Connection.Close()
  
        rlb_JobRole.DataSource = GetJobRoles()
        rlb_JobRole.DataBind()
  
    End Sub
  
  
  
    Protected Sub btn_AddJobRole_Click(sender As Object, e As System.EventArgs) Handles btn_AddJobRole.Click
  
        Dim UserName As String = Session("UserInRoleName")
        Dim JobRole As String = rcb_JobRoles.SelectedValue
        Dim DatabaseName As String = Session("DBName")
  
        Dim connectionString = New SqlConnection("server=DO-IT-AB\MSSQLAB;database=AeriesAdmin;UID=itc.sysadmin;PWD=m1s.@dm1n6;")
        Dim command = New SqlCommand("aa_user_job_role_add", connectionString)
  
        command.CommandType = CommandType.StoredProcedure
  
        command.Parameters.Add("@rolename", SqlDbType.VarChar).Value = JobRole
        command.Parameters.Add("@membername", SqlDbType.VarChar).Value = UserName
        command.Parameters.Add("@dbname", SqlDbType.VarChar).Value = DatabaseName + "."
  
        command.Connection.Open()
        command.ExecuteScalar()
        command.Connection.Close()
  
        rlb_JobRole.DataSource = GetJobRoles()
        rlb_JobRole.DataBind()
  
    End Sub
  
  
  
    Protected Sub btn_DeleteTaskRole_Click(sender As Object, e As System.EventArgs) Handles btn_DeleteTaskRole.Click
  
        For Each item As RadListBoxItem In rlb_ExplicitTaskRole.SelectedItems
            Session("DropJobRole") = item.Value.ToString()
        Next
  
        Dim DatabaseName As String = Session("DBName")
        Dim MemberName As String = Session("UserInRoleName")
  
        Dim connectionString = New SqlConnection("server=DO-IT-AB\MSSQLAB;database=AeriesAdmin;UID=itc.sysadmin;PWD=m1s.@dm1n6;")
        Dim command = New SqlCommand("aa_user_job_role_drop", connectionString)
  
        command.CommandType = CommandType.StoredProcedure
  
        command.Parameters.Add("@dbname", SqlDbType.VarChar).Value = DatabaseName + "."
        command.Parameters.Add("@membername", SqlDbType.VarChar).Value = MemberName
        command.Parameters.Add("@rolename", SqlDbType.VarChar).Value = Session("DropJobRole")
  
        command.Connection.Open()
        command.ExecuteScalar()
        command.Connection.Close()
  
        rlb_ExplicitTaskRole.DataSource = GetExplicitTaskRole()
        rlb_ExplicitTaskRole.DataBind()
  
    End Sub
  
  
    Protected Sub btn_AddTaskRole_Click(sender As Object, e As System.EventArgs) Handles btn_AddTaskRole.Click
  
        Dim UserName As String = Session("UserInRoleName")
        Dim JobRole As String = rcb_TaskRoles.SelectedValue
        Dim DatabaseName As String = Session("DBName")
  
        Dim connectionString = New SqlConnection("server=DO-IT-AB\MSSQLAB;database=AeriesAdmin;UID=itc.sysadmin;PWD=m1s.@dm1n6;")
        Dim command = New SqlCommand("aa_user_job_role_add", connectionString)
  
        command.CommandType = CommandType.StoredProcedure
  
        command.Parameters.Add("@rolename", SqlDbType.VarChar).Value = JobRole
        command.Parameters.Add("@membername", SqlDbType.VarChar).Value = UserName
        command.Parameters.Add("@dbname", SqlDbType.VarChar).Value = DatabaseName + "."
  
        command.Connection.Open()
        command.ExecuteScalar()
        command.Connection.Close()
  
        rlb_ExplicitTaskRole.DataSource = GetExplicitTaskRole()
        rlb_ExplicitTaskRole.DataBind()
  
    End Sub
  
  
    Protected Sub rgd_UserNotes_ItemDataBound1(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles rgd_UserNotes.ItemDataBound
  
        If TypeOf e.Item Is GridEditFormInsertItem AndAlso e.Item.OwnerTableView.IsItemInserted Then
  
            Dim insertItem As GridEditFormInsertItem = DirectCast(e.Item, GridEditFormInsertItem)
            Dim UserName As TextBox = DirectCast(e.Item.FindControl("tbx_UserName"), TextBox)
            UserName.Text = Session("UserInRoleName")
  
        End If
  
    End Sub
  
     
    Protected Sub RadAjaxManager1_AjaxRequest1(sender As Object, e As Telerik.Web.UI.AjaxRequestEventArgs) Handles RadAjaxManager1.AjaxRequest
  
        RemoveUserFromSite()
  
    End Sub
  
  
    Private Sub RemoveUserFromSite()
  
        Dim DatabaseName As String = Session("DBName")
        Dim UserName As String = Session("UserInRoleName")
        Dim IDSite As String = "4"
  
        Dim connectionString = New SqlConnection("server=DO-IT-AB\MSSQLAB;database=AeriesAdmin;UID=itc.sysadmin;PWD=m1s.@dm1n6;")
        Dim command = New SqlCommand("aa_users_in_sites_add", connectionString)
  
        command.CommandType = CommandType.StoredProcedure
  
        command.Parameters.Add("@dbname", SqlDbType.VarChar).Value = DatabaseName
        command.Parameters.Add("@UserName", SqlDbType.VarChar).Value = UserName
        command.Parameters.Add("@IDSite", SqlDbType.VarChar).Value = IDSite
  
        command.Connection.Open()
        command.ExecuteScalar()
        command.Connection.Close()
  
        rlb_UserNotInSites.Items.Clear()
  
    End Sub
  
  
End Class


Daniel Aquere
Top achievements
Rank 2
 answered on 29 May 2011
16 answers
499 views
Is there a way to transfer items in the code behind. Specifically on a button click. I'm loading a panel with a button click and I have two list boxes. One is loaded with the item via linq. The second listbox has items that were previously selected and is loaded from a database table via linq in the code behind. This seems straight forward, but I can't seem to find an example. Using Add and Remove isn't working. I get an error on the remove, "Index was out of range. Must be non-negative and less than the size of the collection."

Major Beneftis:<br />
<telerik:RadListBox runat="server" ID="majorBenefitRadListSource" Height="150px" Width="400px"
    DataSourceID="LinqDataMajorBenefit" DataValueField="majorBenefitId" 
    DataTextField="majorBenefit"
    DataKeyField="majorBenefitId"
    AllowTransfer="true" TransferToID="majorBenefitRadListDestination" Sort="Ascending" 
    AllowTransferDuplicates="false" >
</telerik:RadListBox>
<telerik:RadListBox runat="server" ID="majorBenefitRadListDestination" Width="400px" Height="150px" />
Daniel Aquere
Top achievements
Rank 2
 answered on 29 May 2011
1 answer
67 views
Hi,

I went to build the Source for the RadAjaxControls, and at first, was not able to resolve a bunch of references. I went to a previous version and found those assemblies in C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0

When I then went to build, a number of build errors occurred. 818 in all. This is one example:
Error    818    The type or namespace name 'ScriptReference' could not be found (are you missing a using directive or an assembly reference?)    D:\programming\Telerik Controls\Telerik Controls\AJAX\2011_519\RadControlsAjaxSource\Telerik.Web.UI\Grid\RadGrid.cs    3195    67    Telerik.Web.UI
 
Can anyone help me to resolve this. I think this is more about my environment, than a problem with the Telerik project. Earlier in the day I was not able to build the quick starts in the 2010 WCSF. I have no clue what is going on.

Cheers
David
Top achievements
Rank 1
 answered on 29 May 2011
1 answer
120 views
In the RadCalendar when you hover over the weekday name or the week number the row or column is highlighted as shown in the attached screen shot.

Can someone please tell me how to disable this?

Thanks.
Marin
Telerik team
 answered on 28 May 2011
1 answer
51 views
Hi, I´m new asp.net developer and working with telerik controls, in my app I have 3 textboxes, the first one is for ID of customers, the second is for name and the third one is for last name. I use this textboxes to search custumers and populate them in a radGrid when a button is pressed, now the searching only works with only one textbox, I mean, if I put the ID in the Id textbox I get as reseult the customer corresponding to that ID, if I put the name it shows me all the customers that matches with the name, and is the same case for the last name, but if I put both name and last name I only get the results of the last textbox I fill, How can I make the search with both values, the name and last name?
 Here is the code that I implement when clicking the search button.
Hope you could help me.
protected void btnBuscar_Click(object sender, EventArgs e)
        {
              if (rdTxtExp.Text == "" && rdTxtApat.Text == "" && rdTxtAmat.Text == "" && rdTxtNom.Text == "")
            {
                Alerta("Captura al menos un criterio de busqueda");
            }
            else
            {
                BuscaSolicitanteGrid();
            }
  
        }
  
        private void BuscaSolicitanteGrid()
        {
  
            try
            {
  
                var bdInstContext = new BD_INSTEntities();
  
                var empleados = from emp in bdInstContext.Empleados
                                where emp.exp_emp == rdTxtExp.Value
                                select emp;
  
  
                rgSolic.DataSource = empleados;
                rgSolic.Rebind();
  
                if (rdTxtNom.Text != "")
                {
                    var bdInstContextNom = new BD_INSTEntities();
  
                    var empleadoNom = bdInstContextNom.Empleados.Where("it.nombre_emp = '" + rdTxtNom.Text + "'");
  
  
                    //var empleadoNom = from emp in bdInstContextNom.Empleados
                    //                where emp.nombre_emp == rdTxtNom.Text
                    //                select emp;
  
                    rgSolic.DataSource = empleadoNom;
                    rgSolic.Rebind();
  
                }
  
                if (rdTxtApat.Text != "")
                {
                    var bdInstContextApat = new BD_INSTEntities();
  
  
  
  
                    var empleadoApat = from emp in bdInstContextApat.Empleados
                                       where emp.paterno_emp == rdTxtApat.Text
                                       select emp;
  
                    rgSolic.DataSource = empleadoApat;
                    rgSolic.Rebind();
  
                }
  
  
                if (rdTxtAmat.Text != "")
                {
                    var bdInstContextAmat = new BD_INSTEntities();
  
  
  
                    var empleadosAmat = from emp in bdInstContextAmat.Empleados
                                        where emp.materno_emp == rdTxtAmat.Text
                                        select emp;
  
                    rgSolic.DataSource = empleadosAmat;
                    rgSolic.Rebind();
  
                  }
  
            }
 
Genti
Telerik team
 answered on 28 May 2011
3 answers
109 views

This post replaces an earlier one with the same title

I am developing (Visual Studio 2010) a web application aimed at browsers with SVG capability, including Internet Explorer 9. I am using Telerik's ASP.NET Ajax (version Q2 2010) and loading the jQuery V1.4.2 javascript library into the page via the RadScriptManager.

<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    <Scripts>
        <%--Needed for JavaScript IntelliSense in VS2010--%>
        <%--For VS2008 replace RadScriptManager with ScriptManager--%>
        <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>

I would also like to use a jQuery plug-in to implement the SVG stuff see http://keith-wood.name/svg.html. This is an excellent plug-in but it has a small problem with IE9 (see the 'SVG DOM' tab in the previous link ) which requires some limited modifications to the jQuery core script.The mods are clearly indicated in the document (click on the 'show mods' button).

Since the jQuery script is contained in a compressed format in the Telerik assembly, I cannot get at it to incorporate the required changes.

It would help me (and many other developers too) if Telerik could make the required modifications to the jQuery code and make it available as a download from the Software Library.

This would enable me to replace

<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />

with

<asp:ScriptReference Path="~/Scripts/Telerik/jquery-svg.js" />


Many thanks

Len Jones

Leonard Jones
Top achievements
Rank 1
 answered on 28 May 2011
3 answers
76 views
There is a memory leak when you have a RadGrid that uses client-side binding via setting the OnCommand client event along with a column that has HeaderStyle-Width equal to a percentage value. Explorer cpu usage was static at 13%, and memory was slowly growing. The issue was not reproducible in Chrome.

<telerik:RadGrid ID="rgvStatus" runat="server" GridLines="None" Skin="Outlook" ShowFooter="True" EnableViewState="false">
  <MasterTableView AutoGenerateColumns="False">
     <Columns>
       <telerik:GridBoundColumn HeaderText="Name" DataType="System.String" DataField="Name"
           UniqueName="Name" HeaderStyle-Width="40%" />
       <telerik:GridBoundColumn HeaderText="Task" DataType="System.String" DataField="Task"
           UniqueName="Task" HeaderStyle-Width="40%" />
       <telerik:GridDateTimeColumn HeaderText="Time Started" DataType="System.DateTime"
           DataFormatString="{0:t}" DataField="TimeStarted" UniqueName="TimeStarted" />
    </Columns>
  </MasterTableView>
  
  <ClientSettings>
    <Scrolling AllowScroll="true" UseStaticHeaders="true" ScrollHeight="250px" />
     <ClientEvents OnCommand="pageLoad" />
  </ClientSettings>
  
  <FilterMenu EnableImageSprites="False"></FilterMenu>
                      
  <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
  </HeaderContextMenu>
</telerik:RadGrid>

The OnCommand function does not have to do anything, it leaks regardless. I was able to work around the issue by using a pixel value for the column widths.


Nick
Pavlina
Telerik team
 answered on 28 May 2011
1 answer
50 views
Hello,

I'm trying to create a demo to convince my company to purchase the Telerik AJAX library.  One of our key requreiemtns is column freezing.  However, I notice what seems to be a pretty bad bug in this (it reproduces on the demo site http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/frozencolumns/defaultcs.aspx).

Open the demo and scroll horizontally all the way to the right.  Now grab the lower right resize handle of your browser and resize it a little.  The horizontal scrollbar disappears!  You can no longer get to the columns that are out of view.  This happens in both IE 9 and chrome!

Please help!
Pavlina
Telerik team
 answered on 28 May 2011
7 answers
100 views
Hi,

i am trying RadGrid on SP2010.
I added the Webpart to a page and it looks good.
Accessing the page with a standard user he gets Access denied?!
After removing the part he couls use the page again.
I would like to have at less rights as possible in that area for the users. Which permissions are required to access the radgrid.

P.S. is able to access the list displayed in the grid and also to view, add and edit items over there.

Best regards

Christof
Sebastian
Telerik team
 answered on 28 May 2011
7 answers
142 views
Hello,

I am trying to get the column index when right clicking the radgrid to open up a context menu. target.cellindex returns as 'Undefined'.
I find that sometimes it does return the right index and at other times its undefined. 
Upon further debugging I noticed that when the index returns as undefined, the 'cellIndex' variable property is not found under the 'target' reference and is when it returns a number.

This is pretty urgent and I'd like to get a fix for this ASAP. 
Has this issue been fixed or is there a workaround?

Thanks!

Posted 12 minutes ago (permalink)

Upon further debugging I noticed that when the index returns as undefined, the 'cellIndex' variable property is not found under the 'target' reference and is when it returns a number.

This is pretty urgent and I'd like to get a fix for this ASAP. 

Posted 12 minutes ago (permalink)

Upon further debugging I noticed that when the index returns as undefined, the 'cellIndex' variable property is not found under the 'target' reference and is when it returns a number.

This is pretty urgent and I'd like to get a fix for this ASAP. 
Tsvetina
Telerik team
 answered on 28 May 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?