Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
276 views
Hi Guys,

I have a requirement to display the order of the appointment in MonthView based on my own defined "Category" attribute.
Take of example, Cat A will displayed first follow by Cat B.
I have tried using AppointmentComparer but it does not seem to work in MonthView.
I am using Telerik version 2011.1.315.40.
How can I achieve this?

Thanks and appreciate for the help.

Plamen
Telerik team
 answered on 16 Dec 2013
1 answer
203 views
Hi,

I'm experiencing weird problem related to Telerik uploader. In Edit mode RadAsyncUpload is not visible...I've tried many way to make it working, and i've discover strange behaviour, when i've added new uploader below grid, both are visible. But when i set visiblity to false on additional Uploader - edit mode uploader is again not visible...

<telerik:RadGrid runat="server" ID="RadGrid1"
    AutoGenerateColumns="False" ShowStatusBar="True" GridLines="Both"
    OnItemCreated="RadGrid1_ItemCreated" PageSize="100" OnInsertCommand="RadGrid1_InsertCommand"
    OnNeedDataSource="RadGrid1_NeedDataSource" OnDeleteCommand="RadGrid1_DeleteCommand"
    OnUpdateCommand="RadGrid1_UpdateCommand" OnItemCommand="RadGrid1_ItemCommand" Skin="Glow" CellSpacing="1">
 
 
 
    <MasterTableView Width="100%" CommandItemDisplay="Top" DataKeyNames="ImageID">
 
 
 
        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>
 
        <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column" Created="True"></ExpandCollapseColumn>
 
        <Columns>
 
            <telerik:GridEditCommandColumn ButtonType="LinkButton">
 
                <HeaderStyle Width="36px"></HeaderStyle>
 
            </telerik:GridEditCommandColumn>
 
            <telerik:GridTemplateColumn HeaderText="Image Name" UniqueName="ImageName" SortExpression="Name">
 
                <ItemTemplate>
 
                    <asp:Label runat="server" ID="lblName" Text='<%# Eval("ImageName") %>'></asp:Label>
 
                </ItemTemplate>
 
                <EditItemTemplate>
 
                    <telerik:RadTextBox runat="server" Width="250px" ID="txbName" Text='<%# Eval("ImageName") %>'>
                    </telerik:RadTextBox>
 
                    <asp:RequiredFieldValidator ID="Requiredfieldvalidator1" runat="server" ControlToValidate="txbName"
                        ErrorMessage="Please, enter a name!" Display="Dynamic" SetFocusOnError="true"></asp:RequiredFieldValidator>
 
                </EditItemTemplate>
 
                <HeaderStyle Width="30%"></HeaderStyle>
 
            </telerik:GridTemplateColumn>
 
            <telerik:GridTemplateColumn HeaderText="Description" UniqueName="Description" DataField="Description">
 
                <ItemTemplate>
 
                    <asp:Label ID="lblDescription" runat="server" Text='<%# TrimDescription(Eval("ImageDescription") as string) %>'></asp:Label>
 
                </ItemTemplate>
 
                <EditItemTemplate>
 
                    <telerik:RadTextBox ID="txbDescription" Width="300px" runat="server" TextMode="MultiLine"
                        Text='<%# Eval("ImageDescription") %>' Height="150px">
                    </telerik:RadTextBox>
 
                </EditItemTemplate>
 
                 
            </telerik:GridTemplateColumn>
 
            <telerik:GridTemplateColumn DataField="ImageData" HeaderText="Image file" UniqueName="Upload">
 
                <ItemTemplate>
                    <telerik:RadBinaryImage runat="server" ID="RadBinaryImage1" DataValue='<%#Eval("ImageData") %>'
                        AutoAdjustImageControlSize="false" Height="80px" Width="80px" ToolTip='<%#Eval("ImageName", "Photo of {0}") %>'
                        AlternateText='<%#Eval("ImageName", "Photo of {0}") %>'></telerik:RadBinaryImage>
                </ItemTemplate>
 
                <EditItemTemplate>                
                    <telerik:RadAsyncUpload runat="server" ID="AsyncUpload1" Visible="true" EnableFileInputSkinning="false" OnClientFileUploaded="OnClientFileUploaded" BorderColor="Blue" OnFileUploaded="AsyncUpload1_FileUploaded1"
                        AllowedFileExtensions="jpg,jpeg,png,gif" MaxFileSize="1048576" onvalidatingfile="RadAsyncUpload1_ValidatingFile" Skin="Glow">
                    </telerik:RadAsyncUpload>                   
                </EditItemTemplate>
 
            </telerik:GridTemplateColumn>
 
            <telerik:GridButtonColumn Text="Delete" CommandName="Delete" ButtonType="ImageButton">
 
               <%-- <HeaderStyle Width="36px"></HeaderStyle>--%>
 
            </telerik:GridButtonColumn>
 
        </Columns>
 
        <EditFormSettings>
 
            <EditColumn ButtonType="LinkButton">
            </EditColumn>
 
        </EditFormSettings>
 
 
    </MasterTableView>
 
 
 
