Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
231 views
In my radgrid I am using a template for the insert form. The followinf are th RadGrid properties I have implemented:

                this._RadGrid1.Skin = "WebBlue";
            this._RadGrid1.Width = Unit.Percentage(100);
            this._RadGrid1.GridLines = GridLines.None;
            
            this._RadGrid1.AutoGenerateColumns = false;
            this._RadGrid1.AllowSorting = true;
            this._RadGrid1.GridLines = GridLines.None;
            this._RadGrid1.PageSize = 100;
            this._RadGrid1.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric;
           
            this._RadGrid1.AllowPaging = true;
            this._RadGrid1.AllowSorting = true;
            this._RadGrid1.ClientSettings.DataBinding.EnableCaching = true;
            this._RadGrid1.EnableLinqExpressions = false;
            this._RadGrid1.MasterTableView.NoMasterRecordsText = string.Format("There are no records");
            this._RadGrid1.MasterTableView.Width = Unit.Percentage(100);
            this._RadGrid1.MasterTableView.HierarchyDefaultExpanded = true;
            this._RadGrid1.MasterTableView.DataKeyNames = new string[] { this._OrderTable.OrderIdColumn.ColumnName };
            this._RadGrid1.MasterTableView.CommandItemSettings.ShowAddNewRecordButton = true;           
            this._RadGrid1.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Top;
            this._RadGrid1.MasterTableView.CommandItemSettings.AddNewRecordText = "Add Order task";
            this._RadGrid1.MasterTableView.AllowAutomaticInserts = false;
            //this._RadGrid1.MasterTableView.EditFormSettings.UserControlName = "AddOrderTaskControl.ascx";
            this._RadGrid1.MasterTableView.EditFormSettings.EditFormType = GridEditFormType.Template;
            this._RadGrid1.MasterTableView.EditFormSettings.FormTemplate = new InsertFormTemplate(this._OrderRequestId, this._SourceSystemTypeId, false);           
 
            this._RadGrid1.InsertCommand += _RadGrid1_InsertCommand;
            this._RadGrid1.ItemCommand += _RadGrid1_ItemCommand;
            this._RadGrid1.NeedDataSource += RadGrid1_NeedDataSource;

ON click of Add New button, the template opens but it does not have a Insert/Cancel button.
Princy
Top achievements
Rank 2
 answered on 08 May 2014
5 answers
297 views
Hi,
I have div that has barcode and QR. I want to control position of barcode and QR ( top , left , margin ) in code behind using c# because position coming from DB. 
How can I do that ? 
Thanks
Mariah
Top achievements
Rank 1
 answered on 08 May 2014
10 answers
333 views
Hi,

I am using a RADContentTemplateTile on the home page on my website to provide snapshots. when the user clicks on them they navigate to the actual page.
I want to display a hand cursor when I hover over it so that the user knows that the tiles are clickable.

below is a declaration of my tile:
<telerik:RadContentTemplateTile ID="RadContentTemplateTile1" runat="server" Name="balancesTile"
                            Shape="Wide" NavigateUrl="~/balances/balancesummary.aspx?MenuID=2&id=0" Width="460px"
                            BorderStyle="None">
                            <ContentTemplate>
                                <b>Balances</b>
                                <p>
                                    <bal:ucBalance ID="balanceSummary" runat="server" />
                                </p>
                            </ContentTemplate>
                        </telerik:RadContentTemplateTile>


Please suggest.
MBEN
Top achievements
Rank 2
Veteran
 answered on 07 May 2014
2 answers
283 views
Dears .

    kindly I need your support as I need to make if statement to compare between raddatepicker and datetime.now if raddatepicker for ex : 22/4/2014
and datetime.now give alert that it's in old date
Mohamed El-Sayed
Top achievements
Rank 1
 answered on 07 May 2014
1 answer
206 views
Hi,
This is first time I'm using teleric rad scheduler but telerik radscheduler not showing data on Saturday & Sunday. Or even color in cell [plase see attached snapshot].

My Code :

