Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
316 views
Is it possible to set default values for filters within PivotGrid?

For example, within my PivotGrid I have a Column Field 'Year', and I want this to be automatically filtered by the past 2 years on load. 
Viktor Tachev
Telerik team
 answered on 12 Aug 2014
4 answers
183 views
Hi,

    I am using a user control with the RadComobox with Header and Item Templates as follows,

.aspx,


               <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EmployeesList.ascx.cs" Inherits="Sampige.Web.iprocessWebPortal.SiteAdmin.UserControls.EmployeesList" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="rad" %>

<div style="width: 250px">
    <table>
        <tr>
            <td>
              <%-- <rad:RadComboBox ID="cmbEmployee" runat="Server" Width="150px" DataTextField="EmployeeName" DropDownWidth="200px"
                            DataValueField="EmployeeID" AutoPostBack="true" >
               </rad:RadComboBox>--%>
               <rad:RadComboBox ID="cmbemployeeselector" runat="server" Width="160px" HighlightTemplatedItems="true" ForeColor="Black" Filter="StartsWith"
                 DataTextField="EmployeeName" DropDownWidth="450px"
                DataValueField="EmployeeID" CausesValidation="false">
                
                <HeaderTemplate>
                    <table style="width: 100%;" cellspacing="0" cellpadding="0">
                        <tr>
                            <td style="width: 33%; ">
                              Employee Name
                            </td>
                            <td style="width: 33%;">
                               Area Name
                            </td>
                            <td style="width: 30%;">
                              Group Name
                            </td>
                        </tr>
                    </table>
                </HeaderTemplate>
                <ItemTemplate>
                    <table style="width: 100%;" cellspacing="1" cellpadding="1">
                        <tr>
                            <td style="width: 33%;">
                                <%# DataBinder.Eval(Container, "Attributes['EmployeeName']")%>
                            </td>
                            <td style="width: 33%;">
                                <%# DataBinder.Eval(Container, "Attributes['AreaName']")%>
                            </td>
                            <td style="width: 30%;">
                                <%# DataBinder.Eval(Container, "Attributes['GroupName']")%>
                            </td>
                        </tr>
                    </table>
                </ItemTemplate>
            </rad:RadComboBox>
            </td>
           
           
        </tr>
    </table>
</div>

.aspx.cs,
========

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Telerik.Web.UI;
using Sampige.BLL.Inspector;

namespace Sampige.Web.iprocessWebPortal.SiteAdmin.UserControls
{
    [ValidationProperty("EmployeeID")]
    public partial class EmployeesList : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Page_Init(object sender, EventArgs e)
        {

            GetEmployees();
        }


        public string EmployeeID
        {

            get
            {
                return cmbemployeeselector.SelectedItem.Value;
               
            }
            set
            {
                ViewState["EmployeeID"] = value;
                SetComboItem(value, null);
            }
        }

        private void SetComboItem(string Value, string Text)
        {
            if (Value != null && Value != string.Empty)
            {
                
                cmbemployeeselector.SelectedItem.Value = Value;
            }
            else
                GetEmployees();
        }

         public void GetEmployees()
        {
            DataTable dt = InspectorReport.LoadEmployeesList();
            cmbemployeeselector.Enabled = true;
            cmbemployeeselector.Items.Clear();
            RadComboBoxItem itemAll = new RadComboBoxItem();
            itemAll.Text = "--Select--";
            itemAll.Value = "-1";
            itemAll.Attributes.Add("EmployeeName", "--Select--");
            itemAll.Attributes.Add("AreaName", "--Select--");
            itemAll.Attributes.Add("GroupName", "--Select--");
            cmbemployeeselector.Items.Add(itemAll);
            cmbemployeeselector.SelectedValue = "-1";
            itemAll.DataBind();
            
            foreach (DataRow dataRow in dt.Rows)
            {
                RadComboBoxItem item = new RadComboBoxItem();

                item.Text = (string)dataRow["EmployeeName"];
                item.Value = dataRow["EmployeeID"].ToString();

                string ItemCode = dataRow["EmployeeName"].ToString();
                string ItemType = dataRow["AreaName"].ToString();
                string AreaName = dataRow["GroupName"].ToString();

                item.Attributes.Add("EmployeeName", ItemCode);
                item.Attributes.Add("AreaName", ItemType);
                item.Attributes.Add("GroupName", AreaName);

                cmbemployeeselector.Items.Add(item);
                item.DataBind();
            }

            //cmbemployeeselector.SelectedValue = "-1";
        }

    }
    
}





