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

Hi again always the simple things but for the live of me i cant see with the date is not showing beside today in my claendar i have showheaders=true and datepicker=true so i dont get why i cant see the full date string beside the picker.

 

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

Ivan Danchev
Telerik team
 answered on 21 Apr 2016
1 answer
134 views

I need to be able to understand how the occurance rule works in the db as I need to be able to extract them to be able to create shift patterns.

 

01.//Creating a Weekly Recurrence rule
02.int interval = 2;
03.RecurrenceRange range = new RecurrenceRange();
04. 
05.range.Start = Convert.ToDateTime(rdStartShift.SelectedDate);
06.range.EventDuration = TimeSpan.FromMinutes(30);
07.range.MaxOccurrences = 3;
08.RecurrenceDay recurrenceDay = RecurrenceDay.Wednesday;
09.// _shifts.RecurrenceRule = new WeeklyRecurrenceRule(interval, recurrenceDay, range).ToString();
10.DayOfWeek startDayOfWeek = DayOfWeek.Tuesday;
11._shifts.RecurrenceRule = new WeeklyRecurrenceRule(interval, recurrenceDay, range, startDayOfWeek).ToString();

I need be able expand this data to add to a list of shifts so that i can set them in the calendar as the start time and end time of an angents shift. So I guess question is how do i expand the recurrance ruel.
Nencho
Telerik team
 answered on 21 Apr 2016
2 answers
279 views

I have a grid as described below. I want to do batch editing, but when I click on cell with text nothing happens. I have another grid with exact same configuration which is working fine. I have no idea what I am missing here. Help will be appreciated

 

<telerik:RadGrid AutoGenerateColumns="false"
                    ID="gridKeyRisks" runat="server" Skin="TIPRSilkSkin" EnableEmbeddedSkins="false"
                    ClientIDMode="Static" OnItemCreated="RiskGridOnItemCreated"
                    OnBatchEditCommand="gridKeyRisks_BatchEditCommand">
                    <MasterTableView DataKeyNames="KeyRiskId"
                    NoMasterRecordsText="No data to display" EditMode="Batch">
                    <BatchEditingSettings EditType="Cell" SaveAllHierarchyLevels="True"></BatchEditingSettings>
                        <Columns>                  
                            <telerik:GridBoundColumn DataField="RiskNumber" HeaderText="#"
                                HeaderStyle-Font-Size="14px"
                                HeaderStyle-Font-Bold="true" ItemStyle-Font-Size="14px" ReadOnly="true" />                         
                            <telerik:GridBoundColumn DataField="RiskName" HeaderText="Risk" HeaderStyle-Font-Size="14px"
                                HeaderStyle-Font-Bold="true" ItemStyle-Font-Size="14px" ReadOnly="true" />
                            <telerik:GridBoundColumn DataField="Impact" HeaderText="Impact" HeaderStyle-Font-Size="14px"
                                HeaderStyle-Font-Bold="true" ItemStyle-Font-Size="14px" />
                            <telerik:GridBoundColumn DataField="Likelihood" HeaderText="Likelihood" HeaderStyle-Font-Size="14px"
                                HeaderStyle-Font-Bold="true" ItemStyle-Font-Size="14px" />
                            <telerik:GridBoundColumn DataField="Status" HeaderText="Status" HeaderStyle-Font-Size="14px"
                                HeaderStyle-Font-Bold="true" ItemStyle-Font-Size="14px" />
                            <telerik:GridBoundColumn DataField="MitigationStrategy" HeaderText="Mitigation Strategy"
                                HeaderStyle-Font-Size="14px" HeaderStyle-Font-Bold="true" ItemStyle-Font-Size="14px" />
                            <telerik:GridTemplateColumn UniqueName="TemplateEditColumn">
                                <ItemTemplate>
                                    <TIPR:GridRowEditButton runat="server" ID="rowEditButton" />
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>                          
                        </Columns>
                    </MasterTableView>
                </telerik:RadGrid>

