Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
138 views
Hi,

I have quite a few questions re the Gantt control.  Apologies for grouping into one post but I don't want to create a ton of individual messages.

1) The Add Task button.  I have hidden the bottom command bar with the style below, is this the best current way to hide it and in the future could the command bars be toggled via a tag.
    
.rgtToolbar.rgtFooter { display:none !important; }

2) Export to PDF.  When exporting the Gantt chart the buttons are included as if it was a screen shot.  Is there a way to stop that?  Maybe disable the button before PDF generation and re-enable afterwards.

3) Ajax.  I use a custom icon for teh Ajax control.  Works fine on normal controls but the Gantt control seems to revert back to the skin based CSS.  I've looked at the source and nothing stands out as being the reason for the issue.  Any suggestions?

div.RadAjax_Black .raDiv { background-image: url(/Images/loading.gif); }

4) Task colours.  With the current release what is the best way to assign custom colours to individual tasks?

5) Custom fields.  I have seen an article that discusses addition of fields using a custom provider.  Does that approach end up adding the custom field to the admin popup form?  The article that I am referring to is here: http://www.telerik.com/help/aspnet-ajax/gantt-custom-tasks-field.html

Again apologies for grouping the queries.

Thanks in advance for any assistance.

Regards

Jon
Jon
Top achievements
Rank 1
 answered on 09 Mar 2015
3 answers
114 views
If I add the following aggregate to my Grid...

Aggregate="Sum" DataFormatString="{0:C}" FooterAggregateFormatString="<b>{0:C}</b>"

... and then filter, I get the following error

Sys.WebForms.PageRequestManagerServerErrorException: Cannot find column [it.DivisionID].

This is using an Entity Data Source. 

How do I fix?

Full column specification (Division column was the example Filter column):

<telerik:GridDropDownColumn UniqueName="Division" HeaderText="Division" DataField="DivisionID" DataSourceID="edsDivision" ListValueField="DivisionID" ListTextField="Division1" SortExpression="Division.Division1" AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo" ShowFilterIcon="true" ReadOnly="true" FilterControlWidth="90px">
                    <HeaderStyle Width="100px" />
                    <ItemStyle Width="100px" />
                    <FilterTemplate>
                        <telerik:RadComboBox ID="ddlDivision" DataSourceID="edsDivision" DataValueField="DivisionID" DataTextField="Division1"
                            Height="200px" AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("Division").CurrentFilterValue %>'
                            runat="server" OnClientSelectedIndexChanged="DivisionChanged" Width="80px">
                            <Items>
                                <telerik:RadComboBoxItem Text="All" />
                            </Items>
                        </telerik:RadComboBox>
                        <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
                            <script type="text/javascript">
                                function DivisionChanged(sender, args) {
                                    var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                    tableView.filter("Division", args.get_item().get_value(), "EqualTo");
                                }
                            </script>
                        </telerik:RadScriptBlock>
                    </FilterTemplate>
                </telerik:GridDropDownColumn>

<telerik:GridNumericColumn UniqueName="DebtAgeCurrent" DataField="DebtAgeCurrent" SortExpression="DebtAgeCurrent" HeaderText="Current Debt" ShowFilterIcon="true" ReadOnly="true" CurrentFilterFunction="GreaterThanOrEqualTo" AutoPostBackOnFilter="true" NumericType="Currency" FilterControlWidth="55px"
                    Aggregate="Sum" DataFormatString="{0:C}" FooterAggregateFormatString="<b>{0:C}</b>">
                    <HeaderStyle Width="100px" />
                    <ItemStyle Width="100px" />
                </telerik:GridNumericColumn>


Peter
Top achievements
Rank 1
 answered on 09 Mar 2015
7 answers
171 views
Is there a way to use the RadNavigation to select a page in RadPageView to be displayed? 
Plamen
Telerik team
 answered on 09 Mar 2015
1 answer
158 views
Hello,