When i use this user control in some another page i'm not getting the Required Filed Message in a Message box,

  <employeecombo:EmployeesList ID="Enteredby" runat="server" />
                <asp:RequiredFieldValidator ID="RequiredFieldValidator98" Display="Dynamic" runat="server"
                    ValidationGroup="Inspection" ErrorMessage="Entered by is Required" ControlToValidate="Enteredby"
                    InitialValue="-1"></asp:RequiredFieldValidator>


In this aspx page I am using that user control and i am not getting the Required Field Validation Message in a Message Box..
But it is showing a message(summary message) after i click on a save button.....
But no where i am able to get the Message box..,


Pls Help me...
Thanks in Advance.









    
Balageetha
Top achievements
Rank 1
 answered on 12 Aug 2014
1 answer
680 views
Hi,
till now I tried to search forums for about 3 hrs, no effort.

I have a RadGrid w MasterTable and DetailTable in it.
The Master contains list of groups, Detail can show members of groups.
Both table data are persisted in viewstate, having added column to store selection of records.

I've added a checkbox for selecting the whole group to the MasterTable. The detail table also contains an added checkbox to select any of the members individually. On checkedChanged the values in underlying data tables are set accordingly (when group is selected, all members are selected too, when any member is unselected, the group is set to loose selection thus not all member are selected any more) - that works fine.

What i am trying to do is:
If there exists at least 1 selected member in the group, I want the detail to remain expanded, but cannot find any way to do this.

My last try was to place a foreach loop in pageload_Complete to iterate through the underlying data searching for checked (selected) members.
When such a member is found, I tell the RadGrid to .Expanded = true for the according group, but it does not happen.

Even when I step through the methods and check the state of .Expanded after setting it to true, it still remains false. Why?
Vladimír
Top achievements
Rank 1
 answered on 12 Aug 2014
3 answers
172 views
Hello all,

I am using RadScheduler with reminder. When i schedule an recurring activity with an alert. Then Alert window will appear for me. From the Alert window i can open my activity. But it will open all occurrence of the recurring activity. And if i do any changes in that activity then changes will applied to all occurrences. Is there any way that if i want to open the recurring activity from an alert window then it will ask for Open Single Occurrence of the activity  or Open all occurrence of the activity.
Boyan Dimitrov
Telerik team
 answered on 12 Aug 2014