Eyup
Telerik team
 answered on 20 Apr 2016
1 answer
174 views

Hello

I have a textbox with an event handler for TextBox_OnTextChanged.  I also have a RadComboBox.

When a value in TextBox changes, it does fire the TextBox_OnTextChanged event.  In this handler the RadComboBox.SelectedValue is set to either '0' or a non-zero value - which looks to be correct under the debugger. I have ajaxified it.  However, the RadComboBox selected value does not seem to be changing.  How do I get the RadComboBox to reflect the changed value?

Thanks, Raka.

 

        protected void txtName_TextChanged(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtName.Text))
            {
                rcbProgram.Enabled = true;
                rcbProgram.SelectedValue = "0";
            }
            else
            {
                rcbProgram.SelectedValue = subProgram == null ? "0" : subProgram.ProgramId.ToString();
                rcbProgram.Enabled = false;
            }
        }

Eyup
Telerik team
 answered on 20 Apr 2016
4 answers
128 views

I have two RadWindows side-by-side within a RadWindowManager. Both windows can be resized and moved, and are populated (say with some static html page). When I resize or move one of the windows by dragging the borders or titlebar, the other window that doesn't have focus blanks out for the duration of the drag. The contents reappear only when the resize/move operation is completed on the first window.

Can this behavior be modified, so that contents of the second window are visible even while the first window is being resized/moved?

I'm using version 2010.1.309.20, and my IDE is VS 2008, with .NET 3.5 SP1. The browser being used is IE 6.0.

Here is the body of my page:

<body> 
    <form id="form1" runat="server">  
    <div>      
        <asp:ScriptManager ID="ScriptManager1" runat="server">  
        </asp:ScriptManager> 
      
    <telerik:RadWindowManager ID="DBRadWindowManager" runat="server">  
        <Windows> 
            <telerik:RadWindow ID="CustomerWindow" runat="server" VisibleOnPageLoad="true" TabIndex="1" ReloadOnShow="true" 
                BorderStyle="None" Behavior="Default" Height="250px" InitialBehavior="None" Left="5px"   
                Skin="Telerik" Title="CUSTOMER" Top="20px" Width="300px" NavigateUrl="Source1.htm"   
                Behaviors="Maximize,Minimize,Move,Reload,Resize" KeepInScreenBounds="true">  
            </telerik:RadWindow> 
            <telerik:RadWindow ID="OrderWindow" runat="server" VisibleOnPageLoad="True" TabIndex="2" ReloadOnShow="true" 
                BorderStyle="None" Behavior="Default" Height="250px" InitialBehavior="None" Left="400px" 
                Skin="Telerik" Title="ORDERS" Top="20px" Width="300px" NavigateUrl="Source2.htm" 
                Behaviors="Maximize,Minimize,Move,Reload,Resize" KeepInScreenBounds="true">  
            </telerik:RadWindow> 
        </Windows> 
    </telerik:RadWindowManager> 
    </div> 
    </form> 
</body> 

Thanks,
Karun.
Marin Bratanov
Telerik team
 answered on 20 Apr 2016
3 answers
106 views

