Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
99 views
Hi,

I need to create a graph using Telerik component.
The graph should be divided into two parts.
Above zero should have a bar graph and below zero it should have a timeline graph for each user.
So for each user there should be a line below zero to show his data.

Is it possible to do it with Telerik chart component. If yes then how.
Also it should have zoom in -out functionality and multiple browser.

Tsvetie
Telerik team
 answered on 30 Apr 2013
1 answer
253 views
Hi.

I am currently trying to build a schedule for a university.  The premise is that I will be able to display all the events (lectures, practials etc) for the modules in a degree.  I need to find a way of showing that appointments overlap.  I do not need to fix the overlaps or even prevent them.  I just want to, for example, change the colour of the event if it overlaps with another one.  I have been looking on the forums but can only find information on preventing overlaps.  Could someone provide guidance on this.  Note I am a coding novice using VB. 

Thanks you in advance
Kate
Telerik team
 answered on 30 Apr 2013
0 answers
261 views
I have a RadGrid that has columns programatically added to it during PageLoad. For my webpage, there will always be at least one column with an empty width (HeaderStyle.Width = Unit.Empty), with the rest of the columns using specific pixel widths. All columns are resizable. (In my app, we are retrieving and saving these widths in the database) The grid is scrollable, so if they extend past the limits of the grid, the user can scroll without the grid itself being resized.

The problem I'm having is that when the user resizes the browser window, at a certain width the blank column(s) will eventually get reduced to 0 width (as they are taking up the "leftover" space. Is there any approach that will allow me to limit this auto-resizing to 100px, so that the column is guaranteed to be visible?

At least one column has to be of null OR percentage width, or else the RadGrid will default all columns to a percentage width, thus nullifying my specific pixel width designations.

An approach I've tried is to add a blank column that fills in the rest of the space, as it wouldn't matter if it was 0 width. However, this causes problems when resizing the other columns. In this case, the blank column should be "consumed" until it is zero width, and then start extending the grid size (or add a scroll bar in this case). Instead, it simply gets pushed to the side, maintaining its width. I don't know if this approach is feasible or not, but I've left it in the code, simply uncomment it to play around with it.

ASPX:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AA_TEST.aspx.cs" Inherits="Records.AA_TEST" %>
 
 
<body id="body" runat="server">
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />  
        <telerik:RadGrid ID="RecordGrid" runat="server" Width="99%" BorderWidth="1px" AutoGenerateColumns="false"
            AllowPaging="true" AllowCustomPaging="true" PageSize="20" AllowSorting="true" AllowFilteringByColumn="false"
            HeaderStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left" HeaderStyle-VerticalAlign="Top"
            ItemStyle-HorizontalAlign="Left" AlternatingItemStyle-HorizontalAlign="Left"
            ItemStyle-VerticalAlign="Top" AlternatingItemStyle-VerticalAlign="Top"
            OnNeedDataSource="RecordGrid_NeedDataSource" OnItemDataBound="RecordGrid_ItemDataBound" >
            <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true" Position="Bottom" />
            <MasterTableView AutoGenerateColumns="false" CommandItemDisplay="None" TableLayout="Fixed"
                EnableHeaderContextMenu="false" AllowCustomSorting="true" AllowMultiColumnSorting="true"
                Width="100%">
            </MasterTableView>
            <ClientSettings AllowColumnsReorder="True" ColumnsReorderMethod="Reorder" ReorderColumnsOnClient="True" ClientMessages-DragToGroupOrReorder="">
                <ClientEvents OnColumnResized="columnResized" />
                <Resizing EnableRealTimeResize="true" AllowColumnResize="true" ClipCellContentOnResize="true" ResizeGridOnColumnResize="true"/>
                <Scrolling AllowScroll="true" SaveScrollPosition="true" UseStaticHeaders="true" />
            </ClientSettings>
            <SortingSettings SortToolTip="" SortedAscToolTip="" SortedDescToolTip="" />
            <GroupingSettings CaseSensitive="false" />
        </telerik:RadGrid>
 
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" >
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RecordGrid">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RecordGrid" LoadingPanelID="RadAjaxLoadingPanel1" UpdatePanelRenderMode="Inline" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
 
        <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
        <script type="text/javascript">
            //<![CDATA[
            function columnResized(sender, eventArgs) {
                var masterTableView = sender.get_masterTableView();
                var uniqueName = eventArgs.get_gridColumn().get_uniqueName();
                if (!(uniqueName == "DeleteButton")) {
                    var deleteColumn = masterTableView.getColumnByUniqueName("DeleteButton");
                    if (deleteColumn != null) {
                        var deleteColumnIndex = deleteColumn.get_element().cellIndex;
                        deleteColumn.set_resizable(true);
                        masterTableView.resizeColumn(deleteColumnIndex, 30);
                        deleteColumn.set_resizable(false);
                    }
                }
            }
            //]]>
        </script>
        </telerik:RadScriptBlock
    </form>
