Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
86 views
I am wondering how I would go about turning off the automatic orientation for the combobox. I am running into an issue where the dropdown is going up and underneath my menu.
Alexander
Top achievements
Rank 1
 answered on 02 Oct 2014
2 answers
398 views
Hi,

I am trying to update a read-only GridDateTimeColumn field in a Rad Grid while the item is being edited. The computation to do the update is to calculate the calendar date based off the Julian date in a RadNumeric TextBox. I am able to get the two controls client ID's by using the following code server-side on the Item Created event:

RadNumericTextBox rnumtxt1 = item.FindControl("gtbJulianDate") as RadNumericTextBox;
RadDatePicker picker = (RadDatePicker)item["GroundDate"].Controls[0] as RadDatePicker;

rnumtxt1.Attributes.Add("onBlur", "return updateGround('" + rnumtxt1.ClientID + "','" + picker.ClientID + "')");

The javascript function finds the RadNumeric TextBox just fine and can perform the computation, but when I set the picker field on the client-side, it always ends up being null. I use the following code to set the variables:

var julianTxtBox = $find(txt1);    
var groundDate = $find(txt2);

Can you please help by letting me know why that is not working or if there are any other ways to access that field and set it on the client?

Thanks,

Joe
Joe
Top achievements
Rank 1
 answered on 02 Oct 2014
12 answers
1.3K+ views
I want to change some behaviour in the the expand column of a RadGrid. I don't seem to have any control over the column even though I am adding code that seems like it should provide control. For instance I add this line in my .aspx page :
<ExpandCollapseColumn Visible="false"></ExpandCollapseColumn>
It doesn't matter if I choose True or False, the column is still there. 
I change the button type or any of the options I get in intellisense but the grid renders the same.
I want to add a header to the column for my users since they don't seem to comprehend what the arrow is for
without instructions. I'm posting what I think is the relevant markup in case I did something wrong here.
Thanks for any help.
<telerik:RadGrid    ID="RadGrid1" 
                       EnableAJAX="True" 
                       DataSourceID="sdsRefrigerantCylinders"
                       runat="server" 
                       Width="100%" 
                       AutoGenerateColumns="False" 
                       PageSize="20" 
                       AllowSorting="True"
                       Skin="Outlook" 
                       AllowPaging="True" 
                       AllowAutomaticUpdates="True" 
                       AllowAutomaticInserts="True"
                       ShowStatusBar="True"
                       GridLines="None">
       <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
         
   <MasterTableView    DataSourceID="sdsRefrigerantCylinders" 
                       CommandItemDisplay="top"
                       CommandItemSettings-AddNewRecordText="Insert New Cylinder"
                       DataKeyNames="CylinderID,SiteID" 
                       AllowMultiColumnSorting="true" 
                       AllowAutomaticUpdates="true" 
                       AllowAutomaticInserts="true"
                       Name="Cylinders"
  <ExpandCollapseColumn Visible="True" ButtonType="PushButton" ItemStyle-BackColor="red">
           </ExpandCollapseColumn>
           
 <Columns
               <telerik:GridEditCommandColumn HeaderStyle-Width="50px"  EditText="Edit Cylinder" >
                   <HeaderStyle Width="50px"></HeaderStyle>
               </telerik:GridEditCommandColumn>
                 
               <telerik:GridTemplateColumn UniqueName="CylinderID" HeaderText="Cylinder ID" SortExpression="CylinderID" DataField="CylinderID"
                   ItemStyle-Width="50px" HeaderStyle-Width="50px">
                   <ItemTemplate>
                       <asp:Label ID="lblCylinderID" runat="server" Text='<%# Eval("CylinderId") %>'></asp:Label>
               </ItemTemplate>
               
                   <HeaderStyle Width="50px"></HeaderStyle>
                   <ItemStyle Width="50px"></ItemStyle>
               </telerik:GridTemplateColumn>
                 
               <telerik:GridTemplateColumn UniqueName="CylinderSerNo" HeaderText="Serial No" SortExpression="CylinderSerialNO"  HeaderStyle-Wrap="true"
                   ItemStyle-Width="75px" HeaderStyle-Width="70px">
                   <ItemTemplate>
                       <asp:Label ID="lblSerNo" runat="server"  Text='<%# Eval("CylinderSerialNO") %>'></asp:Label>
                   </ItemTemplate>
                   <EditItemTemplate>
                       <telerik:RadTextBox ID="rtbSerNo" runat="server" Text='<%# Bind("CylinderSerialNo") %>'>
                       </telerik:RadTextBox>
                   </EditItemTemplate>
                   <HeaderStyle Width="75px"></HeaderStyle>
                   <ItemStyle Width="75px"></ItemStyle>
               </telerik:GridTemplateColumn>