1 answer
98 views
 <telerik:RadWindow ID="RadWindow1AddProductFromQuote" runat="server" IconUrl="none" AutoSizeBehaviors="Default" Behaviors="Close" Width="595px" Skin="Black" Height="365px" AutoSize="false" Modal="true" >
            <ContentTemplate>
                <telerik:RadGrid ID="radgridProductfromqoute" Width="97%" Style="margin: 0 auto;" runat="server" AutoGenerateColumns="false" EnableHierarchyExpandAll="true"
                    PageSize="20" Skin="Black" OnNeedDataSource="radgridProductfromqoute_NeedDataSource" AllowFilteringByColumn="false" OnDetailTableDataBind="radgridProductfromqoute_DetailTableDataBind">
                      <ClientSettings>
                    <ClientEvents OnHierarchyExpanded="OnHierarchyExpanded" />
                    
                </ClientSettings>
                    <MasterTableView DataKeyNames="QuotationID" ClientDataKeyNames="QuotationID"  HierarchyLoadMode="Client">
                        <Columns>
                             <telerik:GridTemplateColumn HeaderText="Quotation No" UniqueName="QuotationID">
                                <ItemTemplate>
                                    <asp:Label ID="lblQuotationID" runat="server" Text='<%# Eval("QuotationID") %>'></asp:Label>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderText="Quotation No" UniqueName="QuotationNo">
                                <ItemTemplate>
                                    <asp:Label ID="lblQuotationn" runat="server" Text='<%# Eval("QuotationNo") %>'></asp:Label>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderText="Quotation Date" UniqueName="Quotationdate">
                                <ItemTemplate>
                                    <asp:Label ID="lblQuotationDate" runat="server" Text='<%# Eval("QuotationDates") %>'></asp:Label>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderText="Company Name" UniqueName="Company">
                                <ItemTemplate>
                                    <asp:Label ID="lblCompanyName" runat="server" Text='<%# Eval("CompanyName") %>'></asp:Label>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                        </Columns>

                        <DetailTables>
                            <telerik:GridTableView Name="calldetails"  Width="100%" AllowPaging="false" ItemStyle-BackColor="#6C7170" AlternatingItemStyle-BackColor="#666666"
                                AutoGenerateColumns="false" align="center" CssClass="Businessgrid" AllowFilteringByColumn="false">
                                <Columns>
                                    <telerik:GridTemplateColumn HeaderText="Description">
                                        <ItemTemplate>
                                            <asp:Label ID="lblItemDescription" runat="server" Text='<%# Eval("ItemDescription") %>'></asp:Label>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn HeaderText="Qty">
                                        <ItemTemplate>
                                            <asp:Label ID="lblQty" runat="server" Text='<%# Eval("Quantity") %>'></asp:Label>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn HeaderText="VAT">
                                        <ItemTemplate>
                                            <asp:Label ID="lblVAT" runat="server" Text='<%# Eval("VATPercentage") %>'></asp:Label>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn HeaderText="Cost Price">
                                        <ItemTemplate>
                                            <asp:Label ID="lblCost" runat="server" Text='<%# Eval("CostPrice") %>'></asp:Label>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn HeaderText="Selling Price">
                                        <ItemTemplate>
                                            <asp:Label ID="lblSelling" runat="server" Text='<%# Eval("SellingPrice") %>'></asp:Label>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn HeaderText="Sub Total">
                                        <ItemTemplate>
                                            <asp:Label ID="lblSubTotal" runat="server" Text='<%# Eval("TotalAmount") %>'></asp:Label>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn HeaderText="Total">
                                        <ItemTemplate>
                                            <asp:Label ID="lblTotal" runat="server" Text='<%# Eval("MarginAmount") %>'></asp:Label>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn HeaderText="Total">
                                        <ItemTemplate>
                                            <asp:Label ID="lblItemID" runat="server" Text='<%# Eval("QuotationTransID") %>'></asp:Label>
                                            <asp:CheckBox ID="chkProduct" runat="server" ></asp:CheckBox>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                </Columns>
                                <NoRecordsTemplate>
                                    <div>
                                        No call details found
                                    </div>
                                </NoRecordsTemplate>
                            </telerik:GridTableView>
                        </DetailTables>
                        <NoRecordsTemplate>
                            <div>
                                No call details found
                            </div>
                        </NoRecordsTemplate>
                    </MasterTableView>
                    <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                </telerik:RadGrid>  here i need "lblItemID" this control value find any buddy help me........







Shinu
Top achievements
Rank 2
 answered on 12 Aug 2014
1 answer
158 views
I have a saved the multiple checked items into my database, when I retrieve out the records, it only checked one item in the listbox instead of multiple. I have also verified that the records returned in the datatable contains 3 records.

aspx:
 <telerik:RadListBox ID="lbxDevelopmentComponent" SelectionMode="Multiple" runat="server" OnClientItemChecked="OnClientItemChecked"
                                        CheckBoxes="true" DataTextField="Text" DataValueField="Value" Width="500px" Height="150px">
                                    </telerik:RadListBox>

