Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
182 views


I used telerik UI 2015, I try input hierarcy in rad grid with datepicker in edit from. up select date, but if I action radgrid (click add new record) that raddatepicker running proper.

Problem when first open that page as always postback when I clicked date picker
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                     <telerik:AjaxUpdatedControl ControlID="gvList" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="containerDiv">
                <UpdatedControls>
                   <%--<telerik:AjaxUpdatedControl ControlID="rdpRaiseDateHeader" />
                   <telerik:AjaxUpdatedControl ControlID="rdpEndDateHeader" />--%>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="gvList">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="gvList"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <%--<telerik:AjaxSetting AjaxControlID="containerDiv">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rdpRaiseDate"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>--%>
            <%--<telerik:AjaxSetting AjaxControlID="rdpRaiseDate">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rdpRaiseDate" />
                </UpdatedControls>
            </telerik:AjaxSetting>--%>
           <telerik:AjaxSetting AjaxControlID="rdpRaiseDate">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rdpRaiseDate"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="rdpEndDate">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rdpEndDate"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
.

Please informed about fix that issue, I try fixed issue but not resolved.

Capture issue is attached.





Maria Ilieva
Telerik team
 answered on 09 Mar 2015
1 answer
439 views
Hey everyone,

I have a RadListBox with a few RadListBoxItems inside it. They have varying text where some are pretty small while others can be large. I would rather set the width of the RadListBox to the width of the largest length text while also setting a defined static height.

I have set the width with CSS like so:
.RadListBox_Default
    {
        width:auto !important;
    }

That part works great on its own. But if I add a static height to either the CSS to make it look like:
.RadListBox_Default
    {
        width:auto !important;
        height:300px;
    }
or straight to the ascx, the RadListBox messes up. The width becomes 2 pixels and the RadListBox becomes unusable.

I was wondering if there was a way to get the width to be dynamic while having the height be static. Any help/thoughts are appreciated, thanks!


.RadListBox_Default
    {
        width:auto !important;
    }

.RadListBox_Default
    {
        width:auto !important;
    }

.RadListBox_Default
    {
        width:auto !important;
    }

Magdalena
Telerik team
 answered on 09 Mar 2015
5 answers
189 views
Hi,

I'm using the recursive selection feature which works fine so far, but for rows in my TreeList which aren't selectable it has some drawbacks.

private void TreeListItemDataBound(object sender, TreeListItemDataBoundEventArgs e)
{
   var item = e.Item as TreeListDataItem;
   if (item != null)
   {
      if(myCondition)
      {
         item["Select"].Controls[0].Visible = false;
      }
   }
}

If I use the recursive selection feature, these rows are highlighted too. It would be totally sufficient if these rows weren't highlighted (being in the SelectedRows list is ok - I can filter them out). How can I alter the Row so it isn't highlighted?

Thanks!
Radoslav
Telerik team
 answered on 09 Mar 2015
1 answer
147 views
Hi,

I have a question about the grid row. if we have more record returned in the grid, then every row has a same height. However, if we have less records returned in the grid, for example just one or two rows displayed in the grid, then the row height changed much taller than normal. Is that any way to not enlarge the row height no matter how many records display in the grid?

There is another question is about dropdown list, i need to set the value of the dropdown list from the code (from value passed by controller), how should i do that?

Thanks
Tiffany
Kostadin
Telerik team
 answered on 09 Mar 2015
2 answers
135 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
103 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
166 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
148 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
124 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
817 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?