Maria Ilieva
Telerik team
 answered on 02 Oct 2014
10 answers
228 views
Hi,

I tried your Diagram  control and using StartCap="FilledCircle" EndCap="ArrowEnd". For some reason,  FilledCircle and ArrowEnd doesn't show up on the diagram. Wondering where I did wrong and  following is my code:

<telerik:RadDiagram ID="theDiagram" runat="server" Width="1050" Height="600">
          <ShapesCollection>
            <telerik:DiagramShape Id="DiagramShape1" Width="100" Height="70" X="260" Y="100"
              Type="rectangle" Background="#25a0da">
              <ContentSettings Text="Parent" />
            </telerik:DiagramShape>
            <telerik:DiagramShape Id="DiagramShape2" Width="120" Height="50" X="60" Y="250" Type="circle"
              Background="#FFBE33">
              <ContentSettings Text="Child 1" />
            </telerik:DiagramShape>
            <telerik:DiagramShape Id="DiagramShape3" Width="120" Height="50" X="245" Y="250"
              Type="circle" Background="#FFBE33">
              <ContentSettings Text="Child 2" />
            </telerik:DiagramShape>
            <telerik:DiagramShape Id="DiagramShape4" Width="120" Height="50" X="440" Y="250"
              Type="circle" Background="#FFBE33">
              <ContentSettings Text="Child 3" />
            </telerik:DiagramShape>
          </ShapesCollection>
          <ConnectionsCollection>
            <telerik:DiagramConnection StartCap="None" EndCap="ArrowEnd">
              <FromSettings Connector="Bottom" ShapeId="DiagramShape1" />
              <ToSettings Connector="Top" ShapeId="DiagramShape2" />
            </telerik:DiagramConnection>
            <telerik:DiagramConnection StartCap="FilledCircle" EndCap="ArrowEnd">
              <FromSettings Connector="Bottom" ShapeId="DiagramShape1" />
              <ToSettings Connector="Top" ShapeId="DiagramShape3" />
            </telerik:DiagramConnection>
            <telerik:DiagramConnection StartCap="FilledCircle" EndCap="ArrowEnd">
              <FromSettings Connector="Bottom" ShapeId="DiagramShape1" />
              <ToSettings Connector="Top" ShapeId="DiagramShape4" />
            </telerik:DiagramConnection>
          </ConnectionsCollection>
        </telerik:RadDiagram>
Slav
Telerik team
 answered on 02 Oct 2014
7 answers
629 views

hi

after upload a file and save it, when i refresh page with browser refresh button, this error showing:

System.IO.FileNotFoundException: Could not find file 'G:\Project\realpanacea\banners\temp\s0jenl45.iw4'.

is this a bug?

How I can fix it?

Genady Sergeev
Telerik team
 answered on 02 Oct 2014
3 answers
350 views
I know there's some old references to this out in the forums but so far I haven't found anything fixes.

I've set a batch of boxes to Resize="Both" and now, if I do a mouseover, the box shrinks slightly.  (I've been testing in Chrome and Firefox.)

Suggestions?  

Pavlina
Telerik team
 answered on 02 Oct 2014
4 answers
1.8K+ views
Hi

I have a Parent Page A  (which is using a Master Page in which there is my RadAjaxmanager, RadScriptmanager) with a User Control. In this User Control I am loading an aspx Page B using JQuery in a hidden DIV . I have some ajaxified TAB controls which is broken after i load the content of the page in the hidden div. The error I got was "Uncaught TypeError: Cannot set property 'value' of undefined"

I was able to isolate the faulty code and it seems that because Page B being loaded contains it's own RadAjaxManager and RadScriptManager... I believe i read somewhere that I need to have only one instance of those ... So my question is, how can I fix this problem since Page B is independent from Page A and that Page B has a Grid Control and a bunch of Telerik Controls which needs both the RadAjaxManager and RadScriptManager ?