</telerik:RadGrid>
<br />
  
    <telerik:RadAsyncUpload   runat="server"  BackColor="Transparent" Visible="False" ID="AsyncUpload2" 
        AllowedFileExtensions="jpg,jpeg,png,gif" >
    </telerik:RadAsyncUpload>
  
 
 </div>
Nencho
Telerik team
 answered on 16 Dec 2013
3 answers
85 views
Hi,

See attached screenshot with serious bug IE11 from Telerik website.

Marc
Ianko
Telerik team
 answered on 16 Dec 2013
3 answers
81 views
Hi,

When i drill down on a user in the orgchart, i see two icons one go to root and other go to parent, what is the difference between them and how are these populated , meaning how does orgchart now which node to go when we click on those icons.
Kate
Telerik team
 answered on 16 Dec 2013
3 answers
51 views
I have implemented a code-behind radgrid with multiple columns that utilize the Google-like filtering as in this link:
http://www.telerik.com/help/aspnet-ajax/grid-google-like-filtering.html

Everything works fine, but I have additional GridBoundColumns and GridDateTimeColumns in the grid.  I cannot seem to alter their width.  Especially the GridDateTimeColumns; they appear to be compressed together.

I have tried setting FilterControlWidth and HeaderStyle.Width.

I can adjust the width of the googe-like columns by altering the width of the ComboBox.  Any ideas?

Thanks,
Mark
Venelin
Telerik team
 answered on 16 Dec 2013
2 answers
137 views
I get the following javascript error when I try to show a RadWindow

JavaScript runtime error: Unable to get property 'parentNode' of undefined or null reference

The error is in the following code (3rd line)

},_isWindowRightToLeft:function(){var d=this._isRightToLeft;

if(d==null){var c=this.get_element();

var e=c.parentNode?c:this._getDefaultParent();

d=this._isRightToLeft=$telerik.isRightToLeft(e);

}return d;

},_createStatusbarResizer:function(c){if(this.ui){this.ui.createStatusbarResizer();

}},_createStatusbarMessageCell:function(e){var f=e.rows[0].insertCell(-1);

f.style.width="100%";


My code is similar to the code in the sample

http://demos.telerik.com/aspnet-ajax/grid/examples/overview/defaultcs.aspx#qsf-demo-source

I have a nestedviewtemplate in a radgird that then has a radgrid in the nestedveiwtemplate.  This inner radgrid has a linkbutton in one of the columns that calls a javascript that does a MyRadWindow.show(); 

The  MyRadWindow is positioned in the aspx code just after the main radgrid.

I cannot seem to find any info about similar issues.  Any suggestions to finding the cause of this issue?

Thanks

Shinu
Top achievements
Rank 2
 answered on 16 Dec 2013
1 answer
171 views
Hi,
is there a way to filter System.Guid with CurrentFilterFunction = "Contains"
no way to get it to work in RadGrid.

Thanks
Viktor Tachev
Telerik team
 answered on 16 Dec 2013
6 answers
655 views
Hi,
I've a RadGrid with an ExcelExportButton (CommandItemSettings ShowExportToExcelButton) in a RadAjaxPanel and a RadAjaxLoadingPanel. Everything works fine until I press the Export to Excel button, then the Excel appears, but RadAjaxLoadingPanel still "thinking" and never dissapear (do postbak).

Javascript to show Excel without ajax and trying to hide the RadAjaxLoadingPanel:
<script type="text/javascript">
function removePanel() {
    $telerik.findControl(document, "RadAjaxLoadingPanel1").hide();
}
 
function onRequestStart(sender, args) {
    if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0 ||
            args.get_eventTarget().indexOf("ExportToWordButton") >= 0 ||
            args.get_eventTarget().indexOf("ExportToPdfButton") >= 0 ||
            args.get_eventTarget().indexOf("ExportToCsvButton") >= 0) {
                setTimeout(removePanel, 10);
                args.set_enableAjax(false);
            }
        }
</script>

RadAjaxManager:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <ClientEvents OnRequestStart="onRequestStart"></ClientEvents>
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="gdvBuscarACPs">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="gdvBuscarACPs"></telerik:AjaxUpdatedControl>
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>


