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

Hello,

i want exactly the same feature as shown in this demo but using code behind approach.

http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandwindow/defaultcs.aspx?product=window

i have two pages one for grid and one for editing same as in above demo, on both pages i am binding and updating the data pragmatically  from code behind. below is both pages aspx and cs code snippet by following this demo, everything is working fine except below three issues which i am not getting where i am doing wrong. please your kind support is appreciated.

1. the gridloading panel is not shown when i click on the update button. actually what i want to do, if the updation is successful i want to display the loading panel, close the edit window and update the grid. i used below code on update button click event but not working. 

2. second if the updation is not successful i want to display message in the edit window, show the loading panel and not close the window.

3. Third the skin is not working although i have skin.dll in my project.

 

Grid page .aspx

<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/TasksMaster.Master" AutoEventWireup="true" CodeBehind="ExistingEmployeesSIMInfo.aspx.cs" Inherits="AbanaPortal.SIMManagement.ExistingEmployeesSIMInfo" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">

            function ShowEditForm(id, rowIndex) {
                var grid = $find("<%= SIMInfoRadGrid.ClientID %>");

               var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();
               grid.get_masterTableView().selectItem(rowControl, true);

               window.radopen("UpdateSIMDetails.aspx?EmployeeID=" + id, "UserListDialog");
               return false;
           }
           
           function refreshGrid(arg) {
               if (!arg) {
                   $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
                    }
                    else {
                        $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindAndNavigate");
                    }
                }              

        </script>
    </telerik:RadCodeBlock>

    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="SIMInfoRadGrid" LoadingPanelID="gridLoadingPanel"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>

            <telerik:AjaxSetting AjaxControlID="SIMInfoRadGrid">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="SIMInfoRadGrid" LoadingPanelID="gridLoadingPanel"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>

        </AjaxSettings>
    </telerik:RadAjaxManager>

    <telerik:RadAjaxLoadingPanel runat="server" ID="gridLoadingPanel"></telerik:RadAjaxLoadingPanel>

     <div>        
        <asp:ImageButton ID="ExportImageButton" runat="server" ImageUrl="~/images/Excel.png" OnClick="ExportImageButton_Click" AlternateText="Xlsx" />
    </div>

    <telerik:RadGrid RenderMode="Lightweight" OnItemCreated="SIMInfoRadGrid_ItemCreated" ID="SIMInfoRadGrid" runat="server"
        AllowSorting="true" AllowFilteringByColumn="true" Width="100%" GridLines="Horizontal">
        <ItemStyle Wrap="true"></ItemStyle>
        <MasterTableView AutoGenerateColumns="False" DataKeyNames="Employee_Code" ClientDataKeyNames="Employee_Code" Width="100%" >
            <Columns>
                <telerik:GridBoundColumn DataField="Employee_Code" HeaderText="Employee ID" ReadOnly="True"
                    SortExpression="Employee_Code" UniqueName="Employee_Code">
                </telerik:GridBoundColumn>

                <telerik:GridBoundColumn DataField="Employee_Name_1_English" HeaderText="Name" SortExpression="Employee_Name_1_English"
                    UniqueName="Employee_Name_1_English">
                </telerik:GridBoundColumn>

                <telerik:GridBoundColumn DataField="Department_1_English" HeaderText="Department" SortExpression="Department_1_English"
                    UniqueName="Department_1_English">
                </telerik:GridBoundColumn>

                <telerik:GridBoundColumn DataField="Position_2_English" HeaderText="Position" SortExpression="Position_2_English"
                    UniqueName="Position_2_English">
                </telerik:GridBoundColumn>

                <telerik:GridBoundColumn DataField="Hiring_Date" HeaderText="Joining Date" DataFormatString="{0:dd-MMM-yyyy}" SortExpression="Hiring_Date"
                    UniqueName="Hiring_Date">
                </telerik:GridBoundColumn>

                <telerik:GridTemplateColumn UniqueName="TemplateEditColumn" HeaderText="SIM Issued?" FilterControlWidth="40px">
                    <ItemTemplate>
                        <asp:HyperLink ID="EditLink" ForeColor="Blue" Font-Underline="true" runat="server" Text='<%#Eval("SIMIssued") %>'></asp:HyperLink>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Center" />
                </telerik:GridTemplateColumn>

                <telerik:GridBoundColumn DataField="MobileNo" HeaderText="Mobile No" SortExpression="MobileNo"
                    UniqueName="MobileNo">
                </telerik:GridBoundColumn>

                <telerik:GridBoundColumn DataField="LimitAmount" HeaderText="Limit Amount" SortExpression="LimitAmount"
                    UniqueName="LimitAmount" FilterControlWidth="40px" ItemStyle-HorizontalAlign="Center">
                </telerik:GridBoundColumn>

                <telerik:GridBoundColumn DataField="ServiceAmount" HeaderText="Service Amount" SortExpression="ServiceAmount"
                    UniqueName="ServiceAmount" FilterControlWidth="40px" ItemStyle-HorizontalAlign="Center">
                </telerik:GridBoundColumn>

                <telerik:GridBoundColumn DataField="Remarks" HeaderText="Remarks" SortExpression="Remarks"
                    UniqueName="Remarks">
                </telerik:GridBoundColumn>

            </Columns>
        </MasterTableView>
        <ClientSettings>
            <Selecting AllowRowSelect="true"></Selecting>               
        </ClientSettings>
    </telerik:RadGrid>

    <telerik:RadWindowManager RenderMode="Lightweight" ID="RadWindowManager1" runat="server" EnableShadow="true">
        <Windows>
            <telerik:RadWindow RenderMode="Lightweight" ID="UserListDialog" runat="server" Title="Update SIM Info" Height="600px"
                Width="400px" Left="150px" ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true">
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>