Page A with a User Control which has the following code (Javascript to load the hidden div)
#wndShoppingList
{
    display: none;
    clear: both;
    position: relative;
    top: -1px;
    left: 14px;
    border-width: 3px;
    border-color: #2c72a0;
    border-style: solid;
    text-align: left;
    min-height: 400px;
    background-color: White;
    z-index:10;
}
 
<div class="slControlLabel">
    <asp:Label ID="lblShoppingList" CssClass="lblShoppingList" runat="server">Master Shopping List</asp:Label>
</div>
<div class="slControlSeparator">
    <img alt="" src="../Images/pxlGray.gif" style="width: 1px; height: 29px" />
</div>
<div class="slControlDropDown">
    <img alt="DropDown" src="../Images/btDropDownCharcoal.gif" style="width: 23px; height: 29px" />
</div>
<div id="wndShoppingList">
This is hidden using the CSS Above... and preloaded with ManageShoppingLists.aspx in JQuery below.
</div>
 
 
System.Text.StringBuilder sb = new System.Text.StringBuilder();
 
sb.AppendLine(@"<script type=""text/javascript"">");
sb.AppendLine(@"window.$ = $telerik.$;");
sb.AppendLine(@"$(document).ready(function () {");
sb.AppendLine(@"$.ajaxSetup({ cache: false }); ");
// Dynamic Loading of content
sb.AppendLine(@"    var slContent = $('#wndShoppingList');  ");
sb.AppendLine(@"    slContent.load('ManageShoppingLists.aspx');  ");
 
// Add Click Function on the image to Show the wndShoppingList
sb.AppendLine(@"$('.slControlLabel, .slControlDropDown').bind('click',function(event){");
sb.AppendLine(@"    $('#wndShoppingList').show(); ");
sb.AppendLine(@"    event.stopPropagation(); ");
sb.AppendLine(@"});");
 
// Binding Close wndShoppingList when clicking outside the DIV
sb.AppendLine(@"// OnClick Event outside the wndShoppinglist.");
sb.AppendLine(@"$('body').click(function(event){ ");
sb.AppendLine(@"    if(event.target.id != 'wndShoppingList'){ ");
sb.AppendLine(@"        $('#wndShoppingList').hide(); ");
sb.AppendLine(@"    } ");
sb.AppendLine(@"});");
 
 
sb.AppendLine(@"});");
sb.AppendLine(@"</script>");
 
ScriptManager.RegisterStartupScript(this, this.GetType(), "slScript",sb.ToString(), false);



Page B
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ManageShoppingLists.aspx.cs"
    Inherits="GrocerMania.ApplicationLayer.Pages.ManageShoppingLists" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="ScriptManager" runat="server"></telerik:RadScriptManager>
    <telerik:RadAjaxManager ID="AjaxManager" runat="server">
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default" InitialDelayTime="3000" MinDisplayTime="3000">
    </telerik:RadAjaxLoadingPanel>
    <div class="tableContainer">
        <div class="header">
            <div class="slHeaderLeft">
                Select a Saved Shopping List
            </div>
            <div class="slHeaderRight">
                <telerik:RadButton ID="btClose" runat="server" OnClientClicking="function(){$telerik.$(this).hide();}" Width="18" Height="20">
                    <Image ImageUrl="../Images/icoDeleteGrayX.gif" />
                </telerik:RadButton>
            </div>
        </div>
        <div class="details">
            <div class="gridDescription">
                Select a saved Shopping List to open. The list you already have open will be automatically
                saved
            </div>
            <div class="gridContainer">
                <telerik:RadAjaxPanel ID="pnlTemplateList" runat="server">
                    <telerik:RadGrid ID="grdTemplateList" runat="server" AutoGenerateColumns="False"
                        CellSpacing="0" GridLines="None" ShowHeader="False" OnItemCommand="grdTemplateList_OnItemCommand"
                        OnItemCreated="grdTemplateList_ItemCreated" Height="300px">
                        <MasterTableView DataKeyNames="Id">
                            <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
                            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                            </RowIndicatorColumn>
                            <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                            </ExpandCollapseColumn>
                            <Columns>
                                <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="SelectList" CommandArgument="Id"
                                    FilterControlAltText="Filter SelectColumn column" ImageUrl="../Images/btSelectCharcoal.gif"
                                    UniqueName="SelectColumn">
                                </telerik:GridButtonColumn>
                                <telerik:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column" UniqueName="TemplateColumn">
                                    <ItemTemplate>
                                        <asp:Label ID="lblTemplateName" runat="server"> <%# DataBinder.Eval(Container.DataItem, "Description") %></asp:Label><br />
                                        <asp:Label ID="lblLastUpdated" runat="server"> <%# DataBinder.Eval(Container.DataItem, "LastUpdated") %></asp:Label>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridBoundColumn FilterControlAltText="Filter ItemsColumn column" UniqueName="ItemsColumn"
                                    DataField="ItemsInList">
                                </telerik:GridBoundColumn>
                                <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="DeleteList" CommandArgument="Id"
                                    ConfirmText="Are you sure you want to delete this list ?" ConfirmTitle="Delete List"
                                    FilterControlAltText="Filter DeleteColumn column" ImageUrl="..\Images\icoDeleteRedX.gif"
                                    UniqueName="DeleteColumn">
                                </telerik:GridButtonColumn>
                            </Columns>
                            <EditFormSettings>
                                <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                </EditColumn>
                            </EditFormSettings>
                        </MasterTableView>
                        <FilterMenu EnableImageSprites="False">
                        </FilterMenu>
                        <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
                        </HeaderContextMenu>
                    </telerik:RadGrid>
                </telerik:RadAjaxPanel>
                <asp:Label ID="lblNoTemplateList" runat="server" Visible="false">There are currently no Template list available.</asp:Label>
            </div>
        </div>
        <div id="divDeletedItems" runat="server" visible="false">
            <asp:HyperLink ID="lnkDeletedItems" runat="server" NavigateUrl="#"></asp:HyperLink><br />
            Click to view or restore deleted lists.<br /></div>
    </div>
    </form>