<telerik:RadScheduler runat="server" ID="RadScheduler1" Width="750px" DayStartTime="08:00:00"
                    DayEndTime="20:00:00" TimeZoneOffset="03:00:00" OnAppointmentInsert="RadScheduler1_AppointmentInsert"
                    OnAppointmentUpdate="RadScheduler1_AppointmentUpdate" OnAppointmentDelete="RadScheduler1_AppointmentDelete"
                    DataKeyField="ID" DataSubjectField="Subject" DataStartField="StartTime" DataEndField="EndTime"
                    OnAppointmentDataBound="RadScheduler1_AppointmentDataBound" CustomAttributeNames="AppointmentColor"
                    OnTimeSlotCreated="RadScheduler1_TimeSlotCreated"
                    AllowDelete="False" AllowInsert="False" EnableAdvancedForm="False" EnableResourceEditing="False"
                    OnNavigationCommand="RadScheduler1_NavigationCommand" OnNavigationComplete="RadScheduler1_NavigationComplete" 
                    SelectedView="MonthView" NumberOfHoveredRows="0">
                    <ExportSettings>
                        <Pdf PageTopMargin="1in" PageBottomMargin="1in" PageLeftMargin="1in" PageRightMargin="1in"></Pdf>
                    </ExportSettings>
                    <AdvancedForm Modal="true" Enabled="False" EnableResourceEditing="False"></AdvancedForm>
                    <TimelineView UserSelectable="false" GroupBy="ID"></TimelineView>
                    <TimeSlotContextMenuSettings EnableDefault="true"></TimeSlotContextMenuSettings>
                    <DayView DayEndTime="20:00:00" ReadOnly="True" ShowAllDayInsertArea="False" ShowInsertArea="False" />
                    <MonthView ReadOnly="True" VisibleAppointmentsPerDay="6" />
                    <AgendaView ReadOnly="True" />
                    <AppointmentContextMenuSettings EnableDefault="true"></AppointmentContextMenuSettings>
                </telerik:RadScheduler>





















Boyan Dimitrov
Telerik team
 answered on 07 May 2014
1 answer
58 views
Sorry this question is not related to Asp.net Ajax.But it is related to telerik product.

I post my question on stackoverflow also but no one reply me. And I am in problem so that i am asking this question here.

I created a application in asp.net MVC4.
I am using kendo components for UI. My version of kendo is 2013.3.1324. I want create a feature (http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/edit-form-types/defaultcs.aspx) using kendo grid in mvc4.

In simple words i want "editform" type in edit mode of grid.

I don't want to use template.Is there is any other way to implement feature like this?


Please help me.
Konstantin Dikov
Telerik team
 answered on 07 May 2014
4 answers
376 views
hi community,