</asp:Content>

Grid page .cs 

 EmployeeClass empObj = new EmployeeClass();

        protected void Page_Load(object sender, EventArgs e)
        {
            GetEmployeesSIMInfo();            
        }

        private void GetEmployeesSIMInfo()
        {
            DataTable dTable = empObj.GetEmployeesSIMInfo();
            if (dTable.Rows.Count != 0)
            {
                SIMInfoRadGrid.DataSource = dTable;
                SIMInfoRadGrid.DataBind();
            }
        }

        protected void SIMInfoRadGrid_ItemCreated(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                HyperLink editLink = (HyperLink)e.Item.FindControl("EditLink");             
                editLink.Attributes["href"] = "javascript:void(0);";
                editLink.Attributes["onclick"] = String.Format("return ShowEditForm('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["Employee_Code"], e.Item.ItemIndex);
            }
        }

        protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
        {
            if (e.Argument == "Rebind")
            {
                SIMInfoRadGrid.MasterTableView.SortExpressions.Clear();
                SIMInfoRadGrid.MasterTableView.GroupByExpressions.Clear();
                SIMInfoRadGrid.Rebind();
            }
            else if (e.Argument == "RebindAndNavigate")
            {
                SIMInfoRadGrid.MasterTableView.SortExpressions.Clear();
                SIMInfoRadGrid.MasterTableView.GroupByExpressions.Clear();
                SIMInfoRadGrid.MasterTableView.CurrentPageIndex = SIMInfoRadGrid.MasterTableView.PageCount - 1;
                SIMInfoRadGrid.Rebind();
            }
        }

        protected void ExportImageButton_Click(object sender, ImageClickEventArgs e)
        {
            string alternateText = (sender as ImageButton).AlternateText;
         
            if (alternateText == "Xlsx")
            {
                SIMInfoRadGrid.MasterTableView.GetColumn("Employee_Code").HeaderStyle.BackColor = Color.LightGray;
                SIMInfoRadGrid.MasterTableView.GetColumn("Employee_Code").ItemStyle.BackColor = Color.LightGray;
            }
                 
            SIMInfoRadGrid.ExportSettings.ExportOnlyData = true;
            SIMInfoRadGrid.ExportSettings.OpenInNewWindow = true;
            SIMInfoRadGrid.MasterTableView.ExportToExcel();
        }