RadGrid with Expot to Excel button in CommandItemSetting:
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Office2010Silver"></telerik:RadAjaxLoadingPanel>
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
.........
<telerik:RadGrid ID="gdvBuscarACPs" runat="server"
AllowSorting="true"
Width="1125px"
Height="400px"
Skin="Sunset"
OnNeedDataSource="gdvBuscarACPs_NeedDataSource"
OnItemDataBound="gdvBuscarACPs_ItemDataBound"
OnItemCommand="gdvBuscarACPs_ItemCommand"
OnExcelExportCellFormatting="gdvBuscarACPs_ExcelExportCellFormatting">
<ExportSettings HideStructureColumns="true" OpenInNewWindow="true"></ExportSettings>
<MasterTableView TableLayout="Fixed"
AutoGenerateColumns="false"
DataKeyNames="ID"
NoDetailRecordsText="No hay resultados"
NoMasterRecordsText="No hay resultados."
ShowFooter="true"
CommandItemDisplay="Top">
<CommandItemSettings ShowAddNewRecordButton="false" ShowExportToPdfButton="false" ShowExportToWordButton="false"
ShowExportToExcelButton="true" ShowExportToCsvButton="false" ShowRefreshButton="false" ></CommandItemSettings>
<Columns>
.............
</Columns>
</MasterTableView>
<ClientSettings EnableRowHoverStyle="true">
<Selecting AllowRowSelect="true" EnableDragToSelectRows="false" />
<Scrolling AllowScroll="true" UseStaticHeaders="true" />
</ClientSettings>
</telerik:RadGrid>
</telerik:RadAjaxPanel>

Everything works fine (export to Excel included) but when I press the Export button the RadAjaxPanel continues like the file attached.

Can you help me to hide the radajaxloadingpanel after press the export button?

Thank you!


Eyup
Telerik team
 answered on 16 Dec 2013
1 answer
74 views

Hi there,

I am attempting to populate a combo box within a panel when the RadScheduler form Creating method is called.

if i walk through the code i can see the process hitting the breakpoint however when the combo box is displayed it is blank.


    Protected Sub RadScheduler1_FormCreating(ByVal sender As Object, ByVal e As SchedulerFormCreatingEventArgs)

        If e.Mode = SchedulerFormMode.Insert Then

            e.Cancel = True

        ElseIf e.Mode = SchedulerFormMode.Edit Then

            e.Cancel = True

            ScriptManager.RegisterStartupScript(Page, [GetType](), "formScript", "Sys.Application.add_load(openForm);", True)

            PopulateEditForm()

            formRSUpdate_tbMessage.Text = "This doesnt get set either!"

        End If

    End Sub


    Private Sub PopulateEditForm()

        ComboUtils.FillComboBox1(formRSUpdate_ComboBox1)

    End Sub


Within my aspx i have the following...

<telerik:RadDock runat="server" ID="RadDock1" Width="350px" Height="220px" Closed="true" Style="z-index: 2000;" Title="Edit Appointment">

<Commands>

<telerik:DockCloseCommand></telerik:DockCloseCommand>

</Commands>

<ContentTemplate>

<asp:Panel ID="PanelDock" runat="server">

...

...

<td style="text-align: left">

    <telerik:RadComboBox ID="formRSUpdate_ComboBox1" runat="server" AutoPostBack="True" Width="220px" />

</td>


The auto postback is set to true because this is the first of two cascading combo boxes.

The selection within this combo box drives the population of the second.

If i use a sqldatasource, I can populate Combox1, and combox2 successfully populates.

However since i need to drive both on the specific appointment i would like to keep

everything within the code behind.

This also does not get set.

formRSUpdate_tbMessage.Text = "This doesn't get set either!"







Can you please help?  I am trying to populate a bunch of controls within the form from the appointment.

Nencho
Telerik team
 answered on 16 Dec 2013
1 answer
117 views
Hi

I have a simple grid with popup Edit page. I have Submit Button, when I try to submit it is not working. Not able to Debug and getting following error.

  Internet Explorer cannot display the webpage
   
   What you can try:
    Diagnose Connection Problems  
 
     More information

This problem can be caused by a variety of issues, including:

•Internet connectivity has been lost.
•The website is temporarily unavailable.
•The Domain Name Server (DNS) is not reachable.
•The Domain Name Server (DNS) does not have a listing for the website's domain.
•There might be a typing error in the address.
•If this is an HTTPS (secure) address, click Tools, click Internet Options, click Advanced, and check to be sure the SSL and TLS protocols are enabled under the security section.

For offline users

You can still view subscribed feeds and some recently viewed webpages.
To view subscribed feeds

1.Click the Favorites Center button , click Feeds, and then click the feed you want to view.

To view recently visited webpages (might not work on all pages)

1.Click Tools , and then click Work Offline.
2.Click the Favorites Center button , click History, and then click the page you want to view.




