Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
94 views
Hi,
Is it possible to disable or hide sorting items of RadGrid header context menu for specific columns? In the other word, sorting config some of columns set to false, and I want to hide this items in header context menu.  
Pavlina
Telerik team
 answered on 15 Aug 2012
1 answer
59 views
I need to get the value of the selected index or row id and pass it to a base page.

Is there someone who has done this?
Eyup
Telerik team
 answered on 15 Aug 2012
3 answers
67 views
Is there a way to show the month view, but instead of having the first line be the first line of the month, set a different week to be the first week in tihe month view?

For example, if the user selected the date Sept 22nd (or if we auto set it by defaulting to the current date), then the week of Sept 19th would be the first week in the month view, and it would show the next 5 weeks in the month view (spanning into October).

Is this possible?
Ivana
Telerik team
 answered on 15 Aug 2012
4 answers
135 views
Hi all,
I am getting JScript error as "Microsoft JScript runtime error: 'Telerik' is undefined" while running my project.
I have just tried configuring the project  from the menu bar 'Telerik->Rad controls for asp.net ajax->configure project' and it gives me this error.
Please find below my webconfig file.I could find some threads in forum about trouble shooting for the same.But that didn't solve my issue.
I am using .net 4.0 version.Please help me on this.
<?xml version="1.0"?>
<configuration>
    <connectionStrings>
        <add name="xxx" connectionString="Data Source=xxxx;Initial Catalog=xxx;Integrated Security=False; User ID=abc; Password=xxxx;" />     
    </connectionStrings>
    <appSettings>
    <add key="Telerik.Skin" value="Default" />
    <add key="Telerik.ScriptManager.TelerikCdn" value="Enabled" />
    <add key="Telerik.StyleSheetManager.TelerikCdn" value="Enabled" />
         
         
         
    </appSettings>
    <system.web>
        <compilation debug="true" targetFramework="4.0">
            <assemblies>
                <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
                <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
                <add assembly="System.Speech, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /></assemblies></compilation>
        <pages>
            <controls>
                <add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI" />
            </controls>
        </pages>
        <httpHandlers>
            <add path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" validate="false" />
<add path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" validate="false" />
<add path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" validate="false" />
<add path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" validate="false" />
<!--<add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false" />-->
      <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource, Telerik.Web.UI, Version=2012.2.607.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4" verb="*" validate="false" />
      <add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" validate="false" />
        </httpHandlers>
        <httpModules>
            <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" />
            <add name="RadCompression" type="Telerik.Web.UI.RadCompression" />
        </httpModules>
    </system.web>
    <system.webServer>
        <validation validateIntegratedModeConfiguration="false" />
        <modules runAllManagedModulesForAllRequests="true">
            <remove name="RadUploadModule" />
            <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" preCondition="integratedMode" />
            <remove name="RadCompression" />
            <add name="RadCompression" type="Telerik.Web.UI.RadCompression" preCondition="integratedMode" />
        </modules>
        <handlers>
           <remove name="ChartImage_axd" />
<add name="ChartImage_axd" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" preCondition="integratedMode" />
<remove name="Telerik_Web_UI_SpellCheckHandler_axd" />
<add name="Telerik_Web_UI_SpellCheckHandler_axd" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" preCondition="integratedMode" />
<remove name="Telerik_Web_UI_DialogHandler_aspx" />
<add name="Telerik_Web_UI_DialogHandler_aspx" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" preCondition="integratedMode" />
<remove name="Telerik_RadUploadProgressHandler_ashx" />
<add name="Telerik_RadUploadProgressHandler_ashx" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" preCondition="integratedMode" />
<remove name="Telerik_Web_UI_WebResource_axd" />
<!--<add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" preCondition="integratedMode" />-->
      <add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource, Telerik.Web.UI, Version=2012.2.607.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4" />
      <add name="Telerik.Web.UI.WebResource"  path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI, Version=2012.2.607.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4" />
        </handlers>
    </system.webServer>
   