.cs:
var dtDevelopmentComponent = _objSqlManager.ExecuteSQL(sqlDevelopmentComponent.ToString(), paramDevelopmentComponent);

                        if (dtDevelopmentComponent.Rows.Count > 0)
                        {
                            for (int i = 0; i < dtDevelopmentComponent.Rows.Count; i++)
                            {
                                RadListBoxItem item = lbxDevelopmentComponent.FindItemByText(dtDevelopmentComponent.Rows[0]["DEVELOPMENT_COMPONENT_NAME"].ToString());
                                if (item != null)
                                    item.Checked = true;
                            }
                        }
Bozhidar
Telerik team
 answered on 12 Aug 2014
3 answers
172 views
Hi , 

I am trying to display line chart dynamically and get displayed in my panel. I don't understand what I am doing wrong. Please help.

I have this in my .aspx file
      <asp:Panel ID="Panel3" runat="server"  style="float:left;width:45%;">
             <telerik:RadHtmlChart ID="RadHtmlChart3"  runat="server" ChartTitle-Text="Dynamic Line Series">
             </telerik:RadHtmlChart>         
      </asp:Panel>

and the following code in aspx.cs file
 if (DropDownList1.SelectedValue == "Line")
        {
            SqlConnection sqlConn3 = new SqlConnection(ConfigurationManager.ConnectionStrings["xxxx"].ConnectionString);
            SqlCommand SqlCmd3 = new SqlCommand("Select ST as state, count(*) as no_of_cust FROM CUSTOMER group by ST", sqlConn3);
            SqlCmd3.Connection.Open();
            SqlDataReader reader3 = SqlCmd3.ExecuteReader();

            DataTable dt = new DataTable();
            dt.Columns.Add("State_col");
            dt.Columns.Add("No_Customers");
            if (reader3.HasRows)
            {
                while (reader3.Read())
                {
                    dt.Rows.Add(reader3.GetValue(0).ToString(), reader3.GetInt32(1));
                }
            }

            var columns = new List<string>();
            for (int i = 0; i < reader3.FieldCount; i++)
            {
                columns.Add(reader3.GetName(i));
            }
            RadHtmlChart3.ChartTitle.Text = "My dynamic Line Chart";
            RadHtmlChart3.ChartTitle.Appearance.Align = Telerik.Web.UI.HtmlChart.ChartTitleAlign.Center;
            RadHtmlChart3.ChartTitle.Appearance.Position = Telerik.Web.UI.HtmlChart.ChartTitlePosition.Top;
            RadHtmlChart3.Legend.Appearance.BackgroundColor = System.Drawing.Color.White;
            RadHtmlChart3.Legend.Appearance.Position = Telerik.Web.UI.HtmlChart.ChartLegendPosition.Bottom;
            RadHtmlChart3.PlotArea.Appearance.FillStyle.BackgroundColor = System.Drawing.Color.White;
 //           RadHtmlChart3.PlotArea.XAxis.Color = System.Drawing.Color.Azure;
            RadHtmlChart3.PlotArea.XAxis.MajorTickType = Telerik.Web.UI.HtmlChart.TickType.Outside;
            RadHtmlChart3.PlotArea.XAxis.MinorTickType = Telerik.Web.UI.HtmlChart.TickType.Outside;
            RadHtmlChart3.PlotArea.XAxis.Reversed = false;
            RadHtmlChart3.PlotArea.XAxis.DataLabelsField = columns[0];

            RadHtmlChart3.Appearance.FillStyle.BackgroundColor = System.Drawing.Color.White;
            RadHtmlChart3.PlotArea.YAxis.LabelsAppearance.DataFormatString = "{0}";
            RadHtmlChart3.PlotArea.YAxis.LabelsAppearance.RotationAngle = 0;
            RadHtmlChart3.PlotArea.YAxis.LabelsAppearance.Color = System.Drawing.ColorTranslator.FromHtml("#000000");
            RadHtmlChart3.PlotArea.YAxis.MajorGridLines.Color =  System.Drawing.ColorTranslator.FromHtml("#EFEFEF");
            RadHtmlChart3.PlotArea.YAxis.MinorGridLines.Color = System.Drawing.ColorTranslator.FromHtml("#F7F7F7");
            RadHtmlChart3.PlotArea.YAxis.TitleAppearance.Position = Telerik.Web.UI.HtmlChart.AxisTitlePosition.Center;
            RadHtmlChart3.PlotArea.YAxis.TitleAppearance.RotationAngle = 0;
            RadHtmlChart3.PlotArea.YAxis.TitleAppearance.Text = columns[1];
            RadHtmlChart3.PlotArea.YAxis.TitleAppearance.TextStyle.Color = System.Drawing.ColorTranslator.FromHtml("#000000");
            RadHtmlChart3.PlotArea.XAxis.TitleAppearance.Text = columns[0];
            RadHtmlChart3.PlotArea.YAxis.TitleAppearance.Text = columns[1];

           ScatterLineSeries slineSeries = new ScatterLineSeries(); 
            slineSeries.LabelsAppearance.Visible = false;
            slineSeries.LabelsAppearance.Position = Telerik.Web.UI.HtmlChart.LineAndScatterLabelsPosition.Below;
            slineSeries.LabelsAppearance.DataFormatString = "{0}%";
            slineSeries.TooltipsAppearance.DataFormatString = "{0}%";
            slineSeries.DataFieldX = columns[0];
            slineSeries.DataFieldY = columns[1];
         
           RadHtmlChart3.PlotArea.Series.Add(slineSeries);
            RadHtmlChart3.DataSource = reader3;
            RadHtmlChart3.DataBind();
   }
}