Code Sample: Grid page  ASPX File

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm4.aspx.vb" Inherits="ConEdison.AAA.WebForm4" %>
<%@ 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">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server"><title></title></head>
<body>
<form id="Form1" method="post" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
     <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
      <script src="Includes/audit.js" type="text/javascript"></script>
   </telerik:RadCodeBlock>
     <telerik:RadAjaxManager ID="TypeAjaxManager" runat="server" OnAjaxRequest="TypeAjaxManager_AjaxRequest">
      <ClientEvents OnRequestStart="TypeRequestStart" />
      <AjaxSettings>
         <telerik:AjaxSetting AjaxControlID="TypeAjaxManager">
            <UpdatedControls>
               <telerik:AjaxUpdatedControl ControlID="RadGrid3" />
            </UpdatedControls>
         </telerik:AjaxSetting>
         <telerik:AjaxSetting AjaxControlID="RadGrid3">
            <UpdatedControls>
               <telerik:AjaxUpdatedControl ControlID="RadGrid3" />
            </UpdatedControls>
         </telerik:AjaxSetting>
      </AjaxSettings>
   </telerik:RadAjaxManager>
    <telerik:RadGrid runat="server" ID="RadGrid3" Font-Names="Verdana"
        Font-Size="XX-Small" Skin="Telerik">
<PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>

    <ClientSettings AllowColumnsReorder="False" AllowDragToGroup="False" ReorderColumnsOnClient="False">
         <Selecting AllowRowSelect="False" />
         <Scrolling AllowScroll="False" UseStaticHeaders="True" />
      </ClientSettings>
    <MasterTableView AutoGenerateColumns="False" DataKeyNames="ID" ClientDataKeyNames="ID" Width="100%" CommandItemDisplay="Top">
         <CommandItemSettings ShowRefreshButton="False"/>
          <RowIndicatorColumn SortedBackColor="lightblue">
         </RowIndicatorColumn>
         <ExpandCollapseColumn Visible="True" created="True">
         </ExpandCollapseColumn>
         <Columns>
            <telerik:GridTemplateColumn HeaderText="Edit" UniqueName="TemplateEditColumn" >
               <ItemTemplate>
                  <asp:HyperLink ID="EditLink" runat="server" Text="Edit"></asp:HyperLink>
               </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn DataField="ID" HeaderText="ID" UniqueName="ID" visible="False">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="ManagerName" HeaderText="ManagerName" UniqueName="ManagerName">
             </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="EmpName" HeaderText="EmpName" UniqueName="EmpName">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Deligate_Emp_Id" HeaderText="Deligate_Emp_Id" UniqueName="Deligate_Emp_Id">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Deligate_From_Date"  HeaderText="Deligate_From_Date" UniqueName="Deligate_From_Date">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Deligate_To_Date" HeaderText="TDeligate_To_Date" UniqueName="Deligate_To_Date">
            </telerik:GridBoundColumn>
            </Columns>

<EditFormSettings PopUpSettings-Modal="true">
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>

<PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
      </MasterTableView>

<FilterMenu EnableImageSprites="False"></FilterMenu>
    </telerik:RadGrid>
    
    
       <telerik:RadWindowManager ID="TypeWindowManager" runat="server">
            <Windows>
                <telerik:RadWindow ID="UserListDialog" runat="server" Title="Editing record"
                    ReloadOnShow="true" ShowContentDuringLoad="false"
                      Behaviors="Close" Modal="true" Width="440" Height="480" />
            </Windows>
     </telerik:RadWindowManager>
    
    
   
 
      </form>
    </body>
</html>

Vb file



