Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
103 views
Hi,
  Following are various issues which I am looking at related to RAD PIE CHART

1.  When I set data to chart Item it's trying to take the angle in anit-clock wise direction. Can It be possible to get it to clock wise.
2. When the fill color of this item when to set to gradient is trying to achieve linear gradient. Can we have radial gradient?
  I mean thick color at center of circle and light colors at the end.
Ves
Telerik team
 answered on 26 Jan 2009
1 answer
129 views
hi,

I am using  drill down feature of radchart, but i am not able to add multiple attributes to chartseries or chartitems.

i am fetching first formats from database, and showing that formats in graph, at that time i am adding  format ID as chartseriesitem`s attributes, but when i click on any one format i want to show that format related section, now i want formatID and SectionID as attributes, to drilldown sections.

Thanks & Regards
anand gole
Giuseppe
Telerik team
 answered on 26 Jan 2009
1 answer
89 views
I have a menu item set which contains all 50 states. It is rather cumbersome to reach the bottom of the list. Is there any way, once the list is active, to press a key (eg W for Wyoming) and have it drop immediately down to the "W"s?

Also, I would like to hook up different javascript functions in response to a click, for different item groups? Possible?

Yana
Telerik team
 answered on 26 Jan 2009
1 answer
97 views
I have created a stacked bar chart with its corresponding data table below.
There is a discrepancy in one of the itemdata labels(2006) that is displayed and its corresponding value in the data table.
The Data table has the correct value (7).
I think the first bottom left label displays the name of the series instead of the YValue. It occurs only for this label. Is this some bug in RAD Chart?

I wanted to post a screen shot but i could not.

Cheers
Nitin
Ves
Telerik team
 answered on 26 Jan 2009
1 answer
190 views

I am having an issue with RadGrid.

What I want to do.

Display a data grid allow paging and filtering, well that sounds easy but....

My recordset may have 100000’s of rows so I have implemented AJAX to load the data page at a time, and use VirtualItemCount to set the total number of rows.

This all works fine.

I have tried to add filtering to the grid and again this works sortof. The issue I have is as follows, when a user selects the filter value, this is done in the SQL backend as there is more that 1 possible column to be filtered and the total number of rows is returned and the first page of results therefore changing the total number of pages.

What I am seeing.

When the filter is applied it filters the result in the column first column even through the data set is already filtered.  What I want to do is just display the rows returned in the dataset.

Also I want to disable the filter type list and just have it as a click and go button.

Is there any way of stopping the grid filtering the data as I already do this in my SQL. I still want the filter box at the top of the screen.

Code below...

Mark up

 

<%@ Page Language="VB" MasterPageFile="~/CRM.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" 
    Inherits="_Default" Title="Untitled Page" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">  
</asp:Content> 
<asp:Content ID="Content2" ContentPlaceHolderID="cph" runat="Server">  
    <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"   
        AutoGenerateColumns="False"   
        OnNeedDataSource="RadGrid1_NeedDataSource"   
        OnItemCommand="RadGrid1_ItemCommand" 
        AllowPaging="True"   
        AllowCustomPaging="True"   
        GridLines="None"   
        ShowFooter="True" AllowFilteringByColumn="True">  
        <HeaderContextMenu EnableTheming="True">  
            <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
        </HeaderContextMenu> 
        <PagerStyle Mode="NextPrevNumericAndAdvanced" /> 
        <MasterTableView> 
            <RowIndicatorColumn> 
                <HeaderStyle Width="20px"></HeaderStyle> 
            </RowIndicatorColumn> 
            <ExpandCollapseColumn> 
                <HeaderStyle Width="20px"></HeaderStyle> 
            </ExpandCollapseColumn> 
        </MasterTableView> 
        <FilterMenu EnableTheming="True">  
            <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
        </FilterMenu> 
    </telerik:RadGrid> 
    <br /> 
</asp:Content> 
 

Code behind
Imports CRM.DAL  
Imports System.Data  
Imports Telerik.Web.UI  
 
Partial Class _Default  
    Inherits System.Web.UI.Page  
 
    Private dt As DataTable  
    Private Shared maxRows As Integer  
    Private Shared currentFilter As String  
 
    Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load  
        Me.RadGrid1.MasterTableView.Columns.Clear()  
        Dim gridColumn As GridBoundColumn = New GridBoundColumn()  
        gridColumn.AllowFiltering = True 
        gridColumn.DataField = "ContactSurname" 
        gridColumn.HeaderText = "Surname" 
        gridColumn.UniqueName = "ContactSurname" 
        RadGrid1.MasterTableView.Columns.Add(gridColumn)  
 
        gridColumn = New GridBoundColumn()  
        gridColumn.AllowFiltering = False 
        gridColumn.DataField = "ContactFirstForename" 
        gridColumn.HeaderText = "First Forename" 
        gridColumn.UniqueName = "ContactFirstForename" 
        RadGrid1.MasterTableView.Columns.Add(gridColumn)  
 
        gridColumn = New GridBoundColumn()  
        gridColumn.AllowFiltering = False 
        gridColumn.DataField = "ClientName" 
        gridColumn.HeaderText = "Client Name" 
        gridColumn.UniqueName = "ClientName" 
        RadGrid1.MasterTableView.Columns.Add(gridColumn)  
 
        RadGrid1.VirtualItemCount = maxRows 
        RadGrid1.GroupingSettings.CaseSensitive = False 
    End Sub  
 
    Protected Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As GridNeedDataSourceEventArgs)  
        dt = GetDataTable(currentFilter, RadGrid1.CurrentPageIndex, RadGrid1.PageSize)  
        Me.RadGrid1.DataSource = dt 
    End Sub  
 
    Protected Sub RadGrid1_ColumnCreating(ByVal sender As Object, ByVal e As GridColumnCreatingEventArgs)  
        If (e.ColumnType = GetType(GridBoundColumn).Name) Then  
            Dim gridColumn As GridBoundColumn = New GridBoundColumn()  
            gridColumn.DataField = CType(e.Column, GridBoundColumn).DataField  
            gridColumn.HeaderText = CType(e.Column, GridBoundColumn).HeaderText  
            gridColumn.UniqueName = CType(e.Column, GridBoundColumn).UniqueName  
            gridColumn.AllowFiltering = CType(e.Column, GridBoundColumn).AllowFiltering  
            e.Column = gridColumn 
        End If  
    End Sub  
 
    Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As GridCommandEventArgs)  
        If (e.CommandName = RadGrid.FilterCommandName) Then  
            Dim column As GridBoundColumn = e.Item.OwnerTableView.Columns(0)  
            If column.AllowFiltering Then  
                dt = GetDataTable(column.CurrentFilterValue, RadGrid1.CurrentPageIndex, RadGrid1.PageSize)  
                currentFilter = column.CurrentFilterValue  
                column.CurrentFilterValue = String.Empty  
                column.CurrentFilterFunction = GridKnownFunction.NoFilter  
 
                RadGrid1.DataSource = dt 
                RadGrid1.MasterTableView.FilterExpression = String.Empty  
                RadGrid1.Rebind()  
 
                RadGrid1.VirtualItemCount = maxRows 
                RadGrid1.GroupingSettings.CaseSensitive = False 
            End If  
        End If  
    End Sub  
 
    Public Shared Function GetDataTable(ByVal query As String, ByVal CurrentPageIndex As Integer, ByVal PageSize As Integer) As DataTable  
        Dim myDataTable As DataTable  
        If query = String.Empty Then  
            query = "%" 
        End If  
        Dim ds As DataSet = DAL.SelectContacts(query, CurrentPageIndex, PageSize)  
        myDataTable = ds.Tables(0)  
        maxRows = ds.Tables(1).Rows(0).Item("TotalRecords")  
        myDataTable.CaseSensitive = False 
        Return myDataTable  
    End Function  
 
End Class  
 

Iana Tsolova
Telerik team
 answered on 26 Jan 2009
3 answers
119 views
Implementing a RadChart inside a Web User Control works fine however, when adding the ScrollMode attribute in the ClientSetting tag the control fails to render in the Design view and when browsing the Web Page containing the Web User Control.

Any suggestions on how to solve this problem?

Thanks.
Giuseppe
Telerik team
 answered on 26 Jan 2009
1 answer
122 views
I cannot seem to find a way to handle errors in certain situations.  I have added the following property to a partial class that extends one of the LINQ to SQL objects in my project by decrypting a SSN field for output.  This will generate an error if the key does not match the original key.

 

 

        public string SSN  
        {  
            get 
            {  
                if (string.IsNullOrEmpty(ssn))  
                    ssn = EncryptedSSN.DESDecrypt("KEYKEYKE");  
                return ssn;  
            }  
            set { ssn = value; }  
        } 

Only one record of my list of employees generates an error and this employee shows up on page 5 of my grid.  When I click the page 5 navigation, the RadAjaxLoadingPanel shows, hides, and the status bar reads "Loading..." without the contents of the grid actually updating.  I get similar behavior in other situations when there is a binding error during an AJAX call.  I'd like to know how to handle this error, or the best way to work around this behavior.

Here is the relevant code:
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" /> 
    <telerik:RadScriptManager runat="server" /> 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="itemsGrid">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="itemsGrid" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                    <telerik:AjaxUpdatedControl ControlID="messageCenter" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="reloadButton">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="itemsGrid" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManager> 
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="200px" Width="200px" Transparency="15" BackColor="LightGray">  
        <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' style="border:0;" /> 
    </telerik:RadAjaxLoadingPanel>        
 
 
 
    <div> 
        <thin:MessageCenter ID="messageCenter" runat="server" /> 
    </div> 
 
 
 
    <div id="listTableContainer">  
        <telerik:RadGrid ID="itemsGrid" runat="server" AllowAutomaticDeletes="True" AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" DataSourceID="employees" GridLines="None" PageSize="50" Skin="Vista" AllowMultiRowSelection="True" ShowStatusBar="True" OnItemDeleted="itemsGrid_ItemDeleted">  
            <HeaderContextMenu EnableTheming="True">  
                <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
            </HeaderContextMenu> 
            <AlternatingItemStyle BackColor="#F6F7F9" Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False" Wrap="False" /> 
            <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False" Wrap="False" /> 
            <SelectedItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False" Wrap="False" /> 
            <PagerStyle Mode="NextPrevNumericAndAdvanced" /> 
            <MasterTableView AutoGenerateColumns="False" DataSourceID="employees" DataKeyNames="ID" ClientDataKeyNames="ID" CommandItemDisplay="Top">  
                <CommandItemTemplate> 
                    <div id="toolbarContainer" class="Toolbar">  
                        <href="javascript:OpenItemWindow('Employee',0,0);">  
                            <asp:Image ID="Image1" runat="server" SkinID="AddButton" AlternateText="Add New" /> 
                            <span>Add New</span> </a> 
                        <asp:LinkButton ID="deleteLink" runat="server" OnClientClick="javascript:return confirm('Delete all selected items?')" CommandName="DeleteSelected">  
                            <asp:Image ID="Image2" runat="server" SkinID="DeleteButton" AlternateText="Delete" /> 
                            <span>Delete Selected</span> 
                        </asp:LinkButton> 
                        <asp:LinkButton ID="LinkButton1" runat="server" CommandName="RebindGrid">  
                            <asp:Image ID="Image3" runat="server" SkinID="RefreshButton" /> 
                            <span>Refresh</span> 
                        </asp:LinkButton> 
                    </div> 
                </CommandItemTemplate> 
                <Columns> 
                    <telerik:GridButtonColumn CommandName="Delete" ConfirmText="Are you sure you want to delete this item?  This action cannot be undone." ConfirmTitle="Are you sure?" Text="Delete" UniqueName="column">  
                        <HeaderStyle Width="50px" /> 
                    </telerik:GridButtonColumn> 
                    <telerik:GridBoundColumn DataField="SSN" HeaderText="SSN" ReadOnly="True" SortExpression="SSN" UniqueName="SSN">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name" ReadOnly="True" SortExpression="FirstName" UniqueName="FirstName">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="MiddleName" HeaderText="Middle Name" ReadOnly="True" SortExpression="MiddleName" UniqueName="MiddleName">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="LastName" HeaderText="Last Name" ReadOnly="True" SortExpression="LastName" UniqueName="LastName">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="Suffix" HeaderText="Suffix" ReadOnly="True" SortExpression="Suffix" UniqueName="Suffix">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridCheckBoxColumn DataField="Active" DataType="System.Boolean" HeaderText="Active" ReadOnly="True" SortExpression="Active" UniqueName="Active">  
                    </telerik:GridCheckBoxColumn> 
                </Columns> 
            </MasterTableView> 
              
            <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True">  
                <Selecting AllowRowSelect="True" /> 
                <Scrolling AllowScroll="True" UseStaticHeaders="True" /> 
                <Resizing AllowColumnResize="true" ResizeGridOnColumnResize="false" /> 
                <ClientEvents OnGridCreated="GridCreated" OnRowDblClick="RowDblClick" /> 
            </ClientSettings> 
            <FilterMenu EnableTheming="True">  
                <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
            </FilterMenu> 
        </telerik:RadGrid> 
          
        <asp:LinqDataSource ID="employees" runat="server" 
            ContextTypeName="DBDataContext" 
            OrderBy="Active, LastName, FirstName" 
            TableName="Employees" 
            EnableDelete="True" OnSelected="employees_Selected" /> 

Code Behind
    protected void Page_Load(object sender, EventArgs e)  
    {  
        if (!Page.IsPostBack)  
            Page.DataBind();  
    }  
 
    public void reloadButton_Click(object sender, EventArgs e)  
    {  
        itemsGrid.Rebind();  
    }  
 
    protected void itemsGrid_ItemDeleted(object source, GridDeletedEventArgs e)  
    {  
        GridDataItem dataItem = (GridDataItem)e.Item;  
        String id = dataItem.GetDataKeyValue("ID").ToString();  
 
        if (e.Exception != null)  
        {  
            e.ExceptionHandled = true;  
 
            messageCenter.DisplayMessage("Employee could not be deleted. " + e.Exception.Message, Resources_Controls_MessageCenter.MessageType.Error);  
        }  
        else 
        {  
            messageCenter.DisplayMessage("Employee(s) deleted.", Resources_Controls_MessageCenter.MessageType.Success);  
        }  
    }  
 
    public void employees_Selected(object sender, LinqDataSourceStatusEventArgs e)  
    {  
        if (e.Exception != null)  
        {  
            e.ExceptionHandled = true;  
            messageCenter.DisplayMessage("Employees list could not be obtained. " + e.Exception.Message, Resources_Controls_MessageCenter.MessageType.Error);  
        }         
    } 

Yavor
Telerik team
 answered on 26 Jan 2009
1 answer
105 views
I am experiencing strange behavior when using NeedDataSource and paging. Basically, I have a search button on my page and when the user searches more than once, it will return page index 0 the first time, 1 the second time, and so on. I could easily just set the CurrentPageIndex property everytime a search takes place, but I want to make sure this is expected behavior from telerik.

        protected void Page_Init(object sender, EventArgs e)  
        {  
            if (Page.IsPostBack)  
            {  
                grdUsers.NeedDataSource += new GridNeedDataSourceEventHandler(grdUsers_NeedDataSource);  
            }  
        }  
 
 
        protected void btnSearch_Click(object sender, EventArgs e)  
        {  
            grdUsers.Rebind();  
        }  
 
        protected void grdUsers_NeedDataSource(object source, GridNeedDataSourceEventArgs e)  
        {  
            grdUsers.DataSource = GetUsers();  
        }  
 
Tsvetoslav
Telerik team
 answered on 26 Jan 2009
4 answers
167 views
I have hierarchy of panel items Level1-Level2-Level3

I only have "Actions" when user selects a Level3 item. All "parent" items from Level1 and Level2 act as folders only.

I can create CSS to show which item on Level3 is selected, but I could not find how to specify CSS for the parent of selected item.

For example when user clicks on Item3 I want to change background and font color of Item3 and all of its parents (Item1 and Item2). How can I do this?

Item1
  Item2
    Item3
OtherItem
OtherItem

Thank you
Yana
Telerik team
 answered on 26 Jan 2009
1 answer
209 views
Hi,

I am using a RadGrid programatically.  I have a GridTemplateColumn :

 

      GridTemplateColumn colState = new GridTemplateColumn();  
      colState.ItemTemplate = new StateControl();  
      colState.HeaderText = "State";  
      colState.Visible = false

 


which uses the following ItemTemplate :

 

public class StateControl : ITemplate  
{  
   public void InstantiateIn(System.Web.UI.Control container)  
   {  
      RadComboBox radcomboState = new RadComboBox();  
      radcomboState.Skin = "Outlook";  
      radcomboState.ID = "radcomboState";  
      radcomboState.AllowCustomText = false;  
      radcomboState.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(radcomboState_SelectedIndexChanged);  
      radcomboState.AutoPostBack = true;  
      radcomboState.Visible = true;  
 
      container.Controls.Add(radcomboState);       
   }  

The RadGrid is set up to allow grouping and all works ok.  However, when the group node is collapsed, the contents disappear from the cell which contains the ItemTemplate data.  The contents disappear even from cells that are not in the group which is being collapsed.

As a test, I set up the ItemTemplate in the .ascx file like this : 

 

               <telerik:GridTemplateColumn HeaderText="State" Reorderable="true">  
                  <ItemTemplate> 
                     <telerik:RadComboBox Skin="Outlook" runat="server" ID="radcomboState" AllowCustomText="false" 
                        OnSelectedIndexChanged="radcomboState_SelectedIndexChanged" AutoPostBack="true">  
                     </telerik:RadComboBox> 
                  </ItemTemplate> 
               </telerik:GridTemplateColumn> 

And it worked fine.  The contents remained in the cells when the group was collapsed.
In the example I have used a RadCombo box, but the same occurs when using a simple Literal.
I need to be able to acheive this programmatically, have I missed something or is there a bug here?

Regards,

Sean Duffy
Rosen
Telerik team
 answered on 26 Jan 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?