</body>

ASPX.CS:
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;
 
namespace Records
{
    public partial class AA_TEST : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            InitRecordGrid();
        }
 
        protected void InitRecordGrid()
        {
            if (!IsPostBack)
            {
                GridBoundColumn firstNameColumn = new GridBoundColumn();
                firstNameColumn.UniqueName = "FirstName";
                firstNameColumn.DataField = "FirstName";
                firstNameColumn.DataType = typeof(System.String);
                firstNameColumn.HeaderText = "First Name";
                firstNameColumn.Resizable = true;
                firstNameColumn.Reorderable = true;
                firstNameColumn.HeaderStyle.Width = Unit.Pixel(250);
                RecordGrid.Columns.Add(firstNameColumn);
 
                GridBoundColumn lastNameColumn = new GridBoundColumn();
                lastNameColumn.UniqueName = "LastName";
                lastNameColumn.DataField = "LastName";
                lastNameColumn.DataType = typeof(System.String);
                lastNameColumn.HeaderText = "Last Name";
                lastNameColumn.Resizable = true;
                lastNameColumn.Reorderable = true;
                lastNameColumn.HeaderStyle.Width = Unit.Empty;
                //lastNameColumn.HeaderStyle.Width = Unit.Pixel(250);
                RecordGrid.Columns.Add(lastNameColumn);
 
                /*
                GridButtonColumn blankColumn = new GridButtonColumn();
                blankColumn.UniqueName = "blank";
                blankColumn.Resizable = false;
                blankColumn.Reorderable = false;
                blankColumn.HeaderStyle.Width = Unit.Empty;
                RecordGrid.Columns.Add(blankColumn);
                */
 
                GridButtonColumn deleteColumn = new GridButtonColumn();
                deleteColumn.UniqueName = "DeleteButton";
                deleteColumn.HeaderStyle.Width = Unit.Pixel(30);
                deleteColumn.ButtonType = GridButtonColumnType.ImageButton;
                deleteColumn.ImageUrl = "/images/Delete.gif";
                deleteColumn.ItemStyle.CssClass = "delete";
                deleteColumn.CommandName = "Delete";
                deleteColumn.Resizable = false;
                deleteColumn.Reorderable = false;
                RecordGrid.Columns.Add(deleteColumn);
            }
        }
 
        protected void RecordGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            List<NameRow> nameRows = new List<NameRow>();
             
            // Filler data
            nameRows.Add(new NameRow("Tyrion", "Lannister"));
            nameRows.Add(new NameRow("Jaime", "Lannister"));
            nameRows.Add(new NameRow("Daenerys", "Targeryen"));
            nameRows.Add(new NameRow("Jon", "Snow"));
            nameRows.Add(new NameRow("Robb", "Stark"));
            nameRows.Add(new NameRow("Benjamin", "Stark"));
            nameRows.Add(new NameRow("Khal", "Drogo"));
 
            RecordGrid.DataSource = nameRows;
        }
 
        protected void RecordGrid_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                GridDataItem item = e.Item as GridDataItem;
                NameRow user = item.DataItem as NameRow;
 
                item["FirstName"].Text = user.FirstName;
                item["LastName"].Text = user.LastName;
            }
        }
 
        public class NameRow
        {
            public string FirstName = "";
            public string LastName = "";
 
            public NameRow(string first, string last)
            {
                FirstName = first;
                LastName = last;
            }
        }
    }
}
Nathan
Top achievements
Rank 1
 asked on 30 Apr 2013
4 answers
198 views
I'm in IE8 and I'm opening a modal dialogue from codebehind, afterwards I'm running a function.