</configuration>
Milena
Telerik team
 answered on 15 Aug 2012
6 answers
207 views
Greetings.

I have a 100% code generated RadGrid.  It's purpose in life is to interrogate and render UI to support a Code-First Entity Framework model.

During entity edits/inserts, I would like to display a RadComboBox with checkboxes (multiselect) for child entities.  For example:

Editing Company X
ComboBox shows 20 potential employees (entire universe of the Employee entity)
Employees can be selected, and the child relationship between Company -> Employee (1 to many) are updated during RadGrid save.

Getting the combobox to appear and populate itself with the list of potential choices is no problem. I'm running into trouble when saving.  I'm trying to use the same approach that I use for other custom templates associated with the grid....


public IOrderedDictionary ExtractValues(Control container)
        {
            OrderedDictionary od = new OrderedDictionary();
            foreach (RadComboBoxItem item in rcb.Items)
            {
                if (item.Checked)
                   {
                    od.Add(name.Singularize(), item.Value); // bind the selected value to the FK Id
                }
            }
            return od;
        }

This fails for a couple reasons.  1) If I select more than one checkbox, I run into an issue trying to add the same key twice.  2) More importantly, even if I only select one item, the RadGrid update process doesn't like what I'm trying to do here (complains that a property named Employee was not found in Company).  This makes sense since Employee is a related collection, and obviously I need to be doing things differently in ExtractValues (or somewhere else).... I'm just not sure what/where.

Thanks!
Mike
Pavlina
Telerik team
 answered on 15 Aug 2012
1 answer
102 views
I am changing the chart series programmatically and the data type is not numeric it is a datetime field. How do I change this value type? here is my code so far:

(it's a switch statement)

case "HOURS":
                                  sdsProjectVideos.SelectCommand = "asGetVideosByProjectIDSortHours";
                                  RadChart1.ChartTitle.TextBlock.Text = "HOURS WATCHED";
                                  sdsProjectChart.SelectCommand = "asGetVideosByProjectIDSortHoursChart";
                                  RadChart1.Series.Clear();
                                  ChartSeries chartSeries = new ChartSeries();
                                  chartSeries.Name = "Hours Watched";
                                  chartSeries.DataYColumn = "HoursWatched";
                                  RadChart1.Series.Add(chartSeries);
                                  lblHours.Font.Underline = true;
                                  break;
Ves
Telerik team
 answered on 15 Aug 2012
5 answers
259 views

I have telerik 2011.3.1305.35 -> Q3.
In a sharepoint 2010 visual webpart I have a RadTreeView control, when some particular menu options are selected I want to open radwindow(s) which has an asp:updatepanel and within which I have another radtree,radgrid,repeator, RadAynscUpload (not all in same window).
Folowing is the code I have for this requirement:
Issues I am facing currently:
1) Every time I click on any of these menu options the page is getting refreshed and then radwindow is getting opened, Can we avoid page refresh and just simple open radwindow?
2) One of these RadWindows has RadAsyncUpload (for multiple file uploads), when I select the files to be uploaded I am getting a javascript error saying 'Syntax error' but I can see the file uploaded to the control then when I click on the Upload button my code says the uploadedfiles count is zero. I know there are web.config changes to be done for radupload is that the same case for RadAsyncUpload, can you please specify those?
I have also tried asp:fileupload (even though its not multiple upload) it is uploading the documents correctly but it is closing the radwindow even though I specified trigger for the button.
Code:



protected
void rtvDocuments_ContextMenuItemClick(object sender, RadTreeViewContextMenuEventArgs e)
        {
  
            RadTreeNode clickedNode = e.Node;
  
            switch (e.MenuItem.Value)
            {
               case "AddDoc":
                    LoadAllGroups(rtvGroupstoAddDocs);
                    RegisterStartupScript(RadWndwUploadDocs.ClientID);
                    break;
                case "AddExistingGroup":
                    LoadAllGroups(rtvAllGroups); //loads all the groups
                    RegisterStartupScript(winGroupBrowse.ClientID);
                    break;
                case "AddExistingDoc":
                    LoadAllDocuments(); //loads all docs in grid
                    RegisterStartupScript(RadWndwAllDocs.ClientID);
                    break;
                //Other Cases here
             }
  
private void RegisterStartupScript(string RadControlId)
        {
            string script = string.Empty;
            script = "function f(){$find(\"" + RadControlId + "\").show(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);";
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", script, true);
        }
  
//If files uploaded and on upload button click, submit the documents to repeator and then upload them to SP document library.
//I tried both the control, when debugging AsyncUpload count is zero and getting "syntax error" on the page
//FileUpload uploads succesfully but closes the radWindow, but I want the window to be showing up, If this is the only solution and if RadAsyncUpload is not helpful for me.
        protected void SubmitButton_Click(object sender, System.EventArgs e)
        {
//If RadAsyncUpload is used.. I want this to be working because of multi uploads requirement.
            if (RadAsyncUpload1.UploadedFiles.Count > 0)
            {
  
                labelNoResults.Visible = false;
                Repeater1.Visible = true;
                Repeater1.DataSource = RadAsyncUpload1.UploadedFiles;
                Repeater1.DataBind();
  
                List<string> lstFileNames = new List<string>();
                foreach (UploadedFile file in RadAsyncUpload1.UploadedFiles)
                {
                    lstFileNames.Add(file.FileName);
  
                }
                //AddedControl ISODocuments to SharePoint document library
                AddDoc(lstFileNames);
  
            }
            else
            {
                labelNoResults.Visible = true;
                Repeater1.Visible = false;
            }
  
//If file upload is used.
 if (FileUpload1.PostedFile != null)
            {
                string siteUrl = SPContext.Current.Site.Url;
                using (SPSite siteColl = new SPSite(siteUrl))
                {
                    //Get SPWeb object representing a particular website
                    using (SPWeb webSite = siteColl.OpenWeb())
                    {
                        try
                        {
                            webSite.AllowUnsafeUpdates = true;
                            webSite.Lists.IncludeRootFolder = true;
                            //Get the document library in which documents will be uploaded
                            SPList docLibrary = webSite.Lists["UpLoadedDocuments"];
                            // objFileUpload is asp.net FileUpload Object
                            Stream FStream; string fname;
                            FStream = FileUpload1.PostedFile.InputStream;
                            int basenamestart = FileUpload1.PostedFile.FileName.LastIndexOf(@"\");
                            fname = FileUpload1.PostedFile.FileName.Substring(basenamestart + 1);
                            //Upload files into SharePoint document library
                            SPFile file = docLibrary.RootFolder.Files.Add(fname, FStream, true);
  
                            file.Update();
                        }
                        catch
                        { }
                    }
                }
            }
  
  
        }
<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"
    Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Register TagPrefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages"
    Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ABC.ascx.cs"
    Inherits="X.Y.Z" %>
<%@ Register Assembly="Telerik.Web.UI, Version=2011.3.1305.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4"
    Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
  
     
   <telerik:RadScriptBlock runat="Server" ID="RadScriptBlock2">
        <script type="text/javascript">
    </script>
         <script type="text/javascript" src="/_layouts/js/MyCustom.js"></script>  
    </telerik:RadScriptBlock>
  
<telerik:RadTreeView ID="rtvDocuments" runat="server" EnableDragAndDrop="True" OnNodeDrop="rtvDocuments_HandleDrop"
        OnClientNodeDropping="onDropping" OnClientNodeDragging="onNodeDragging" MultipleSelect="true"
        EnableDragAndDropBetweenNodes="true" OnNodeExpand="rtvDocuments_NodeExpand" AllowNodeEditing="true"
        OnContextMenuItemClick="rtvDocuments_ContextMenuItemClick" OnNodeEdit="rtvDocuments_NodeEdit">
        <ContextMenus>
            <telerik:RadTreeViewContextMenu CssClass="ctxTreeMenu" ID="cMenuForGroups" runat="server">
                <Items>
                    <telerik:RadMenuItem Value="Rename" Text="Rename ..." Enabled="false" ImageUrl="/_layouts/Img/Outlook/rename.gif"
                        PostBack="false">
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem Value="NewFolder" Text="New Group"  ImageUrl="/_layouts/Img/Outlook/12.gif">
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem Value="AddDoc" Text="Add New Document" ImageUrl="/_layouts/Img/Outlook/journal.gif">
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem Value="Delete" Text="Delete Group" ImageUrl="/_layouts/Img/Outlook/7.gif">
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem IsSeparator="true">
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem Value="Copy" Text="Clone ..." ImageUrl="/_layouts/Img/Outlook/10.gif">
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem Value="AddExistingGroup" Text="Add Existing Group">
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem Value="AddExistingDoc" Text="Add Existing Document">
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem Value="ViewAll" Text="View all Instances of ..." ImageUrl="/_layouts/Img/Outlook/searchFolder.gif">
                    </telerik:RadMenuItem>
                </Items>
                <CollapseAnimation Type="OutBack" />
            </telerik:RadTreeViewContextMenu>
</ContextMenus>
    </telerik:RadTreeView>
  <telerik:RadWindow ID="winGroupBrowse" runat="server"  EnableViewState="false"  Modal="true" Overlay="true" Width="875px" Height="545px"
     EnableShadow="true" DestroyOnClose="true" ShowContentDuringLoad="false" ReloadOnShow="true">
    <ContentTemplate>
           <div id="globalTree" class="globalTreeCont">
                <asp:UpdatePanel ID="pnlTree" Visible="true" runat="server">
                <ContentTemplate>
                    <telerik:RadTreeView CssClass="globalTree" OnNodeExpand="rtvDocuments_NodeExpand"
                        ID="rtvAllGroups" runat="server">
                    </telerik:RadTreeView>
                    </ContentTemplate>
                </asp:UpdatePanel>
    </ContentTemplate>
</telerik:RadWindow>
  <telerik:RadWindow ID="RadWndwAllDocs" runat="server"  EnableViewState="false"  Modal="true" Overlay="true" Width="875px" Height="545px"
     EnableShadow="true" DestroyOnClose="true" ShowContentDuringLoad="false" ReloadOnShow="true">
    <ContentTemplate>
                <asp:UpdatePanel ID="pnlGrid" Visible="true" runat="server">
                  <ContentTemplate>
                    <telerik:RadGrid ID="rgrdAllDocs" runat="server" AutoGenerateColumns="false" AllowFilteringByColumn="true"
                        AllowPaging="true" PageSize="10" AllowSorting="true" Height="100%" Width="100%">
                        <PagerStyle Mode="NextPrevAndNumeric"  />
                        <MasterTableView Height="100%" Width="100%">
                            <Columns>
                                <telerik:GridBoundColumn HeaderText="ID" DataField="ID" />
                                <telerik:GridBoundColumn HeaderText="Title" DataField="Title" />
                                <telerik:GridBoundColumn HeaderText="Description" DataField="Description" />
                                <telerik:GridBoundColumn HeaderText="ISOGroups" DataField="ISOGroupText" />
                            </Columns>
                        </MasterTableView>
                    </telerik:RadGrid>
                      </ContentTemplate>
                </asp:UpdatePanel>
                    </ContentTemplate>
</telerik:RadWindow>
  <telerik:RadWindow ID="RadWndwUploadDocs" runat="server"  EnableViewState="false"  Modal="true" Overlay="true" Width="875px" Height="545px"
     EnableShadow="true" DestroyOnClose="true" ShowContentDuringLoad="false" ReloadOnShow="true">
    <ContentTemplate>
               <asp:UpdatePanel ID="pnlUpload" Visible="true" runat="server" UpdateMode="conditional">
                                           <%-- If file upload is used instead of radAsyncUpload UNCOMMENT the trigger
                                             <Triggers>
                                               <asp:PostBackTrigger ControlID="SubmitButton" />
                                              </Triggers> --%>
                   <ContentTemplate>
                    <div class="grid grid_18 wizardMargin">
                    <div id="uploadCont">
                            <div class="columns">
                                <div class="col1">
                                    <h4>
                                        Groups on Page</h4>
                                    <div class="treeCont">
                             <telerik:RadTreeView CssClass="globalTree" OnNodeExpand="rtvDocuments_NodeExpand"
                        ID="rtvGroupstoAddDocs" runat="server"></telerik:RadTreeView>
                                    </div>
                                </div>
                                <div class="col2">
                                    <h4>
                                        Uploaded Files</h4>
                                    <div class="fileTree">
                                        <asp:Label ID="labelNoResults" runat="server" Visible="True">No uploaded files</asp:Label>
                                        <asp:Repeater runat="server" ID="Repeater1">
                                            <ItemTemplate>
                                                <div class="fileListStyle">
                                                    <%# DataBinder.Eval(Container.DataItem, "FileName").ToString() %>  (<%# DataBinder.Eval(Container.DataItem, "ContentLength").ToString() %>bytes)<br />
                                                </div>
                                            </ItemTemplate>
                                        </asp:Repeater>
                                    </div>
                                </div>
                            </div>
                            <div class="uploadControls">
                                <h4>
                                    Select Files to Upload</h4>
                                <div class="FileDetails">
                                    <table class="uploadTable">
                                        <tbody>
                                            <tr>
                                                <td class="uploader">                                                
                                             <telerik:RadAsyncUpload runat="server" ID="AsyncUpload1" Skin="default">
                                                </telerik:RadAsyncUpload>
                                              
                                             //Tried asp fileupload, it is uploading files to document library and closing the radwindow.I donot want it to close it.
                                          //       <asp:FileUpload ID="FileUpload1" runat="server"  />
                                                    <asp:Button runat="server" ID="SubmitButton" Text="Upload files" OnClick="SubmitButton_Click" />  
                                           
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                         </div>
                   </ContentTemplate>
                </asp:UpdatePanel>
      </ContentTemplate>
   </telerik:RadWindow>

Any help is appreciated.

Plamen
Telerik team
 answered on 15 Aug 2012
1 answer
82 views
Hi,

I have an issue.
Can we hide the december month from thse.
see the attache image and code

here we setting the MultiViewRows based on  a calculation.

some times the fourth month data(available date) will be none and user cannot view the foirth month

is this possible..in schduler_PreRender event?

please reply me urg

 

 

protected void schduler_PreRender(object sender, EventArgs e)

 

{

 

RadCalendar popupCalendar = schduler.FindControl("SelectedDateCalendar") as RadCalendar;

 

popupCalendar.ShowOtherMonthsDays =

false;

 

popupCalendar.AutoPostBack =

true;

 

 

int count = GetMonthCount(lst.ToArray(), popupCalendar.SelectedDate).Count;

 

popupCalendar.MultiViewColumns = 2;

double _val = (double)count;

 

popupCalendar.MultiViewRows = (

int)Math.Round(_val/2);

 

 

 

 

 

popupCalendar.FocusedDate = lst[0];

popupCalendar.DayRender +=

new Telerik.Web.UI.Calendar.DayRenderEventHandler(popupCalendar_DayRender);

 

}

 

Maria Ilieva
Telerik team
 answered on 15 Aug 2012
11 answers
362 views
I did the same as on demo example. But I have no more place in header to display all filters. How I can put Date ranges one below the other?
berto
Top achievements
Rank 1
 answered on 15 Aug 2012
3 answers
205 views
Hello,

I am using "telerik reporting q1 2012". I am using Telerik.Reporting.Table and dynamically try to hide them. But it leave space when export to pdf. I have also try to put it in Panel. But the same issue. Please help me on this.

Regards,
Kunal
IvanY
Telerik team
 answered on 15 Aug 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?