Thank you
    







Danail Vasilev
Telerik team
 answered on 12 Aug 2014
5 answers
650 views
I have searched the forums and google to try and figure this out but I am at a loss, any help is much
appriciated.

Problem is when the content page is not in the same folder as the masterpage, the rad controls stop working

Folder structure
WebApplication
       Site1.Master  - contains radtreeview
Admin
    WebForm1.aspx  - blank content page
In this example the radtreeview in master page stops working, the javascript seems to be the problem,
no client side features work, not even just the default expand collapse

If I put the master page and the content page in the same directory all works as expected.

An example page that is not working can be viewed here
http://simplyfundraising.ageektech.com/webapplication/admin/webform1.aspx

Thank you.
      

Sunit
Top achievements
Rank 1
 answered on 12 Aug 2014
1 answer
241 views
I have a aspx web form which contain RadWindow manager with multiple windows in it.  When I open up window via the radwindow manager it seems it won't "affect" the session timer within the "parnet" aspx web form.  How can I make it so that when there is a ajax call or a page refresh, within the radwindow, it will refresh the session timer of the "parent" web form?  

The issue is that the user think that they are still using the web page, but yet they keep getting kick off when session expires on the "parent" web form.

Thank you!

Marin Bratanov
Telerik team
 answered on 12 Aug 2014
2 answers
390 views
I have seen a couple of postings that seem to be related to this issue, but with no definitive answer.

I have a RadComboBox (in ASP.NET) with runat=server and AutoPostBack=true.  I have a handler for OnSelectedIndexChanged.  

The handler fires when the user selects an item with the mouse.  The handler doesn't fire when the focus is on the control and the user changes the selection using the keyboard (arrow up/down).  

The handler will execute in this case when the control loses focus, but that's not the desired behavior.  We have sections of the page that will be shown/hidden based on the user's selection, so the user expects those changes to happen as their selection changes.

What's the official position on how to handle this? 

My version of Telerik.Web.UI.dll is 2013.1.417.35.

Thanks,

David Cater
Shinu
Top achievements
Rank 2
 answered on 12 Aug 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?