String ScriptInput = String.Format("window.showModalDialog(\"" + NavigateUrl + "\", \"\", \"dialogHeight:500px;dialogWidth:845px;resizable:yes;status:no;unadorned:no;edge:raised\"); RefreshGrid()");  
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "newWindow", ScriptInput, true);

When I have this

function RefreshGrid(){
          alert("The Grid Will Refresh At This Point");
}

The alert pops up as soon as I close the modal dialogue.   Perfect so far.  I have a Radgrid on the parent page:
<telerik:RadGrid ID="rgSupplementalAllocation"

And when I attempt to do this:
function RefreshGrid() {
                var RadGrid = $get("<%= rgSupplementalAllocation.ClientID %>");
                var MasterTableView = RadGrid.get_masterTableView();
                MasterTableView.rebind();
            }

-I get the Microsoft JScript runtime error: Object doesn't support this property or method in reference when I'm calling get_masterTableView from the RadGrid object.

When I try this:
function RefreshGrid() {
                var RadGrid = $find("<%= rgSupplementalAllocation.ClientID %>");
                var MasterTableView = RadGrid.get_masterTableView();
                MasterTableView.rebind();
            

-I get Microsoft JScript runtime error: 'null' is null or not an object in reference to the RadGrid object.

The page uses RadAJAXManager, and I've tried turning it off and on.  I've also looked at the dynamic page and found the div id that the script was parsed to look for as plain as day. 

I merely want to find the RadGrid client object so I can call a rebind.



Danny
Top achievements
Rank 2
 answered on 30 Apr 2013
4 answers
117 views

Hi,

 

I use a radgrid and add the attributes skin="MyRadGridSkin" and EnableEmbeddedSkins="false" to use a custom style.

Everything works fine except two points :

 

1- Now, a WebResource.axd (which contains the default style) is loaded BEFORE my custom style and override some of my modifications. With the word « !important Â» i managed to have what i wanted.

Is it possible to load this WebResource after my style and how ?

 

2- I didn’t override the style of the radcombobox. When used alone, the skin is ok. But the combobox used for the page size is weird :



When i look with firebug, it tells me that it seeks for my custom style.

Why, in some cases, the WebResource overrides my style and why, in this case, it doesn’t ?

Do i have to write a style only for that combobox ?

 

Thanks

Bob
Top achievements
Rank 1
 answered on 30 Apr 2013
1 answer
112 views
Hello
I'd like to know if it's possible for me to have my own form in a RadWindow and upon New Appointment / Edit Appointment, my own RadWindow pops up instead. That way, I can have my own buttons, my own validation, my own properties easily. As I'm new to Scheduler, it'll be of great help if any kind souls could point me in the right direction.

Thank you in advance.
Kate
Telerik team
 answered on 30 Apr 2013
2 answers
92 views
Hi;

I have a question that seems to have been lost. If possible could someone please answer:

thanks - dave
David Thielen
Top achievements
Rank 1
 answered on 30 Apr 2013
1 answer
72 views
Hi,

How to get the search text in code behind in Onsearch event?

Thanks,
Freddy
Princy
Top achievements
Rank 2
 answered on 30 Apr 2013
1 answer
82 views
Hi;

Do you have a sample that does a search & replace as a custom dialog for your editor? If I have that code then I think I can implement what we need as that would show me both how to query the editor for text and to change text in the editor.

And I need to do it by creating my own ASP.NET controls that talk to the editor as we need to keep our part separate from the editor as we intend in the future to write a more powerful editor (handling tabs, margins, page breaks, etc.)

It's fine if all of our controls use your ASP.NET controls (that is our plan). What's key is to keep a simple interface between the editor and all of our controls so we can change the editor our controls talk to. So we would prefer that we have a way to provide asynchronous communication via JavaScript between our ASP.NET app and your editor.

thanks - dave
Niko
Telerik team
 answered on 30 Apr 2013
1 answer
62 views
http://demos.telerik.com/aspnet-ajax/grid/examples/programming/listview/defaultcs.aspx

We are trying to implement this radgrid with the templated boxes. When we attempt to drag and drop a single record, the entire row gets dragged. We only want to drag one record at a time. Could you please let us know what in this sample needs to be adjust to allow the dragging and dropping of individual boxes?

Thanks!
Kostadin
Telerik team
 answered on 30 Apr 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?