Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
165 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
134 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
844 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
97 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
241 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
642 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
191 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
7 answers
305 views
Hi today we noticed we are having a bunch of issue with the latest radasyncupload component.  We launched a site today by zipping it up, moving it to the live server, unzipping and setting up IIS the same was as on the dev server.  When we try to upload to the live site we get a yellow blinking dot on all uploads.  I checked folder permissions and they are set correctly.  The error I am seeing is as follows:

TypeError: f.fileInfo is undefined

This is a problem on a number of sites.

Jon
John
Top achievements
Rank 1
 answered on 06 Mar 2015
4 answers
103 views
Hi Team,
I implemented the autocomplete in the telerik Grid. It works perfect in Firefox and Chrome. But in IE there is late or delay in binding. As soon as we click cell having autocompleted implemented in the grid. It does not binds immediately. It there any workaround we need to implement in case of IE's


Thanks & Regards
Hristo Valyavicharski
Telerik team
 answered on 06 Mar 2015
1 answer
87 views
Hi,

Something is causing my RadWindow to display with strange little boxes on the bottom of it(see attachment). The Webform display fine when loaded by itself. The problem occurs when I display it from the parent. Any suggestions?
Marin Bratanov
Telerik team
 answered on 06 Mar 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?