edit page .aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UpdateSIMDetails.aspx.cs" Inherits="AbanaPortal.SIMManagement.UpdateSIMDetails" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Update SIM Info</title>
   <link href="../Styles/bootstrap.css" rel="stylesheet" />
    <link href="../Styles/bootstrap-theme.css" rel="stylesheet" />
    <link href="../Styles/Site.css" rel="stylesheet" />
    <link href="../font-awesome/css/font-awesome.css" rel="stylesheet" />

    <script src="../Scripts/jquery-2.2.1.js"></script>
    <script src="../Scripts/jquery-1.12.2.js"></script>
    <script src="../Scripts/bootstrap.js"></script>
    <script src="../Scripts/Site.js"></script>   
</head>
<body>
    <form id="form1" runat="server">
   
      <script type="text/javascript">

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

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

              return oWindow;
          }

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

        </script>

    <div class="container-fluid">
    <div class="panel panel-default">        
        <div class="panel-body">
            <div class="row inputDivMargin">
             <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
                 <span class="text-muted">
                 <b>Employee ID:</b>
                 </span>
             </div>
              <div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
                   <asp:TextBox ID="EmployeeIDTextBox" runat="server" CssClass="form-control" Enabled="false"></asp:TextBox>                 
             </div>

             </div>
           
            <div class="row inputDivMargin">
             <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
                 <span class="text-muted">
                 <b>Employee Name:</b>
                 </span>
             </div>
              <div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
                   <asp:TextBox ID="EmployeeNameTextBox" runat="server" CssClass="form-control" Enabled="false"></asp:TextBox>   
             </div>

             </div>

             <div class="row inputDivMargin" title="MobileInfo">
             <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
                <span class="text-muted">
                 <b>Mobile No:</b>
                 </span>
             </div>
              <div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
                   <asp:TextBox ID="MobileNoTextBox" runat="server" CssClass="form-control" TextMode="Number" MaxLength="10"></asp:TextBox>               
                  <span id="MobileValidityStatus"></span>
                   <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="MobileNoTextBox" 
                      Text="*" Display="Dynamic" ValidationGroup="UpdateValidation" ForeColor="Red">
                   </asp:RequiredFieldValidator>
                                    
                  <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                    ControlToValidate="MobileNoTextBox" Display="Dynamic" 
                    ErrorMessage="Must be 10 digits mobile no." ForeColor="Red" SetFocusOnError="True" 
                    ValidationExpression="^\d{10}$" ValidationGroup="UpdateValidation">
                   </asp:RegularExpressionValidator>
             </div>
             </div>
                     
             <div class="row inputDivMargin" title="MobileInfo">
             <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
               <span class=" text-muted">
                 <b>Limit Amount:</b>
                </span>
             </div>
              <div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
                  <asp:TextBox ID="LimitAmountTextBox" runat="server" CssClass="form-control" TextMode="Number"></asp:TextBox>            
                  <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="LimitAmountTextBox" 
                      Text="*" Display="Dynamic" ValidationGroup="UpdateValidation" ForeColor="Red">
                   </asp:RequiredFieldValidator>
             </div>

             </div>

            <div class="row inputDivMargin" title="MobileInfo">
             <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
                 <span class="text-muted">
                 <b>Service Amount:</b>
                </span>
             </div>
              <div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">                 
             <asp:TextBox ID="ServiceAmountTextBox" runat="server" CssClass="form-control" TextMode="Number"></asp:TextBox>
                  <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="ServiceAmountTextBox" 
                      Text="*" Display="Dynamic" ValidationGroup="UpdateValidation" ForeColor="Red">
                   </asp:RequiredFieldValidator>

             </div>

             </div>

             <div class="row inputDivMargin" title="MobileInfo">
             <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
               <span class="text-muted">
                 <b>Is Closed?</b>
                 </span>
             </div>
              <div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
                  <asp:RadioButtonList ID="IsClosedRadioButtonList" runat="server" RepeatDirection="Horizontal">
                      <asp:ListItem Value="Yes" Text="Yes"></asp:ListItem>
                      <asp:ListItem Value="No" Text="No"></asp:ListItem>
                  </asp:RadioButtonList>
             </div>

             </div>

            <div class="row inputDivMargin">
             <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
               <span class=" text-muted">
                 <b>Remarks:</b>
                </span>
             </div>
              <div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
                <asp:TextBox ID="RemarksTextBox" runat="server" CssClass="form-control" TextMode="MultiLine"></asp:TextBox>               
             </div>

             </div>
                     
            <div class="row inputDivMargin">
             <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">              
                
             </div>
              <div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
               <asp:Button runat="server" CssClass="btn btn-sm btn-success" ID="UpdateButton"  Text="Update"
                OnClick="UpdateButton_Click" ValidationGroup="UpdateValidation">
                </asp:Button>
                <asp:Button runat="server" CssClass="btn btn-sm btn-success" ID="CancelButton"  Text="Cancel" OnClientClick="CancelEdit();" />
                                       
                  <asp:Label ID="MessageLabel" runat="server" Text="" Visible="false"></asp:Label>
             </div>

             </div>
         
        </div>
    </div>
    </div>
    </form>