I am using rad grid to load the data in a nested view and save it into the database using a generic class (get/set the data's based on the controls in the form).
After saving the data I need to reload the data back into the radgrid in the nested view (using OnDetailTableDataBind with HierarchyLoadMode=ServerBind).

I have all the required data in the form of an xml

<Rows>
  <Row> Parent View
    <SubRow>
        Child View
    </SubRow>
   </Row>
 </Rows>

Can any one please help how to set OnDetailTableDataBind event from a generic class?

Private Function SetGridControls(ByVal telerikGrid As RadGrid, ByVal gridValue As String) As RadGrid
    Dim loXML As XmlDocument = New XmlDocument
    Dim dtRowTable As DataTable
    Dim dtColumnTable As DataTable
 
    telerikGrid.AutoGenerateColumns = True
    If gridValue.Length > 0 Then
        loXML.LoadXml(gridValue)
 
        Dim elementChild As XmlNodeList = loXML.GetElementsByTagName("SubRow")
        Dim loElem As XmlElement
        Dim loAtt As XmlAttribute
        dtRowTable = New DataTable          'Contains all the ROWS
        dtColumnTable = New DataTable       'Contains all the SUBROWS
 
        Dim blnRowDT As Boolean = False    
        Dim blnColumnDT As Boolean = False
 
        dtRowTable = New DataTable()
        dtColumnTable = New DataTable()
 
        'Loading all the subrows
        Dim SubRowList As XmlNodeList = loXML.GetElementsByTagName("SubRow")
        For Each node As XmlNode In SubRowList
            If blnColumnDT = True Then
                Exit For
            End If
            For i As Integer = 0 To node.Attributes.Count - 1
                dtColumnTable.Columns.Add(New DataColumn(node.Attributes(i).Name))
            Next
            blnColumnDT = True
        Next
 
        For Each node As XmlNode In SubRowList
            Dim row As DataRow = dtColumnTable.NewRow()
            For i As Integer = 0 To node.Attributes.Count - 1
                Dim columnName As String = node.Attributes(i).Name
                Try
                    Thread.CurrentThread.CurrentCulture = USCulture
                    If Not IsNumeric(node.Attributes(i).gridValue) AndAlso IsDate(node.Attributes(i).gridValue) Then
                        row(columnName) = DateString(CDate(node.Attributes(i).gridValue), StringFormat.ShortDate)
                    Else
                        row(columnName) = node.Attributes(i).gridValue
                    End If
                Catch e As SystemException
                    row(columnName) = node.Attributes(i).gridValue
                Finally
                    Thread.CurrentThread.CurrentCulture = CultureInfo
                End Try
            Next 
        dtColumnTable.Rows.Add(row)
        Next
 
        'Loading all the rows
        For Each loElem In loXML.DocumentElement
            If (blnRowDT = True) Then
                Exit For
            End If
            For Each loAtt In loElem.Attributes
                If Not dtRowTable.Columns.Contains(loAtt.Name) Then
                    dtRowTable.Columns.Add(New DataColumn(loAtt.Name))
                End If
            Next
            blnRowDT = True
        Next
 
 
 
        Dim iRow As Integer = 1
        For Each loElem In loXML.DocumentElement
            Dim row As DataRow = dtRowTable.NewRow()
            For Each loAtt In loElem.Attributes
                Dim columnName As String = loAtt.Name
                Try
                    Thread.CurrentThread.CurrentCulture = USCulture
                    If Not IsNumeric(loAtt.gridValue) AndAlso IsDate(loAtt.gridValue) Then
                        row(columnName) = DateString(CDate(loAtt.gridValue), StringFormat.ShortDate)
                    Else
                        If loAtt.gridValue.Trim = "" And TypeOf (row(columnName)) Is Double Then
                            row(columnName) = 0
                        Else
                            row(columnName) = loAtt.gridValue
                        End If
                    End If
                Catch e As SystemException
                    row(columnName) = loAtt.gridValue
                Finally
                    Thread.CurrentThread.CurrentCulture = CultureInfo
                End Try
            Next
            dtRowTable.Rows.Add(row)
            iRow += 1
        Next
 
        'Attaching all the rows into datasource
        telerikGrid.DataSource = dtRowTable
    End If
 
    Return telerikGrid
End Function

Maria Ilieva
Telerik team
 answered on 20 Apr 2016
0 answers
88 views

We are trying to integration spell check tool with MS CRM 2011 in Email activity. This is working fine with Web Client. But when we test the same in CCD, we are unable to select the suggested options from list of given options. But if suggested options framed have scroll bar, then we are able to pick a value. And this issue appears from second time when we load spell check for a control. Appreciate any suggestions.

 

Thanks,

Raghu

Raghu
Top achievements
Rank 1
 asked on 20 Apr 2016
5 answers
297 views

hi 

How do i remove those white border line in the header? Thanks a lot

Here are my code.

  <style>
div.RadPanelBar_Default div.rpHeaderTemplate,
div.RadPanelBar_Default a.rpLink,
div.RadPanelBar_Default a.rpSelected
{
    background-image: none;
    background-color: #2C3E50;
    color:#fff;
    border-color:#2C3E50;
    border: none 0px !important; 
    font-size:medium;

}

 div.RadPanelBar_Default .rpExpanded {
    background-color: #2C3E50 !important;
    color:#fff;
    border-color:#2C3E50;
    border: none 0px !important; 
}  

 .RadPanelBar .rpRootGroup, .rpItem .rpLink   
{    
     border: none 0px !important;    
     color: #FFF;  
     text-decoration: none;  
     border-bottom-width: 0px !important; 
     padding: 0px 0px 0px 0px !important; 
}  

.RadPanelBar rpRootGroup  .rpGroup .rpItem .rpLink
   {
      color: Green;
   }
.RadPanelBar .rpOut  
{  
    border-bottom-width: 0px !important;  
}  
.RadPanelBar_Default ul li a:link, 
.RadPanelBar_Default ul li a:visited, 
.RadPanelBar_Default ul li a:hover, 
.RadPanelBar_Default ul li a:active 
{
    color: #fff;
    display: block;
    /* width: auto !important;
    float: left; */
    border-top: 0px solid #2C3E50;
    border-bottom: 0px solid #2C3E50;
    border: none 0px !important; 
 

}
.rpExpanded {
    background-color:#2C3E50  !important;
    color:#fff;
    border: none 0px !important; 
}
 
.rpSelected {
    background-color:#2C3E50  !important;
    color:#fff;
    border: none 0px !important; 
}

 
</style>
    <telerik:RadPanelBar ID="RadPanelBar1"  runat="server">
          
    </telerik:RadPanelBar>

Ivan Danchev
Telerik team
 answered on 20 Apr 2016
0 answers
133 views

Hi, everyone,when am using asynchronous telerik upload,but when i clicks on remove it disappering upload control also,please help me..am working on this since last 2 days...

this is my telrik 

@(Html.Telerik().Upload()
        .Name("attachments_" + ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))
        .Multiple(true)
        .Async(async => async
            .Save("Save", "GalleryUser", new { name = @Model, area = "" })
                .Remove("Remove", "GalleryUser", new { name = @Model, area = "" })
            .AutoUpload(true)
        )
        .ClientEvents(events => events.OnSuccess("OnSuccess_" + ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty)).OnLoad("OnLoad_" + ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty)))
        .HtmlAttributes(new { @class = "gallery-upload-box" })
)

 