I am trying to add button control in ResourceHeaderTemplate. But I cannot find button control inside RadScheduler1_ResourceHeaderCreated event. Control returns null when I tried to use e.Container.FindControl . I also try out image control as explained in this demo .  But that also returns null. I tried to add other controls like HyperLink and LinkButton. But these controls also returns null. The only thing I can do is add a label control. Label control can find and assign value. But I need button control. My requirement is to copy monday appointments to the rest of the week when user click on the resource. Can anyone help me on this issue?

Thank you.

Best regards,
Ei Wai 
Ei Wai
Top achievements
Rank 1
 answered on 09 Mar 2015
2 answers
131 views
Hi,

I am trying to create a hierarchical grid as found in this demo. I am not sure that what I am trying to do is possible due to the way my data is structured. I am pulling
data from multiple Oracle tables and storing it in a single SQL Server table. This table is basically a view of the Oracle data and as such I am obviously losing any relations that existed in the original data. So I guess my question is...is it possible to create a hierarchical grid from a single database table?

Using the before referenced demo, I receive the following error:

There was a problem extracting DataKeyValues from the DataSource. Please ensure that DataKeyNames are specified correctly and all fields specified exist in the
DataSource.

I have the following fields in my SQL Server table:
proj_id, proj_short_name, wbs_id, wbs_name, task_id, task_code, task_name, short_name, proc_id, proc_name, proc_wt, complete_pct

wbs_id and proc_id represent the composite primary_key

The top level of the RadGrid should show wbs_name and short_name
The 2nd level should show task_id, task_name
The 3rd level should show proc_name, proc_wt and complete_pct

Here is my markup and code:

ASPX:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="practiceTemplate.aspx.cs" Inherits="ProgramStatusManagementSystemWebApp.primavera.practiceTemplate" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<!DOCTYPE html>
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
 
        <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true"></telerik:RadSkinManager>
 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
 
        <telerik:RadGrid ID="RadGrid1" runat="server" ShowStatusBar="true" AutoGenerateColumns="False"
 
            PageSize="7" AllowSorting="True" AllowMultiRowSelection="False" AllowPaging="True"
 
            OnDetailTableDataBind="RadGrid1_DetailTableDataBind" OnNeedDataSource="RadGrid1_NeedDataSource"
 
            OnPreRender="RadGrid1_PreRender">
 
            <PagerStyle Mode="NumericPages"></PagerStyle>
 
            <MasterTableView DataKeyNames="wbs_id" AllowMultiColumnSorting="True">
 
                <DetailTables>
 
                    <telerik:GridTableView DataKeyNames="wbs_id" Name="Activities" Width="100%">
 
                        <DetailTables>
 
                            <telerik:GridTableView DataKeyNames="task_id" Name="StepDetails" Width="100%">
 
                                <Columns>
                                     <telerik:GridBoundColumn SortExpression="proc_id" HeaderText="Step ID" HeaderButtonType="TextButton"
 
                                        DataField="proc_id" UniqueName="proc_id">
 
                                    </telerik:GridBoundColumn>
 
                                    <telerik:GridBoundColumn SortExpression="proc_name" HeaderText="Step Name" HeaderButtonType="TextButton"
 
                                        DataField="proc_name" UniqueName="proc_name">
 
                                    </telerik:GridBoundColumn>
 
                                    <telerik:GridBoundColumn SortExpression="proc_wt" HeaderText="Step Weight" HeaderButtonType="TextButton"
 
                                        DataField="proc_wt" UniqueName="proc_wt">
 
                                    </telerik:GridBoundColumn>
 
                                    <telerik:GridBoundColumn SortExpression="complete_pct" HeaderText="Percent Complete" HeaderButtonType="TextButton"
 
                                        DataField="complete_pct">
 
                                    </telerik:GridBoundColumn>
 
                                </Columns>
 
                            </telerik:GridTableView>
 
                        </DetailTables>
 
                        <Columns>
 
                            <telerik:GridBoundColumn SortExpression="task_code" HeaderText="Activity ID" HeaderButtonType="TextButton"
 
                                DataField="task_code" UniqueName="task_code">
 
                            </telerik:GridBoundColumn>
 
                            <telerik:GridBoundColumn SortExpression="task_name" HeaderText="Activity Name" HeaderButtonType="TextButton"
 
                                DataField="task_name" UniqueName="task_name" DataFormatString="{0:D}">
 
                            </telerik:GridBoundColumn>                           
 
                        </Columns>
 
                    </telerik:GridTableView>
 
                </DetailTables>
 
                <Columns>
 
                    <telerik:GridBoundColumn SortExpression="wbs_name" HeaderText="WBS Name" HeaderButtonType="TextButton"
 
                        DataField="wbs_name" UniqueName="wbs_name">
 
                    </telerik:GridBoundColumn>
 
                    <telerik:GridBoundColumn SortExpression="short_name" HeaderText="CAM" HeaderButtonType="TextButton"
 
                        DataField="short_name" UniqueName="short_name">
 
                    </telerik:GridBoundColumn>                  
 
                </Columns>
 
            </MasterTableView>
 
        </telerik:RadGrid>
 </div>
    </form>