</body>
</html>

edit page .cs

 EmployeeClass empObj = new EmployeeClass();

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {               
                if (Request.QueryString["EmployeeID"] != null)
                {
                    string employeeID = Request.QueryString["EmployeeID"].ToString();
                    EmployeeIDTextBox.Text = employeeID;
                    DataTable dTable = empObj.GetEmployeeSIMDetails(employeeID);
                    if (dTable.Rows.Count != 0)
                    {
                        EmployeeNameTextBox.Text = dTable.Rows[0]["EmpName"].ToString();
                        MobileNoTextBox.Text = dTable.Rows[0]["MobileNo"].ToString();
                        LimitAmountTextBox.Text = dTable.Rows[0]["LimitAmount"].ToString();
                        ServiceAmountTextBox.Text = dTable.Rows[0]["ServiceAmount"].ToString();
                        RemarksTextBox.Text = dTable.Rows[0]["Remarks"].ToString();
                        string isClosed = dTable.Rows[0]["IsClosed"].ToString();
                        if (isClosed == "Yes")
                        {
                            IsClosedRadioButtonList.Items[0].Selected = true;
                            IsClosedRadioButtonList.Items[1].Selected = false;
                        }
                        else
                        {
                            IsClosedRadioButtonList.Items[0].Selected = false;
                            IsClosedRadioButtonList.Items[1].Selected = true;
                        }
                    }                   
                }
            }
        }

        protected void UpdateButton_Click(object sender, EventArgs e)
        {
            string employeeId = Request.QueryString["EmployeeID"].ToString();
            string mobileNo = MobileNoTextBox.Text.Trim();
            int limitAmount = Int32.Parse(LimitAmountTextBox.Text.Trim());
            int serviceAmount = Int32.Parse(ServiceAmountTextBox.Text.Trim());
            bool isClosed;
            if (IsClosedRadioButtonList.SelectedItem == null || IsClosedRadioButtonList.SelectedItem.Value == "No")
            {
                isClosed = false;
            }
            else
            {
                isClosed = true;
            }
            string remarks = RemarksTextBox.Text.Trim();

            empObj.EmployeeId = employeeId;
            empObj.MobileNo = mobileNo;
            empObj.LimitAmount = limitAmount;
            empObj.ServiceAmount = serviceAmount;
            empObj.IsClosed = isClosed;
            empObj.Remarks = remarks;
            int result = 0;
            try
            {
                result = empObj.UpdateEmployeeSIMInfo();
                if (result> 0)
                {
                    ClientScript.RegisterStartupScript(UpdateButton.GetType(), "mykey", "CloseAndRebind();", true);
                }
                else
                {
                    MessageLabel.Text = "SIM already issued";
                    MessageLabel.Visible = true;
                    MessageLabel.ForeColor = System.Drawing.Color.Red;
                    return;                    
                }               
            }
            catch (Exception ex)
            {
                MessageLabel.Text = ex.Message;
                MessageLabel.Visible = true;
                MessageLabel.ForeColor = System.Drawing.Color.Red;
            }
        }

 

 