this is my scripts related to events

<script type="text/javascript">

    var i11 = @(i1);

    function OnSuccess_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))(e) {
        debugger;

        if (e.operation == "upload") {
            var imgUrl = "/Image?img=/" + encodeURIComponent("Content/UserFiles/Users/@Model/" + getFileInfo(e));
            var divCont = '<div class="gallery_div '+getFileInfo(e)+' gallery_div_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty)) gallery_img_'
                          +i11+'_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))"><img src="'+imgUrl+
                          '&w=120&h=120&t=0&c=0" alt="" /><input type="text" class="gallery_textbox"'+
                          ' id="desc_gallery_img_@(i1)_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))" />'+
                          '<input type="checkbox" class="gallery_img_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))" id="gallery_img_'+
                          i11+'_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))" /><span for="gallery_img_'+i11+
                          '_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))">מחק</span></div>';
            //var divCont = '<div class="'+getFileInfo(e)+' gallery_div_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty)) gallery_img_'+i11+'_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))"><img src="'+imgUrl+'&w=120&h=120&t=0&c=0" alt="" /></div>';
            $(".gallery_editor_wrap_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))").append(divCont);
            i11 = i11 + 1;
        }
        else if (e.operation == "remove") {
            $('div[class*="'+getFileInfo(e)+'"]').remove();
           
        }
       
      
           
        }


    var PARAM_NAME = "attachments";
    function OnLoad_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))(e) {
        var uploadElement = $("input", this).attr("name", PARAM_NAME);
        setTimeout(function () {
            uploadElement.data("tUpload").name = PARAM_NAME;
        }, 0);
    }

    function getFileInfo(e) {
        return $.map(e.files, function (file) {
            var info = file.name;
            return info;
        }).join(", ");
    }