</body>
</html>

C#:
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
 
namespace ProgramStatusManagementSystemWebApp.primavera
{
    public partial class practiceTemplate : System.Web.UI.Page
    {
         
        protected void Page_Load(object sender, EventArgs e)
        {
 
        }
 
        protected void RadGrid1_DetailTableDataBind(object sender, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
        {
            GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
            switch (e.DetailTableView.Name)
            {
                case "Activities":
                    {
                        string wbsID = dataItem.GetDataKeyValue("wbs_id").ToString();
                        //string rowuid = dataItem.GetDataKeyValue("rowuid").ToString();
                        e.DetailTableView.DataSource = GetDataTable("SELECT task_code, task_name FROM PrimaveraStatusTemplate3 WHERE wbs_id = " + wbsID + "");
                        //e.DetailTableView.DataSource = GetDataTable("SELECT task_code, task_name FROM PrimaveraStatusTemplate3 WHERE rowuid = " + rowuid + "");
                        break;
                    }
 
                case "StepDetails":
                    {
                        string taskID = dataItem.GetDataKeyValue("task_id").ToString();
                        e.DetailTableView.DataSource = GetDataTable("SELECT proc_name, proc_wt, complete_pct FROM PrimaveraStatusTemplate3 WHERE task_id = " + taskID + "");
                        break;
                    }
            }
        }
 
        protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            if (!e.IsFromDetailTable)
            {
                RadGrid1.DataSource = GetDataTable("SELECT * FROM PrimaveraStatusTemplate3");
            }
        }
 
        protected void RadGrid1_PreRender(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                RadGrid1.MasterTableView.Items[0].Expanded = true;
 
                RadGrid1.MasterTableView.Items[0].ChildItem.NestedTableViews[0].Items[0].Expanded = true;
            }
        }
 
        public DataTable GetDataTable(string query)
        {
            String ConnString = ConfigurationManager.ConnectionStrings["PSMSystemConnectionString"].ConnectionString;
 
            SqlConnection conn = new SqlConnection(ConnString);
 
            SqlDataAdapter adapter = new SqlDataAdapter();
 
            adapter.SelectCommand = new SqlCommand(query, conn);
 
 
 
            DataTable myDataTable = new DataTable();
 
 
 
            conn.Open();
 
            try
            {
 
                adapter.Fill(myDataTable);
 
            }
 
            finally
            {
 
                conn.Close();
 
            }
 
 
 
            return myDataTable;
        }
    }
}

The error is being thrown on RadGrid1_PreRender.

Thanks in advance,

Josh




Josh
Top achievements
Rank 1
 answered on 06 Mar 2015
3 answers
836 views
I m using the filter option in radgrid to filter some data on basis of the option selected in dropedown menu. Now on changing the dropdown value and clicking on submit button, my filter expression test is still there and the data gets filtered. How do I remove the filter in the text box.
Please help!
Thanks in advance.
Pramod
Top achievements
Rank 1
 answered on 06 Mar 2015