Maria Ilieva
Telerik team
 answered on 04 Apr 2016
3 answers
140 views

Good Day All.

 

I have a raddataform that i have customized to suit our needs, however i have this bottom line that i cant get rid off, can you please let me know how to get rid of it.

 

Eon
Top achievements
Rank 1
 answered on 04 Apr 2016
2 answers
189 views

Hi,

When using the print toolbar button, the whole page is printed instead of the actual Editor content!

We are using Div-mode for several reasons...

This is also the case in your demo:
http://demos.telerik.com/aspnet-ajax/editor/examples/contentareamodediv/defaultcs.aspx

Regard
Andreas
Andreas
Top achievements
Rank 1
 answered on 04 Apr 2016
1 answer
439 views

I have a RadDatePicker where I have a custom attribute

<telerik:RadDatePicker ID="RadDatePicker_MinDate" runat="server" AutoPostBack="false" CssClass="InputDateField" variable="mindate">
    <ClientEvents OnPopupOpening="DatePickerOnFocus"
                           OnDateSelected="RadDatePicker_MinDate_DateSelected" />
    <DateInput runat="server"
          ClientEvents-OnFocus="DatePickerOnFocus">
    </DateInput>
</telerik:RadDatePicker>

The clientside function DatePickerOnFocus:

function DatePickerOnFocus(sender, eventArgs) {
        var id = sender.get_element().id + "_wrapper";
        var wrapper = $get(id);
        var var1 = wrapper.getAttribute("variable");
        .......
}

This works fine for the event OnPopupOpening.

For the event ClientEvents-OnFocus (of the DateInput) this doesn't work. I get a null value when reading the custom attribute.

How can I get the custom attribute in the event ClientEvents-OnFocus of the DateInput?

 

Paul

Viktor Tachev
Telerik team
 answered on 04 Apr 2016
1 answer
138 views

I am still having corruption in the date display at the min the week view I have tried everything think of to get the columns wider but is not working

 

01.<legend><i class="fa fa-angle-right"></i>Available Appointments</legend>
02. <asp:UpdatePanel ID="UpdatePanel1" runat="server">
03.  <ContentTemplate>
04.    <div>
05.      <legend>Calendar Layout</legend>
06.      <asp:RadioButtonList ID="rbDisplay"   CellSpacing="5" AutoPostBack="true" RepeatDirection="Horizontal" runat="server">
07.                                <asp:ListItem Value="1"> Verticle </asp:ListItem>
08.                                <asp:ListItem Value="2"> Horizontal </asp:ListItem>
09.                            </asp:RadioButtonList>
10.                        </div>
11.                                <telerik:RadScheduler OnTimeSlotCreated="apertureAppointments_TimeSlotCreated" OverflowBehavior="Auto" runat="server" WeekView-ShowDateHeaders="true" ID="apertureAppointments"
12.                                    TimelineView-UserSelectable="false" DayView-UserSelectable="true" AgendaView-UserSelectable="True" DataKeyField="ID" DataSubjectField="Subject" AllowInsert="false" AllowDelete="false" AllowEdit="false"
13.                                    DataStartField="Start" DataEndField="End" DataRecurrenceField="RecurrenceRule" DayView-EnableExactTimeRendering="true" WeekView-UserSelectable="True" SelectedView="WeekView"
14.                                    DataRecurrenceParentKeyField="RecurrenceParentID" DataSourceID="EntityDataSource1" StartInsertingInAdvancedForm="True" MonthView-UserSelectable="True" AgendaView-NumberOfDays="5" RowHeight="40px"
15.                                    RenderMode="Classic" EnableExactTimeRendering="True" Reminders-Enabled="true" Width="800px" Height="1000px" EnableDatePicker="false"
16.                                    DayStartTime="09:00:00" ShowFooter="false" DayEndTime="18:00" FirstDayOfWeek="Monday" LastDayOfWeek="Friday" HoursPanelTimeFormat="HH:mm tt" OnAppointmentClick="apertureAppointments_AppointmentClick" OnTimeSlotContextMenuItemClicking="apertureAppointments_TimeSlotContextMenuItemClicking"
17.                                    EnableDescriptionField="true" AppointmentStyleMode="Default" Skin="Metro">
18. 
19.                                    <AdvancedForm Modal="True" />
20. 
21.                                    <TimeSlotContextMenuSettings EnableDefault="false" />
22.                                    <AppointmentContextMenuSettings EnableDefault="false" />
23.                                    <DayView EnableExactTimeRendering="True" />
24.                                    <AdvancedForm Modal="true"></AdvancedForm>
25. 
26.                                    <ResourceTypes>
27.                                        <telerik:ResourceType KeyField="lookup_code" Name="Managers" TextField="lookup_description" ForeignKeyField="managerId"
28.                                            DataSourceID="ManagersDataSource"></telerik:ResourceType>
29.                                    </ResourceTypes>
30.                                    <ResourceStyles>
31.                                        <%--AppointmentStyleMode must be explicitly set to Default (see above) otherwise setting BackColor/BorderColor
32.                            will switch the appointments to Simple rendering (no rounded corners and gradients)--%>
33.                                        <telerik:ResourceStyleMapping Type="Managers" Text="Natalie Edgar"
34.                                            BackColor="#512479" ApplyCssClass="appointment" />
35.                                        <telerik:ResourceStyleMapping Type="Managers" Text="Clare Coyle"
36.                                            BackColor="#512479" ApplyCssClass="appointment" />
37.                                        <telerik:ResourceStyleMapping Type="Managers" Text="Christine Clarke"
38.                                            BackColor="#512479" ApplyCssClass="appointment" />
39.                                        <telerik:ResourceStyleMapping Type="Managers" Text="Adam Adair"
40.                                            BackColor="#512479" ApplyCssClass="appointment" />
41.  </ResourceStyles>
42. </telerik:RadScheduler>
43. </ContentTemplate>
44.</asp:UpdatePanel>