</script>
@{ Html.Telerik().ScriptRegistrar().OnDocumentReady(@<text>
        $(".gallery_img_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))").live("click", function(){
        var itemid = $(this).attr("id");
        var imgPaht = $("." + itemid + " img").attr("src");
        $.post("/GalleryUser/RemoveFile", { name: "@Model", fullName: imgPaht } )
        .success(function() {
        $("." + itemid).remove();
        });
        return false;
        });
</text>); }

<script type="text/javascript">

    var i11 = @(i1);

    function OnSuccess_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))(e) {
        debugger;

        if (e.operation == "upload") {
            var imgUrl = "/Image?img=/" + encodeURIComponent("Content/UserFiles/Users/@Model/" + getFileInfo(e));
            var divCont = '<div class="gallery_div '+getFileInfo(e)+' gallery_div_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty)) gallery_img_'
                          +i11+'_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))"><img src="'+imgUrl+
                          '&w=120&h=120&t=0&c=0" alt="" /><input type="text" class="gallery_textbox"'+
                          ' id="desc_gallery_img_@(i1)_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))" />'+
                          '<input type="checkbox" class="gallery_img_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))" id="gallery_img_'+
                          i11+'_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))" /><span for="gallery_img_'+i11+
                          '_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))">מחק</span></div>';
            //var divCont = '<div class="'+getFileInfo(e)+' gallery_div_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty)) gallery_img_'+i11+'_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))"><img src="'+imgUrl+'&w=120&h=120&t=0&c=0" alt="" /></div>';
            $(".gallery_editor_wrap_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))").append(divCont);
            i11 = i11 + 1;
        }
        else if (e.operation == "remove") {
            $('div[class*="'+getFileInfo(e)+'"]').remove();
           
        }
       
      
           
        }


    var PARAM_NAME = "attachments";
    function OnLoad_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))(e) {
        var uploadElement = $("input", this).attr("name", PARAM_NAME);
        setTimeout(function () {
            uploadElement.data("tUpload").name = PARAM_NAME;
        }, 0);
    }

    function getFileInfo(e) {
        return $.map(e.files, function (file) {
            var info = file.name;
            return info;
        }).join(", ");
    }
</script>
@{ Html.Telerik().ScriptRegistrar().OnDocumentReady(@<text>
        $(".gallery_img_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))").live("click", function(){
        var itemid = $(this).attr("id");
        var imgPaht = $("." + itemid + " img").attr("src");
        $.post("/GalleryUser/RemoveFile", { name: "@Model", fullName: imgPaht } )
        .success(function() {
        $("." + itemid).remove();
        });
        return false;
        });
</text>); }
<script type="text/javascript">

    var i11 = @(i1);

    function OnSuccess_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))(e) {
        debugger;

        if (e.operation == "upload") {
            var imgUrl = "/Image?img=/" + encodeURIComponent("Content/UserFiles/Users/@Model/" + getFileInfo(e));
            var divCont = '<div class="gallery_div '+getFileInfo(e)+' gallery_div_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty)) gallery_img_'
                          +i11+'_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))"><img src="'+imgUrl+
                          '&w=120&h=120&t=0&c=0" alt="" /><input type="text" class="gallery_textbox"'+
                          ' id="desc_gallery_img_@(i1)_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))" />'+
                          '<input type="checkbox" class="gallery_img_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))" id="gallery_img_'+
                          i11+'_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))" /><span for="gallery_img_'+i11+
                          '_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))">מחק</span></div>';
            //var divCont = '<div class="'+getFileInfo(e)+' gallery_div_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty)) gallery_img_'+i11+'_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))"><img src="'+imgUrl+'&w=120&h=120&t=0&c=0" alt="" /></div>';
            $(".gallery_editor_wrap_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))").append(divCont);
            i11 = i11 + 1;
        }
        else if (e.operation == "remove") {
            $('div[class*="'+getFileInfo(e)+'"]').remove();
           
        }
       
      
           
        }


    var PARAM_NAME = "attachments";
    function OnLoad_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))(e) {
        var uploadElement = $("input", this).attr("name", PARAM_NAME);
        setTimeout(function () {
            uploadElement.data("tUpload").name = PARAM_NAME;
        }, 0);
    }

    function getFileInfo(e) {
        return $.map(e.files, function (file) {
            var info = file.name;
            return info;
        }).join(", ");
    }