does anyone know how to set the focus on a radinput within radwindow contenttemplate onload. i set VisibleOnPageLoad="true" at the radwindow. i have tried all the described methods on (http://demos.telerik.com/aspnet-ajax/input/examples/common/focus/defaultcs.aspx).

thanks
Bernhard
Gowtham
Top achievements
Rank 1
 answered on 07 May 2014
1 answer
80 views
I can apply a CSS class to a paragraph by using the ApplyClass tool, which will add a <span class="className"> inside the paragraph. But I would prefer the selected class being applied to the selected P element directly instead of adding an extra SPAN.

Can that be achieved?
Ianko
Telerik team
 answered on 07 May 2014
3 answers
352 views
Hi,

Is <br/> tag supported in LabelsAppearance tag? I added a <br/> tag in LabelAppearance and it doesn't work in the same way as it works in TooltipsAppearance

The following line does not work:

<LabelsAppearance Position="Circle" ClientTemplate="#=dataItem.department# <br/>$#=dataItem.amount#M (#=dataItem.percent#%)" > </LabelsAppearance>

LabelsAppearance  works fine if I remove the <br/> tag.

Below is the full code:

 <telerik:RadHtmlChart runat="server" ID="PieChart1" Width="800" Height="550" Transitions="true"
                    Skin="Forest">
                    <Appearance>
                         <FillStyle BackgroundColor="White"></FillStyle>
                    </Appearance>
                    <ChartTitle Text="Total: $2,694,491,736">
                         <Appearance Align="Center" BackgroundColor="White" Position="Bottom">
                         </Appearance>
                    </ChartTitle>
                    <Legend>
                         <Appearance BackgroundColor="White" Position="Right" Visible="true">
                         </Appearance>
                    </Legend>
                    <PlotArea>
                         <Appearance>
                              <FillStyle BackgroundColor="White"></FillStyle>
                         </Appearance>
                         <Series>
                              <telerik:PieSeries StartAngle="90" DataFieldY="percent" ColorField="customcolor">
                                   <LabelsAppearance Position="Circle" ClientTemplate="#=dataItem.department# $#=dataItem.amount#M (#=dataItem.percent#%)" >
                                     
                                   </LabelsAppearance>
                                   <TooltipsAppearance ClientTemplate="#=dataItem.department#<br/>$#=dataItem.amount#M (#=dataItem.percent#%)"></TooltipsAppearance>
                              </telerik:PieSeries>
                         </Series>
                    </PlotArea>
               </telerik:RadHtmlChart>


Thanks

 

Danail Vasilev
Telerik team
 answered on 07 May 2014
1 answer
193 views
Hi,

I'm using a RadGrid with a delete button.
When clicking the delete button, I like to show a window confirm box.
The box will not be shown when the grid in the AjaxUpdatedControl list.

How can I show the window and keep the RadGrid in the AjaxUpdatedControl list?

Thanks,
Egbert

Here is the xaml and code file:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ReportsGeneral.ascx.cs"
    Inherits="ReportsGeneral" %>
 
<%@ Register TagPrefix="uc" TagName="InfoPanel" Src="~/InfoPanel.ascx" %>
<%@ Register TagPrefix="uc" TagName="RisWindow" Src="~/RisWindow.ascx" %>
 
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
    <script type="text/javascript">
        function OnClientFilesUploaded(sender, args) {
            $find('<%=RadAjaxManager1.ClientID %>').ajaxRequest();
        }
    </script>
</telerik:RadScriptBlock>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" EnablePageHeadUpdate="false">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadAsyncUploadReport" />
                <telerik:AjaxUpdatedControl ControlID="RadGridReports" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
<div style="margin: 15px;">
    <center>
        <table>
            <tr>
                <td valign="top">
                    Begin
                    <telerik:RadCalendar ID="RadCalendar1" runat="server">
                    </telerik:RadCalendar>
                </td>
                <td rowspan="2" valign="top" style="margin-left: 10px; padding-left: 10px;">
                    Rapporten
                    <telerik:RadGrid ID="RadGridReports" runat="server" AllowPaging="True" ActiveItemStyle-Wrap="True"
                        ShowStatusBar="true" AllowSorting="True" AllowMultiRowEdit="true" AutoGenerateColumns="false"
                        AllowAutomaticInserts="true" OnNeedDataSource="RadGridReports_NeedDataSource" ClientSettings-Selecting-AllowRowSelect="true" ClientSettings-EnablePostBackOnRowClick="true"
                        OnItemCommand="RadGridReports_ItemCommand">
                        <MasterTableView PageSize="10" NoMasterRecordsText="No data">
                            <Columns>
                                <telerik:GridBoundColumn DataField="report_id" HeaderText="ID" UniqueName="id" Display="false">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="owner" HeaderText="Eigenaar" UniqueName="owner">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="filename" HeaderText="Rapport" UniqueName="filename">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="info" HeaderText="Info" UniqueName="info" Display="false">
                                </telerik:GridBoundColumn>
                                <telerik:GridButtonColumn UniqueName="DeleteReportCommand" CommandName="DeleteReport"
                                    ButtonType="ImageButton" ImageUrl="~/Skins/Office2010Blue/Grid/Delete.png" Text="Verwijder"
                                    ItemStyle-Width="24px">
                                </telerik:GridButtonColumn>
                            </Columns>
                        </MasterTableView>
                        <ClientSettings EnableRowHoverStyle="true">
                        </ClientSettings>
                    </telerik:RadGrid>
                    <br />
                    <telerik:RadButton runat="server" ID="checkBoxOnlyShowMyReports" Text=" Alleen eigen rapporten tonen"
                    ButtonType="ToggleButton" ToggleType="CheckBox" OnClick="checkBoxOnlyShowMyReports_Click"> </telerik:RadButton>
                    <br />
                    <br />
                    <asp:Panel runat="server" GroupingText="Upload rapport">
                        <telerik:RadAsyncUpload ID="RadAsyncUploadReport" runat="server" OnFileUploaded="RadAsyncUploadReport_FileUploaded"
                            OnClientFilesUploaded="OnClientFilesUploaded" AllowedFileExtensions="xlsx" Localization-Select="Selecteer" Width="99%">
                        </telerik:RadAsyncUpload>
                        <br />
                    <uc:InfoPanel ID="InfoPanel1" runat="server" Type="note" Text="Je kan alleen rapporten uploaden met de .xlsx extensie!" HeaderText="Let op!"/>
                    </asp:Panel>
                    <br />
                    <div style="text-align: center">
                    <telerik:RadButton ID="buttonGenerateReport" runat="server" Text="Genereer rapport!" OnClick="buttonGenerateReport_Click" Skin="MetroTouch"></telerik:RadButton>
                    </div>
                    <uc:InfoPanel ID="InfoPanel2" runat="server" Type="note" Text="Bezig met invullen van het rapport!" HeaderText="" Visible="false"/>
                </td>
            </tr>
            <tr>
                <td valign="top">
                    Eind
                    <telerik:RadCalendar ID="RadCalendar2" runat="server">
                    </telerik:RadCalendar>
                </td>
                <td>
                      
                </td>
            </tr>
        </table>
        <uc:RisWindow runat="server" ID="windowWarning" />
        <telerik:RadNotification ID="RadNotification" runat="server" Text="Initial text" Position="Center" AutoCloseDelay="0" Width="350" Title="Current time" EnableRoundedCorners="true" />
        <telerik:RadWindow ID="RadWindowConfirm" VisibleOnPageLoad="false" Title="Waarschuwing"
            runat="server" Modal="true" AutoSize="false" Width="400" Height="200" VisibleTitlebar="true"
            VisibleStatusbar="False" Behaviors="None" Skin="MetroTouch">
            <ContentTemplate>
                <p style="text-align: center;">
                    <asp:Label runat="server" ID="label1" Text="Rapport verwijderen?"></asp:Label>
                </p>
                <p style="padding: 10px; text-align: center;">
                    <telerik:RadButton ID="ButtonDeleteReportYes" Text="Ja" AutoPostBack="true" runat="server"
                        OnClick="ButtonDeleteReportYes_Click" Skin="MetroTouch">
                    </telerik:RadButton>
                    <telerik:RadButton ID="RadDeleteReportNo" Text="Nee" AutoPostBack="true" runat="server"
                        OnClick="ButtonDeleteReportNo_Click" Skin="MetroTouch">
                    </telerik:RadButton>
                </p>
            </ContentTemplate>
        </telerik:RadWindow>
    </center>
</div>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using System.IO;
using Ris.Classes;
using System.Data;
using SpreadsheetLight;
using DocumentFormat.OpenXml.Spreadsheet;
 
public partial class ReportsGeneral : System.Web.UI.UserControl
{
    private DbHours dbHour = new DbHours();
    private DbProjects dbProject = new DbProjects();
    private DbReports dbReports = null;
    private DbTasks dbTask = new DbTasks();
    private DbUsers dbUser = new DbUsers();
    private string userID = string.Empty;
 
    protected void Page_Load(object sender, EventArgs e)
    {
        this.userID = Session["UserID"].ToString();
        dbReports = new DbReports();
 
        if (!IsPostBack)
        {
            if (Session["OnlyUseMyReports"].ToString() == "0")
            {
                this.checkBoxOnlyShowMyReports.Checked = false;
            }
            else
            {
                this.checkBoxOnlyShowMyReports.Checked = true;
            }
        }
    }
 
    protected override void OnPreRender(EventArgs e)
    {
        base.OnPreRender(e);
    }
 
    protected void UploadReport_Click(object sender, EventArgs e)
    {
        this.RadAsyncUploadReport.Visible = true;
    }
 
    protected void RadAsyncUploadReport_FileUploaded(object sender, FileUploadedEventArgs e)
    {
        string shortName = dbUser.GetUserItem(this.userID, "short_name");
 
        //// Save the file
        string filename = Global.ReportFolder + shortName + "-" + e.File.FileName;
        e.File.SaveAs(filename);
         
        //// Store the fileinfo in the database
        DbReports dbReports = new DbReports();
        if (!dbReports.ReportExist(e.File.FileName, this.userID))
        {
            dbReports.InsertReport(e.File.FileName, this.userID);
        }
 
        this.RadGridReports.Rebind();
    }
 
    protected void RadGridReports_NeedDataSource(object sender, EventArgs e)
    {
        this.DisplayReports();
    }
 
    private void DisplayReports()
    {
        DataSet dSet = new DataSet();
        if (Session["OnlyUseMyReports"].ToString() == "0")
        {
            dSet = dbReports.GetAllReports();
            this.RadGridReports.Columns[4].Display = false;
        }
        else
        {
            dSet = dbReports.GetMyReports(this.userID);
            this.RadGridReports.Columns[4].Display = true;
        }
 
        this.RadGridReports.DataSource = dSet;
    }
 
    protected void buttonGenerateReport_Click(object sender, EventArgs e)
    {
        if (this.RadGridReports.SelectedItems.Count <= 0)
        {
            this.windowWarning.Show("Selecteer eerst een rapport!");
            return;
        }
 
        // now start with the reporting
        string reportID = Session["ReportID"].ToString();
        string ownerID = dbReports.GetReportItem(reportID, "user_id");
        string reportFileName = dbReports.GetReportItem(reportID, "filename");
        string shortNameOwner = dbUser.GetUserItem(ownerID, "short_name");
 
        string completePath = Global.ReportFolder + shortNameOwner + "-" + reportFileName;
 
        if (reportFileName.ToLower().StartsWith("vakantiekaart"))
        {
            ReportsVacation reportsVacation = new ReportsVacation();
            string reportResult = reportsVacation.CreateReport(completePath, reportFileName);
            if (reportResult != string.Empty)
            {
                this.windowWarning.Show(reportResult);
                return;
            }
        }
        else
        {
            ReportsStandard reportsStandard = new ReportsStandard();
            string reportResult = reportsStandard.CreateReport(completePath, reportFileName);
        }
 
        try
        {
            this.FileResponse(reportFileName, Global.ReportOutputFolder + reportFileName);
        }
        catch (Exception ex)
        {
            this.windowWarning.Show("Fout bij opslaan rapport: " + Global.ReportOutputFolder + reportFileName + "! Bestaat de folder?");
        }
 
        //this.RadNotification.VisibleOnPageLoad = true;
        //this.InfoPanel2.Visible = true;
        return;
    }
 
    protected void RadGridReports_ItemCommand(object source, GridCommandEventArgs e)
    {
        if (e.CommandName == "RowClick" && e.Item is GridDataItem)
        {
            e.Item.Selected = true;
 
            GridDataItem item = e.Item as GridDataItem;
            Session["ReportID"] = item["id"].Text;
        }
 
        if (e.CommandName == "DeleteReport")
        {
            GridDataItem item = e.Item as GridDataItem;
            Session["DeleteReportID"] = item["id"].Text;
 
            this.RadWindowConfirm.VisibleOnPageLoad = true;
        }
    }
 
    private void FileResponse(string downloadfilename, string filePath)
    {
        System.IO.FileInfo file = new System.IO.FileInfo(filePath); //-- if the file exists
        if (file.Exists) //set appropriate headers 
        {
            BinaryReader fs = new BinaryReader(file.OpenRead());
            HttpContext.Current.Response.ClearContent();
            HttpContext.Current.Response.Clear();
            HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment; filename=" + downloadfilename);
            HttpContext.Current.Response.AddHeader("Content-Length", file.Length.ToString());
            HttpContext.Current.Response.ContentType = "application/octet-stream";
            byte[] bite = fs.ReadBytes((int)file.Length);
            fs.Close();
            HttpContext.Current.Response.BinaryWrite(bite);
        }
    }
     
    protected void checkBoxOnlyShowMyReports_Click(object sender, EventArgs e)
    {
        Session["OnlyUseMyReports"] = "0";
        if (checkBoxOnlyShowMyReports.Checked == true)
        {
            Session["OnlyUseMyReports"] = "1";
        }
 
        this.RadGridReports.Rebind();
    }
 
    protected void ButtonDeleteReportYes_Click(object sender, EventArgs e)
    {
        this.RadWindowConfirm.VisibleOnPageLoad = false;
 
        this.dbReports.DeleteReport(Session["DeleteReportID"].ToString());
    }
 
    protected void ButtonDeleteReportNo_Click(object sender, EventArgs e)
    {
        this.RadWindowConfirm.VisibleOnPageLoad = false;
    }
}

Marin Bratanov
Telerik team
 answered on 07 May 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?