I just dont no what is wrong that is causing this corruption for when i look at your demos their fine in week view with horzontal grouping ?.

Regards

Magdalena
Telerik team
 answered on 04 Apr 2016
1 answer
287 views

I'm trying to utilize a RadProgressArea to keep track of a task's progress on my ASP page.  I have a relatively simple setup that is functioning fine.  However, the actual progress bar is appearing as a white bar on a white background, which is different from any other demo I've come across.  I've gone through the properties and style options, but there doesn't seem to be any way to specifically set the color of the progress bar.  Is there a way to change it to, say, blue?  Here's what I'm currently working with.

 

<Telerik:RadAjaxPanel runat="server">
  <Telerik:RadProgressArea ID="rpaProgress" runat="server" ProgressIndicators="TotalProgress,TotalProgressBar,TotalProgressPercent"></Telerik:RadProgressArea>
</Telerik:RadAjaxPanel>

I have a RadAjaxManagetProxy and a RadProgressManager defined elsewhere in the page.  In the code behind, I set RadProgressContext.Current.PrimaryTotal, PrimaryValue, PrimaryPercent, and OperationComplete as they need to update.  I get the attached result.
Magdalena
Telerik team
 answered on 04 Apr 2016
1 answer
318 views

Hello everyone,

I've been facing issues with RadTextBox for ASP in MultiLine mode when pressing the enter key. Actually no new line is displayed. When I set the text from codebehind or using binding the text is correctly displayed on multiple lines. This is illustrated in the radtextbox.png file attached.

Below is my code for the RadTextBox element :

<telerik:RadTextBox ID="RadTextBox1"
    Text='<%# DataBinder.Eval(Container, "DataItem.MyField") %>'
    runat="server" TextMode="MultiLine" Rows="8" Columns="40"
    RenderMode="Lightweight">
</telerik:RadTextBox>

In the struct.png file attached you'll find the structure of my web page.

By googling around and visiting many forum threads (including of course telerik) I found many potentials sources and fixes for the issue :

  • DefaultButton : tried with and without but no luck
  • white-space ccs attribute : the pre-wrap is what I need and what is set by default. I also tried normal and pre but still no luck
  • onkeypress event : captured the enter key event but did not work out in the end
  • AcceptsReturn : supposed to be for WinForms but at least I tried