</script>
@{ Html.Telerik().ScriptRegistrar().OnDocumentReady(@<text>
        $(".gallery_img_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))").live("click", function(){
        var itemid = $(this).attr("id");
        var imgPaht = $("." + itemid + " img").attr("src");
        $.post("/GalleryUser/RemoveFile", { name: "@Model", fullName: imgPaht } )
        .success(function() {
        $("." + itemid).remove();
        });
        return false;
        });
</text>); }

 

these are my action methods..

 

 public ActionResult Save(IEnumerable<HttpPostedFileBase> attachments, string name)
        {
            List<int> GalleryIds = new List<int>();
            SURoleProvider pro = new SURoleProvider();
            string roles= pro.GetRolesForUser(User.Identity.Name).FirstOrDefault();
            if (!SecurityCheck(name) && roles!="Provider") throw new HttpException(401, "error");
            string UserFolder = "~/Content/UserFiles/Users/" + name + "/";
            string UserFolderPath = Server.MapPath(UserFolder);
            CreateUserFolder(UserFolderPath);
            foreach (var file in attachments)
            {
                Random n = new Random();
                var fileName = n.Next(500,10000) + Path.GetFileName(file.FileName);
                GalleryIds.Add(SaveGalleryImageTrack(UserFolder + fileName, name));
                var physicalPath = Path.Combine(UserFolderPath, fileName);
                string[] lastPart = name.Split('/');
                if (lastPart[1].ToString().Contains("CsvFile_"))
                {
                    string[] words = fileName.Split('.');
                    string ext = words[1].ToString();
                    if(ext == "csv" || ext == "vcf")
                    {
                        file.SaveAs(physicalPath);
                    }
                }
                else
                {
                    file.SaveAs(physicalPath);
                }
               
            }
            return Content("");
        }

        public ActionResult Remove(string[] fileNames, string name)
        {
           // if (!SecurityCheck(name)) throw new HttpException(401, "error");
            string UserFolder = "~/Content/UserFiles/Users/" + name + "/"; 
            string UserFolderPath = Server.MapPath(UserFolder);
            CreateUserFolder(UserFolderPath);
            foreach (var fullName in fileNames)
            {
                var fileName = Path.GetFileName(fullName);
                var physicalPath = Path.Combine(UserFolderPath, fileName);
                if (System.IO.File.Exists(physicalPath))
                {
                    System.IO.File.Delete(physicalPath);
                    RemoveFileRecordFromDB(UserFolder + fileName);
                    
                }
            }
            return Content("");
        }

anitha
Top achievements
Rank 1
 asked on 20 Apr 2016
3 answers
310 views
Some of our projects are very long, and our users would like to export just what is viewable on page web page to PDF. So, it would essentially be a narrow sliver of the entire Gantt chart, but every task (row) would be show. For example, show only a Gantt chart for the next 2 months of tasks, instead of the entire project. We thought about just pulling in a subset of tasks, but then we need to handle things like tasks that included in the next 2 months, then changing their start and end dates accordingly. However, we were hoping there was an easier way to set the start and end date of the entire Gantt chart so we can export just the time frame we are focusing on.
Ivan Danchev
Telerik team
 answered on 20 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?