2 answers
96 views
I originally coded two buttons via C# to appear on page load inside a rad menu item which originally contained a radcombobox and two input items:
    <telerik:RadMenuItem runat="server" Value="WorkspaceMenuItems">
                        <ItemTemplate>
                            <telerik:RadComboBox ID="ComboBoxViews" runat="server"/>
                            <input type="button" value="Create View" />
                            <input type="button" value="Manage Views"/>
                        </ItemTemplate>
                    </telerik:RadMenuItem>

My question I guess is how can I use placeholders inside a radmenuitem ?, the way I have it is like so:

var menu = ((RadMenu)Master.FindControl("MenuMaster")).FindItemByValue("WorkspaceMenuItems");
        menu.Controls.Add(exportAcfps);
        menu.Controls.Add(exportAvails);

However the thing I don't like is that on the webpage the buttons added show too near eachother, not like the ones originally placed there. I included picture...is there a way to go about it using placeholders or is there another easy way ?"? thanks!!!!
Andrey
Top achievements
Rank 1
 answered on 06 Mar 2015
1 answer
234 views
I use "Silk" form  (Skin="Silk")
If I want to change the size of word, where can i set?
Ivan Danchev
Telerik team
 answered on 06 Mar 2015
16 answers
637 views
Hi.

I have a set of tabs pointing to RadPageViews, with each RadPageView containing a usercontrol.  This doesn't work at all; as soon as the usercontrol is added into the RadPageView content, the tabs no longer work.  How can I load my usercontrols into my RadPageViews?  Can this not be done declaratively?

Craig
Marin Bratanov
Telerik team
 answered on 06 Mar 2015
2 answers
186 views
Hi,

Currently I have a RadGrid that allows me to user a usercontrol to add and edit. My only issue now is that I need the usercontrol to return an object to the page holding the RadGrid. To do this I have created a custom event handler in the usercontrol. At time of edit or insert I assign a local method to the event:

if (e.Item.IsInEditMode)
{
    GridEditFormItem editItem = e.Item as GridEditFormItem;
 
    object EditControl = e.Item.FindControl(GridEditFormInsertItem.EditFormUserControlID);
    if (EditControl is ValanceProfileCoilLength)
    {
        ValanceProfileCoilLength CL = (ValanceProfileCoilLength)EditControl;
        CL.ItemInserted += new ValanceProfileCoilLength.ItemInsertedEventHandler(CL_ItemInserted);
        REC_ValanceProfileCoilLength ACL;
        if (e.Item.ItemIndex >= 0) ACL = this.VP.ActiveCoilLengths[e.Item.ItemIndex];
        else ACL = new REC_ValanceProfileCoilLength(null, this.ConnString);
         
        CL.Show(ACL);
    }
}


This only good to get the event attached but since the content is dynamic I have to re-attach the method to the ItemInserted event. I can successfully re-attach the method to the event when in insert mode at page_load but I cannot achieve this in edit mode. See code (comments inside to explain the point of failure)

protected void Page_Load(object sender, EventArgs e)
{
    // Re-attach method to events in EditForm UserControls
    // Insert EditForm
    if (this.grdCoilLengths.MasterTableView.IsItemInserted)
    {
        object EditForm = this.grdCoilLengths.MasterTableView.GetInsertItem().FindControl("EditFormControl");
        ValanceProfileCoilLength CL = (ValanceProfileCoilLength)EditForm;
        CL.ItemInserted += new ValanceProfileCoilLength.ItemInsertedEventHandler(CL_ItemInserted);  // <-- This works when in insert mode
    }
 
    // Edit EditForm (Only one edit form allowed at once)
    if (this.grdCoilLengths.EditItems.Count > 0)
    {
        object EditControl = this.grdCoilLengths.EditItems[0].FindControl(GridEditFormInsertItem.EditFormUserControlID); // <-- This returns null when in edit mode
        if (EditControl is ValanceProfileCoilLength)
        {
            ValanceProfileCoilLength CL = (ValanceProfileCoilLength)EditControl;
            CL.ItemInserted += new ValanceProfileCoilLength.ItemInsertedEventHandler(CL_ItemInserted);
        }               
    }
}






Gerry
Top achievements
Rank 1
 answered on 06 Mar 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?