</body>
</html>




Hristo Valyavicharski
Telerik team
 answered on 02 Oct 2014
6 answers
238 views

 

 

Hi
I have a radsplitter and I am trying to collapse it on a button click. OnClientClick of the button, I have this method called.
function OnCollapse()
{var
splitter = "<%= RadSplitter1.ClientID %>";
var pane = "<%= radPaneAdminLeftMenu.ClientID %>"
pane.Collapse();
return false;
}
It says pane.Collapse() is not supported.

Microsoft JScript runtime error: Object doesn't support this property or method

Please advice.
Thanks.

 

Vessy
Telerik team
 answered on 02 Oct 2014
1 answer
290 views
Hello,

I'm new to Telerik and we are evaluating the tool sets, and so far I like what I see, but I am currently stuck on a problem with the treeview.

The goal, is to have a tree view that is comprised of folders and of reports, and when the user drags the report into the viewer, it loads (right now it's off a button click).

I have the hierarchy working, but I don't think I'm currently doing this correctly. Namely, I haven't figured out how to identify if a RadTreeNode is a Folder, or a Report, which is causing some issues. Secondly, I'm trying to set it where the folders, use the image Icons we have in the project (which I've been able to do) but because I can't 100% tell if it's a report or a folder, the only way I can set it is via if the node has no children, which won't always be the case.

I've got a lot of work to do in cleaning this up, so I figured I'd post this question and hopefully get some direction. I've been reading the documentation and it has helped me get this far, so I'll go ahead and post my code:

Thanks,

Here is my TreeView

<telerik:RadTreeView ID="reportsTree" Runat="server" EnableDragAndDrop="True" EnableDragAndDropBetweenNodes="True" Height="100%" RenderMode="Auto" Skin="Outlook" BorderStyle="Solid" BorderWidth="2px" OnNodeDrop="reportsTree_NodeDrop">
                    </telerik:RadTreeView>
                    <telerik:RadContextMenu ID="treeMenu" Runat="server" Skin="Office2010Blue" OnItemClick="treeMenu_ItemClick">
                        <Targets>
                            <telerik:ContextMenuControlTarget ControlID="reportsTree" />
                        </Targets>
                        <Items>
                            <telerik:RadMenuItem runat="server" Text="Create Folder">
                            </telerik:RadMenuItem>
                            <telerik:RadMenuItem runat="server" Text="Delete Folder">
                            </telerik:RadMenuItem>
                        </Items>
                    </telerik:RadContextMenu>

I have a context menu, that I need to hook up to some events, and will do that later.

Here is the code behind that populates the TreeView

private void CreateTreeView()
        {
            // Get the list of folders
            List<Report_Folders> _folders = new List<Report_Folders>();
            _folders = rm.Report_Folders.Where(x => x.isUserFolder == false && x.isPublished == true).ToList();

            List<Report_Folders> _myFolders = new List<Report_Folders>();
            _myFolders = rm.Report_Folders.Where(x => x.isUserFolder == true && x.isPublished == true && x.UserID == myProfile.Id).ToList();

            // Get the list of reports
            List<Report> _reports = new List<Report>();
            _reports = rm.Reports.Where(x => x.OwnerID == 0 && x.isPublished == true).ToList();

            List<Report> _myReports = new List<Report>();
            _myReports = rm.Reports.Where(x => x.OwnerID == myProfile.Id && x.isPublished == true).ToList();

            List<TreeViewItem> treeNotes = new List<TreeViewItem>();

            //foreach (Report_Folders item in _folders.Where(x => x.ParentID == null && x.isPublished == true))
            //{
            //    treeNotes.Add(new TreeViewItem(item.FolderName, item.FolderID, item.ParentID, _folders, _reports));
            //}

            foreach (Report_Folders item in _folders)
            {
                treeNotes.Add(new TreeViewItem(item.FolderName, item.FolderID, item.ParentID, true, null));
            }

            foreach (Report_Folders item in _myFolders)
            {
                treeNotes.Add(new TreeViewItem(item.FolderName, item.FolderID, item.ParentID, true, null));
            }

            foreach (Report item in _reports)
            {
                treeNotes.Add(new TreeViewItem(item.ReportName, item.ReportID, item.FolderID, false, item));
            }

            foreach (Report item in _myReports)
            {
                treeNotes.Add(new TreeViewItem(item.ReportName, item.ReportID, item.FolderID, false, item));
            }

            reportsTree.DataFieldID = "ValueID";
            reportsTree.DataValueField = "ValueID";
            reportsTree.DataTextField = "ValueName";
            reportsTree.DataFieldParentID = "ParentID";
            //reportsTree.data
            reportsTree.DataMember = "TreeViewItem";
            reportsTree.DataSource = treeNotes;

            ddlFolders.DataSource = treeNotes.Where(x => x.isFolder == true);
            ddlFolders.DataTextField = "ValueName";
            ddlFolders.DataValueField = "ValueID";
            ddlFolders.DataBind();

            reportsTree.DataBind();

            foreach (RadTreeNode item in reportsTree.Nodes)
            {
                foreach (RadTreeNode sub in item.Nodes)
                {
                    sub.ImageUrl = "~/Content/Images/SmallImages/folder.png";
                    sub.ExpandedImageUrl = "~/Content/Images/SmallImages/open.png";
                }

                item.ImageUrl = "~/Content/Images/SmallImages/folder.png";
                item.ExpandedImageUrl = "~/Content/Images/SmallImages/open.png";
            }

            reportsTree.ExpandAllNodes();
        }

As you can see, I have a collection of TreeViewItem which I populate from the Reports_Folders table, and the Reports table. It has properties like this:

public TreeViewItem(string Name, int ID, int? _pID, bool _isThisfolder, Report _reportValue)
        {
            this.ValueId = ID;
            this.ValueName = Name;
            this.ParentID = _pID;
            this.isFolder = _isThisfolder;
            this.SelectedReport = _reportValue;
        }

I would like to set it's image properties, but for the time being, I don't know if I'm doing this correctly, or if there is a better way to go about setting up this tree view the way that I want it to be handled. 

The main issue right now, is that I can't seem to get TreeViewItem from the selected node in the treeview, so I'm a bit confused. 

If you can help point me in the right direction that would be fantastic. I've been reading the documentation over on http://www.telerik.com/help/aspnet-ajax/treeview-data-binding-hierarchical.html but am still not 100% there.
Hristo Valyavicharski
Telerik team
 answered on 02 Oct 2014
3 answers
141 views
Contrary to what I mentioned in this thread...

http://www.telerik.com/forums/missing-dropdown-scrollbar#VJvAA0Py9kitURlSmCO7iw

It would appear that the Dropdownlist control suffers from the same issue of not displaying scrollbars and calculating its height from available screen space (a la radcomobox) without explicitly setting a DropDownHeight property. Why is this so? It doesn't make any sense.
Marin Bratanov
Telerik team
 answered on 02 Oct 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?