I am using .Net Framework 4.0 and UI for ASP.NET AJAX v.2016.1.225.40.

Does anyone have a clue about this ?

Regards,
Benjamin

Benjamin
Top achievements
Rank 1
 answered on 04 Apr 2016
7 answers
348 views
The code that Telerik provides for a Use custom modal advanced template includes many css classes such as rsAdvanceEdit and rsAdvanceModal.  I would like to style these but I don't know where they are defined. 

Can someone please tell me where I can find the css for them?

<AdvancedEditTemplate>
   <div class="rsAdvancedEdit rsAdvancedModal" style="position: relative">
       <div class="rsModalBgTopLeft">
       </div>
       <div class="rsModalBgTopRight">
       </div>
       <div class="rsModalBgBottomLeft">
       </div>
       <div class="rsModalBgBottomRight">
       </div>    
       <div class="rsAdvTitle">         
           <h1 class="rsAdvInnerTitle">
               <%# Container.Appointment.Owner.Localization.AdvancedEditAppointment %></h1>
           <asp:LinkButton runat="server" ID="LinkButton1" CssClass="rsAdvEditClose"
               CommandName="Cancel" CausesValidation="false" ToolTip='<%# Container.Appointment.Owner.Localization.AdvancedClose %>'>
<%# Container.Appointment.Owner.Localization.AdvancedClose%>
           </asp:LinkButton>
       </div>
       <div class="rsAdvContentWrapper">
           <telerik:RadTextBox ID="SubjectTextBox" runat="server" Text='<%# Bind("Subject") %>'
               Label='<%# Container.Appointment.Owner.Localization.AdvancedSubject%>'>
           </telerik:RadTextBox>
           <p>
               Custom content here...
           </p>
           <asp:Panel runat="server" ID="Panel1" CssClass="rsAdvancedSubmitArea">
               <div class="rsAdvButtonWrapper">
                   <asp:LinkButton CommandName="Update" runat="server" ID="LinkButton2" CssClass="rsAdvEditSave">
<span><%# Container.Appointment.Owner.Localization.Save%></span>
                   </asp:LinkButton>
                   <asp:LinkButton runat="server" ID="LinkButton3" CssClass="rsAdvEditCancel" CommandName="Cancel"
                       CausesValidation="false">
<span><%# Container.Appointment.Owner.Localization.Cancel%></span>
                   </asp:LinkButton>
               </div>
           </asp:Panel>
       </div>
   </div>
</AdvancedEditTemplate>
Ivan Danchev
Telerik team
 answered on 04 Apr 2016
3 answers
293 views

Hi,

In my project we are replacing the grid view controls in to Rad Grid controls.

Please let me know how to implement the below code through the Rad Grid control.

for (int i = 0; i < gvEmployee.Rows.Count; i++)
{
employee = ((DropDownList)gvEmployee.Rows[i].FindControl("ddlEmployee")).SelectedValue;
for (int j = i + 1; j < gvEmployee.Rows.Count; j++)
{
if (string.Compare(employee, ((DropDownList)gvLOB.Rows[j].FindControl("ddlEmployee")).SelectedValue) == 0 && employee != "--SELECT--")
{
DoAlert("Please select distinct " + gvHeaderemployee);
return;
}
}
if (employee != "--SELECT--")
{
dtemployeelocal.Rows.Add(employee);
}
}

I need to check the distinct record added in my grid view on Submit button click event

 

Viktor Tachev
Telerik team
 answered on 04 Apr 2016
0 answers
118 views

Hello,

I want to change the text and command name for the LinkButton per row depending on another cell value. I saw this code for reading cells during binding. So when a read a cell and it means to change the link button how can I do it?

Thanks

Private Sub gvLevel3_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles gvLevel3.ItemDataBound
    If TypeOf e.Item Is GridDataItem Then
        Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)
        Dim cell As TableCell = DirectCast(item("Uniquename"), TableCell)
        Dim value As String = cell.Text
    End If
End Sub

Warren
Top achievements
Rank 1
 asked on 04 Apr 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?