Imports System.Data
Imports System.Data.SqlClient
Imports System.Configuration
Imports Telerik.Web.UI
Imports System.Collections.Generic
Imports System.Globalization
Partial Public Class WebForm4
    Inherits System.Web.UI.Page
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    End Sub
    Private Sub RadGrid3_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid3.ItemCreated
        If TypeOf e.Item Is GridDataItem Then
            Dim InvC As CultureInfo = CultureInfo.InvariantCulture
            Dim editLink As HyperLink = DirectCast(e.Item.FindControl("EditLink"), HyperLink)
            editLink.Attributes("href") = "#"
            editLink.Attributes("onclick") = [String].Format(InvC, "return ShowEditForm('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("ID"), "DDetails")
        End If
    End Sub
    Private Sub RadGrid3_NeedDataSource(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid3.NeedDataSource
        Dim UserDataTable As New DataTable("DelegateDetails")
        UserDataTable = CType(Cache.Get("DelegateDetails"), DataTable)
        If UserDataTable Is Nothing Then
            UserDataTable = LoadDelegateDetails("DelegateDetails")
            Cache.Insert("DelegateDetails", UserDataTable, Nothing, DateTime.Now.AddMinutes(10), TimeSpan.Zero)
        Else
            UserDataTable = LoadDelegateDetails("DelegateDetails")
            Cache.Insert("DelegateDetails", UserDataTable, Nothing, DateTime.Now.AddMinutes(10), TimeSpan.Zero)
        End If
        RadGrid3.DataSource = UserDataTable
    End Sub
    Private Function LoadDelegateDetails(ByVal tblname As String) As DataTable
        Dim SQLCall As New AAA_DB_Calls
        Dim getNames As New DataTable
        Session("Companycd") = 1
        Try
            getNames = SQLCall.Get_DeligateInfo(CInt(Session("Companycd")))
            If getNames Is Nothing Then
                Exit Function
            ElseIf getNames.Rows.Count > 0 Then
                LoadDelegateDetails = getNames
                LoadDelegateDetails.TableName = tblname.ToString
            End If
        Catch ex As Exception
        Finally
            getNames = Nothing
            SQLCall = Nothing
        End Try
    End Function
    Protected Sub TypeAjaxManager_AjaxRequest(ByVal sender As Object, ByVal e As AjaxRequestEventArgs) Handles TypeAjaxManager.AjaxRequest
        Try
            If e.Argument = "Rebind" Then
                RadGrid3.MasterTableView.SortExpressions.Clear()
                RadGrid3.MasterTableView.GroupByExpressions.Clear()
                RadGrid3.Rebind()
            ElseIf e.Argument = "RebindAndNavigate" Then
                RadGrid3.MasterTableView.SortExpressions.Clear()
                RadGrid3.MasterTableView.GroupByExpressions.Clear()
                RadGrid3.MasterTableView.CurrentPageIndex = RadGrid3.MasterTableView.PageCount - 1
                RadGrid3.Rebind()
            End If
        Catch ex As KeyNotFoundException
        Catch ex As Exception
            Throw
        End Try
    End Sub
End Class

Details ASPX Page

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="DDetails.aspx.vb" Inherits="ConEdison.AAA.DDetails" %>

<%@ 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">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Deligate</title>
    <style type="text/css">
        .style1
        {
            font-family: Verdana;
            font-size: xx-small;
        }
        .style2
        {
            font-family: Verdana;
            font-size: xx-small;
            height: 7px;
        }
        .style3
        {
            height: 7px;
        }
    </style>

    <script type="text/javascript">
        function Clicking(sender, args) {
            args.set_cancel(!window.confirm("Are you sure you want to submit the page?"));
            
        }
</script>
     
     


</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
     
 
        <br />
        <table>
            <tr>
                <td class="style1">
                    &nbsp;</td>
                <td>
                   
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style1">
                    &nbsp;</td>
                <td>
                   
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style1">
                    Company:
                </td>
                <td>
                   
                    <telerik:RadComboBox ID="ddlCompany" Runat="server" Skin="Telerik">
                        <Items>
                            <telerik:RadComboBoxItem runat="server" Selected="True" Text="Select....."
                                Value="0" />
                            <telerik:RadComboBoxItem runat="server" Text="ConEd" Value="1" />
                            <telerik:RadComboBoxItem runat="server" Text="O&amp;R" Value="2" />
                            <telerik:RadComboBoxItem runat="server" Text="Both" Value="3" />
                        </Items>
                    </telerik:RadComboBox>
                   
                </td>
            </tr>
            <tr>
                <td class="style1">
                    Schedule Name:
                </td>
                <td>
                      <telerik:RadComboBox ID="ddlSchedule" Runat="server" Skin="Telerik">
                       </telerik:RadComboBox>
                    
                  
                </td>
            </tr>
            <tr>
                <td class="style1">
                    Manager Name:
                </td>
                <td>
                    <telerik:RadComboBox ID="ddlManager" Runat="server" Skin="Telerik" >
                       </telerik:RadComboBox>
                </td>
            </tr>
            <tr>
                <td class="style1">
                    Delegate Employee:
                </td>
                <td>
                 
                    <telerik:RadComboBox ID="ddlEmployee" Runat="server" Skin="Telerik">
                       </telerik:RadComboBox>
                </td>
            </tr>
            <tr>
                <td class="style1">
                    Delegate Start Date:
                </td>
                <td>
                    <telerik:RadDatePicker ID="dteStartDate" runat="server" CssClass="style1" Skin="Telerik">
                        <calendar userowheadersasselectors="False" usecolumnheadersasselectors="False" skin="Telerik"></calendar>
                        <datepopupbutton imageurl="" hoverimageurl=""></datepopupbutton>
                        <dateinput displaydateformat="M/d/yyyy" dateformat="M/d/yyyy" labelwidth="40%"></dateinput>
                    </telerik:RadDatePicker>
                </td>
            </tr>
            <tr>
                <td class="style1">
                    Delegate End Date:
                </td>
                <td>
                    <telerik:RadDatePicker ID="dteEndDate" runat="server" CssClass="style1" Skin="Telerik">
                        <calendar userowheadersasselectors="False" usecolumnheadersasselectors="False" skin="Telerik"></calendar>
                        <datepopupbutton imageurl="" hoverimageurl=""></datepopupbutton>
                        <dateinput displaydateformat="M/d/yyyy" dateformat="M/d/yyyy" labelwidth="40%"></dateinput>
                    </telerik:RadDatePicker>
                </td>
            </tr>
            <tr>
                <td class="style1">
                    Is Active?</td>
                <td>
                     <telerik:RadComboBox ID="ddlActive" Runat="server" Skin="Telerik"
                         AutoPostBack="True" >
                        <Items>
                            <telerik:RadComboBoxItem runat="server" Selected="True" Text="Select....."
                                Value="-1" />
                            <telerik:RadComboBoxItem runat="server" Text="Yes" Value="1" />
                            <telerik:RadComboBoxItem runat="server" Text="No" Value="0" />
                        </Items>
                    </telerik:RadComboBox>
                </td>
            </tr>
            <tr>
                <td class="style1">
                    &nbsp;
                </td>
                <td class="style1">
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td class="style1">
                    &nbsp;</td>
                <td class="style1">
                   

                   
                   
                       
                </td>
            </tr>
            <tr>
                <td class="style1">
                    &nbsp;
                </td>
                <td>
                     

                    <telerik:RadButton ID="RadButton2" runat="server" Text="RadButton" OnClientClicking="Clicking">
                    </telerik:RadButton>
                     

                </td>
            </tr>
            <tr>
                <td class="style2">
                </td>
                <td class="style3">
                    <asp:Label ID="lblMessage" runat="server" Font-Bold="True" Font-Names="Verdana"
                        Font-Size="8pt" ForeColor="Red"></asp:Label>
                   
                </td>
            </tr>
        </table>
        <br />
    </div>
 
    
 
    </form>

    
</body>
</html>


VB File

Imports System
Imports System.Data
Imports System.Configuration
Imports System.Collections
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Web.UI.HtmlControls
Imports Telerik.Web
Imports Telerik.Web.UI
Imports System.Data.SqlClient
Partial Public Class DDetails
    Inherits System.Web.UI.Page
    Public DelegateID As String
    Public Shared SelectDotDotDot As String = Replace(" Select...", " "c, Convert.ToChar(160)) 'spaces converted to non-breaking spaces
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            DelegateID = Request.QueryString("ID")
            Dim CompId As Integer
            If ddlCompany.SelectedIndex = 0 Then
                CompId = 1
            Else
                CompId = ddlSchedule.SelectedIndex
            End If
            PopulateScheduleNameList()
            PopulateEmployees(CompId)
            If CInt(DelegateID) > 0 Then
                PopulateScheduleNameList()
                PopulateEmployees(CompId)
                Populate_Form()
            End If
        End If
    End Sub
    Private Sub PopulateEmployees(ByVal CompanyId As Integer)
        Dim UserDataTable As New DataTable("Empoloyees")
        UserDataTable = CType(Cache.Get("Empoloyees"), DataTable)
        If UserDataTable Is Nothing Then
            UserDataTable = LoadEmployees("Empoloyees", CompanyId)
            Cache.Insert("Empoloyees", UserDataTable, Nothing, DateTime.Now.AddMinutes(10), TimeSpan.Zero)
        Else
            UserDataTable = LoadEmployees("Empoloyees", CompanyId)
            Cache.Insert("Empoloyees", UserDataTable, Nothing, DateTime.Now.AddMinutes(10), TimeSpan.Zero)
        End If
        ddlManager.DataSource = UserDataTable
        ddlManager.DataValueField = "StrEmpno1"
        ddlManager.DataTextField = "strNameEmpNo"
        ddlManager.DataBind()
        ddlManager.Items.Insert(0, New RadComboBoxItem("Select.....", "-1"))


        ddlEmployee.DataSource = UserDataTable
        ddlEmployee.DataValueField = "StrEmpno1"
        ddlEmployee.DataTextField = "strNameEmpNo"
        ddlEmployee.DataBind()
        ddlEmployee.Items.Insert(0, New RadComboBoxItem("Select.....", "-1"))


    End Sub

    Private Sub PopulateManagerList(ByVal CompanyId As Integer)
        Dim UserDataTable As New DataTable("ManagerDetails")
        UserDataTable = CType(Cache.Get("ManagerDetails"), DataTable)
        If UserDataTable Is Nothing Then
            UserDataTable = LoadManagerDetails("ManagerDetails", CompanyId)
            Cache.Insert("ManagerDetails", UserDataTable, Nothing, DateTime.Now.AddMinutes(10), TimeSpan.Zero)
        Else
            UserDataTable = LoadManagerDetails("ManagerDetails", CompanyId)
            Cache.Insert("ManagerDetails", UserDataTable, Nothing, DateTime.Now.AddMinutes(10), TimeSpan.Zero)
        End If
        ddlManager.DataSource = UserDataTable
        ddlManager.DataValueField = "ManagerCode"
        ddlManager.DataTextField = "ManagerName"
        ddlManager.DataBind()
        ddlManager.Items.Insert(0, New RadComboBoxItem("Select.....", "-1"))

    End Sub
    Private Sub PopulateEmployeeList(ByVal compId As Integer, ByVal MgrId As Integer)
        Dim UserDataTable As New DataTable("EmpoyeeDetails")
        UserDataTable = CType(Cache.Get("EmpoyeeDetails"), DataTable)
        If UserDataTable Is Nothing Then
            UserDataTable = LoadEmployeeDetails("EmpoyeeDetails", MgrId, compId)
            If UserDataTable Is Nothing Then
            Else
                Cache.Insert("EmpoyeeDetails", UserDataTable, Nothing, DateTime.Now.AddMinutes(10), TimeSpan.Zero)
            End If
        Else
            UserDataTable = LoadEmployeeDetails("EmpoyeeDetails", MgrId, compId)
            Cache.Insert("EmpoyeeDetails", UserDataTable, Nothing, DateTime.Now.AddMinutes(10), TimeSpan.Zero)
        End If
        ddlEmployee.DataSource = UserDataTable
        ddlEmployee.DataValueField = "Emp_No"
        ddlEmployee.DataTextField = "EmpName"
        ddlEmployee.DataBind()
        ddlEmployee.Items.Insert(0, New RadComboBoxItem("Select.....", "-1"))

    End Sub
    Private Function LoadEmployees(ByVal tblname As String, ByVal CompanyId As Integer) As DataTable
        Dim SQLCall As New AAA_DB_Calls
        Dim getNames As New DataTable
        Try
            getNames = SQLCall.Get_CONEDOREmployeeInfo(CompanyId)
            If getNames Is Nothing Then
                Exit Function
            ElseIf getNames.Rows.Count > 0 Then
                LoadEmployees = getNames
                LoadEmployees.TableName = tblname.ToString
            End If
        Catch ex As Exception
        Finally
            getNames = Nothing
            SQLCall = Nothing
        End Try
    End Function

    Private Function LoadManagerDetails(ByVal tblname As String, ByVal CompanyId As Integer) As DataTable
        Dim SQLCall As New AAA_DB_Calls
        Dim getNames As New DataTable
        Try
            getNames = SQLCall.USP_GetManagerList(CompanyId)
            If getNames Is Nothing Then
                Exit Function
            ElseIf getNames.Rows.Count > 0 Then
                LoadManagerDetails = getNames
                LoadManagerDetails.TableName = tblname.ToString
            End If
        Catch ex As Exception
        Finally
            getNames = Nothing
            SQLCall = Nothing
        End Try
    End Function
    Private Function LoadEmployeeDetails(ByVal tblname As String, ByVal MgrId As Integer, ByVal CompId As Integer) As DataTable
        Dim SQLCall As New AAA_DB_Calls
        Dim getNames As New DataTable
        Try
            getNames = SQLCall.USP_GetEmpList(MgrId, CompId)
            If getNames Is Nothing Then
                Exit Function
            ElseIf getNames.Rows.Count > 0 Then
                LoadEmployeeDetails = getNames
                LoadEmployeeDetails.TableName = tblname.ToString
            End If
        Catch ex As Exception
        Finally
            getNames = Nothing
            SQLCall = Nothing
        End Try
    End Function
    Private Sub PopulateScheduleNameList()
        Dim UserDataTable As New DataTable("ScheduleDetails")
        UserDataTable = CType(Cache.Get("ScheduleDetails"), DataTable)
        If UserDataTable Is Nothing Then
            UserDataTable = LoadScheduleDetails("ScheduleDetails")
            Cache.Insert("ScheduleDetails", UserDataTable, Nothing, DateTime.Now.AddMinutes(10), TimeSpan.Zero)
        Else
            UserDataTable = LoadScheduleDetails("ScheduleDetails")
            Cache.Insert("ScheduleDetails", UserDataTable, Nothing, DateTime.Now.AddMinutes(10), TimeSpan.Zero)
        End If
        ddlSchedule.DataSource = UserDataTable
        ddlSchedule.DataValueField = "schedule_id"
        ddlSchedule.DataTextField = "Schedule_Name"
        ddlSchedule.DataBind()

        ddlSchedule.Items.Insert(0, New RadComboBoxItem("Select.....", "-1"))
    End Sub
    Private Function LoadScheduleDetails(ByVal tblname As String) As DataTable
        Dim SQLCall As New AAA_DB_Calls
        Dim getNames As New DataTable
        Try
            getNames = SQLCall.USP_GetScheduleNameList()
            If getNames Is Nothing Then
                Exit Function
            ElseIf getNames.Rows.Count > 0 Then
                LoadScheduleDetails = getNames
                LoadScheduleDetails.TableName = tblname.ToString
            End If
        Catch ex As Exception
        Finally
            getNames = Nothing
            SQLCall = Nothing
        End Try
    End Function
    Private Sub EditAuditDeligate()
        Dim UserDataTable As New DataTable("EditDetails")
        UserDataTable = CType(Cache.Get("EditDetails"), DataTable)
        If UserDataTable Is Nothing Then
            UserDataTable = LoadEditDetails("EditDetails")
            Cache.Insert("EditDetails", UserDataTable, Nothing, DateTime.Now.AddMinutes(10), TimeSpan.Zero)
        Else
            UserDataTable = LoadEditDetails("EditDetails")
            Cache.Insert("EditDetails", UserDataTable, Nothing, DateTime.Now.AddMinutes(10), TimeSpan.Zero)
        End If
        ddlSchedule.SelectedItem.Value = UserDataTable.Columns(0).ToString()
        ddlSchedule.SelectedItem.Value = UserDataTable.Columns(1).ToString()
        ddlSchedule.SelectedItem.Value = UserDataTable.Columns(2).ToString()


    End Sub
    Private Function LoadEditDetails(ByVal tblname As String) As DataTable
        Dim SQLCall As New AAA_DB_Calls
        Dim getNames As New DataTable
        Try
            getNames = SQLCall.USP_GetAuditDeligateById(CInt(DelegateID))
            If getNames Is Nothing Then
                Exit Function
            ElseIf getNames.Rows.Count > 0 Then
                LoadEditDetails = getNames
                LoadEditDetails.TableName = tblname.ToString
            End If
        Catch ex As Exception
        Finally
            getNames = Nothing
            SQLCall = Nothing
        End Try
    End Function
    Private Sub Populate_Form()
        Dim MyDataReader As SqlDataReader
        Dim GetDataReader As New StoredProcedureClass
        Dim MySqlStr As String
        MySqlStr = "USP_GetAuditDeligateById @ID = " & DelegateID
        MyDataReader = GetDataReader.CreateSqlDataReader(MySqlStr)
        Do While MyDataReader.Read()
            ddlCompany.SelectedValue = "1"
            ddlSchedule.SelectedValue = CStr(MyDataReader("Schedule_Id"))
            ddlManager.SelectedValue = CStr(MyDataReader("Manager_Id"))
            ddlEmployee.SelectedValue = CStr(MyDataReader("Deligate_Emp_Id"))
            dteStartDate.SelectedDate = CDate(MyDataReader("Deligate_From_Date"))
            dteEndDate.SelectedDate = CDate(MyDataReader("Deligate_To_Date"))
            ddlActive.SelectedValue = CStr(MyDataReader("IsActive"))
        Loop
    End Sub

    Private Sub SaveData()
        lblMessage.Text = ""
        Dim objSPcls As New StoredProcedureClass
        Dim ExecResult As String
        Dim ScheduleId As String
        Dim ManagerId As String
        Dim DelegateEmpId As String
        Dim dFromDate As String
        Dim dToDate As String
        Dim CreateBy As String
        Dim sNTLoginName As String
        Dim SqlStr1 As String
        sNTLoginName = Right(User.Identity.Name, Len(User.Identity.Name) - 6)
        ScheduleId = ddlSchedule.SelectedValue
        ManagerId = ddlManager.SelectedValue
        DelegateEmpId = ddlEmployee.SelectedValue
        dFromDate = CStr(dteStartDate.SelectedDate)
        dToDate = CStr(dteEndDate.SelectedDate)
        CreateBy = "2768"
        SqlStr1 = ""
        SqlStr1 = SqlStr1 + " USP_UpdateAuditDeligate "
        SqlStr1 = SqlStr1 + " @DeligateId = '" + DelegateID + "',"
        SqlStr1 = SqlStr1 + " @ScheduleId = '" + ScheduleId + "',"
        SqlStr1 = SqlStr1 + " @ManagerID = '" + ManagerId + "',"
        SqlStr1 = SqlStr1 + " @DeligateEmpId = '" + DelegateEmpId + "',"
        SqlStr1 = SqlStr1 + " @DeligateFromDate = '" + dFromDate + "',"
        SqlStr1 = SqlStr1 + " @DeligateToDate = '" + dToDate + "',"
        SqlStr1 = SqlStr1 + " @CreatedById = '" + CreateBy + "'"
        ExecResult = objSPcls.ExecuteSqlQuery(SqlStr1, "@RC")
        objSPcls = Nothing
    End Sub

    Private Sub RadButton2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadButton2.Click

    End Sub
End Class





Konstantin Dikov
Telerik team
 answered on 16 Dec 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?