Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
125 views
Hello,

Can you drag and drop values of 1 cell to another cell in the same row using the grid?

Any help appreciated.  Thanks in advance.
Pavlina
Telerik team
 answered on 25 Feb 2011
3 answers
153 views

Hello,

I have a chart that display a series of data across a date range.  There are 24 data points per day.  Sometimes we are displaying 30 days, sometimes we are displaying many more days. Obviously this is to many labels to display.  I would liket there to always be about 30 labels no matter how many days worth of data I am sidplaying.  I understand the only way to do this is by using the LabelStep property. I would like to set the label step property at runtime based on the number of data points that are in the chart.

I add the labels through the PlotArea.XAxis.AddRange method.  The series is bound to the SQL datasource.  In the chart_ItemDataBound event I get the number of datapoints and try to set the LabelStep property as shown below.  However, no matter what I try the labelstep property that I set at runtime is not used and rather is uses the value set as designtime.

 

private void chart_ItemDataBound(object sender, EventArgs e)
{
    //get handles 
    Telerik.Reporting.Processing.Chart ProcessingChart = (Telerik.Reporting.Processing.Chart)sender;
    Telerik.Reporting.Chart ChartDefinition = (Telerik.Reporting.Chart)ProcessingChart.ItemDefinition;
  
    //get the number of datapoints
    int iDataPoints = ChartDefinition.Series[0].Items.Count;
  
    if (iDataPoints > 0)
                      
        //setting the labelstep on chart defination object from the processing chart
        ChartDefinition.PlotArea.XAxis.LabelStep = iDataPoints / 30;
                  
        //also have tried setting setting the labelstep on actual chart object
        chart.PlotArea.XAxis.LabelStep = iDataPoints / 30;
      
}

Why is the chart not using the labelstep property that I set at runtime?

Thanks,

Chris
Giuseppe
Telerik team
 answered on 25 Feb 2011
2 answers
186 views
I searched but couldn't find an answer, so I'm hoping someone can point me in the right direction. 

If I have a grid with 5 columns:

Client Name
Fees 1
Fees 2
Discount
Percentage

Discount is the difference between Fees1 and Fees2 (Fees1 - Fees2). Percentage is Fees1/Fees2. The grid has aggregates for the Fees 1 column, Fees 2 column, and Discount column (these are all Sums). Doing a Sum or Average on the Percentage column will not give me the right number...what I need to do is take the Sum(Fees1)/Sum(Fees2) to get the Average Percentage...

So, is there a way to show an aggregate value for a column (the Average Percentage) that is calculated from the aggregates of other columns? 

Thanks
Tye
Tye
Top achievements
Rank 1
 answered on 25 Feb 2011
2 answers
153 views
Hi,

To sum it up: I am trying to resize an iFrame on a RadPane to fit 100% height.  

The Scenario: My project is based on the Webmail demo, but in the bottom Pane I want to have an iFrame which correctly resizes then the Splitter is dragged.

I tried to add a client side Javascript block of code on the OnClientResized event of the RadPane, but it does not seem to be triggered and thereby resizing the iFrame.  

I don't know if it would be easier to use the ContentURL property to use the RadPane as an iFrame, but do not know how to amend the demo to use a datasource to get the URL as I currently use the same DetailsView as in the demo to effect the iFrame src property.  When I set the ContentURL at design time then the Grid does not render any details.  

Sorry, but this is my first attempt at using the Telerik AJAX controls.

Regards,
Ray
Svetlina Anati
Telerik team
 answered on 25 Feb 2011
1 answer
121 views
Hi, I have a Rad Editor that has the document manager to allow the user to upload documents to the server. Now it only allows files with the extension .txt, .pdf, .doc.   I would like to also allow it to upload files with other extensions such as .ppt, .zip, .xlsm  etc.  Is there a way I can do this?

Thanks!
Rumen
Telerik team
 answered on 25 Feb 2011
3 answers
163 views
Hi Telerik Team

I am facing an issue with Detail table view page size change event. In My design I have one MasterTableView and three detail table view as coded below.

<telerik:RadGrid ID="radGrid"  AllowFilteringByColumn="true" AutoGenerateColumns="false" runat="server" >
    <MasterTableView Name="masterTableView" runat="server" HierarchyLoadMode="ServerOnDemand">     
        <CommandItemTemplate>        
            <table width="100%" cellpadding="3px">
                <tr >
                       <td align="center">
                        <div id="divCommandButtons" runat="server">
                            <asp:LinkButton ID="LinkButton1" Text="Button" Visible="false" CssClass="black-button" runat="server" />
                            <img id="spacer1" f" border="0" heigth="5" width="0" runat="server"/>
                            </div>                                                                
                    </td>
                </tr>                
            </table>               
        </CommandItemTemplate>                  
        <CommandItemStyle HorizontalAlign="Center" Wrap="false" Height="30"/>  
        <PagerStyle CssClass="rgPager" />
        <DetailTables >
            <telerik:GridTableView Name="detailTableL1" Width="100%" runat="server"  HierarchyLoadMode="ServerOnDemand" >
                    <ParentTableRelation>
                        <telerik:GridRelationFields DetailKeyField="" MasterKeyField="" />
                    </ParentTableRelation>                        
                   <CommandItemStyle CssClass="GridCommand" />
                   <CommandItemTemplate>
                        <table width="100%" cellpadding="3px">
                             <tr>                             
                                <td align="center" >                                                                            
                                 </td>
                            </tr>
                        </table>    
                    </CommandItemTemplate>                        
                    <PagerStyle CssClass="rgPager" />
                    <EditFormSettings EditColumn-UpdateText="<span>Save</span>" EditColumn-InsertText="<span>Save</span>" EditColumn-CancelText="<span>Cancel</span>"/>
                  <AlternatingItemStyle BackColor="#F3F6F9" />


and the issue I am facing is with ChanePageSize in Detail Table View. For Master table view when I change its page size its works for me. Also when i tried to move page by page in detail table view it works but when i change page size say 10 to 20 in detail table it not working.

The way i set pager template and size from CS page.

 masterView.SetPaging(GridPagerMode.NextPrevAndNumeric);
 public void SetPaging(GridPagerMode pagerMode, int pageSize)
        {
            this.GridTableView.AllowPaging = true;      
            this.GridTableView.PagerStyle.Mode = pagerMode;
            this.gridTableView.PagerStyle.AlwaysVisible = true;
        }


Thanks..

 
Vikram
Top achievements
Rank 1
 answered on 25 Feb 2011
3 answers
99 views

Been struggling for some time, have tried support, but not getting a clear answer for what I think is a pretty common scenario. The typical response I get is that at least one element needs to have a fixed height in order to use 100% hieght.

Just looking to make a UI that scales with the browser using Telerik controls. Things work ok with individual controls, things work fine, if you combine controls, then things go bad.

So here is the basic example to start where there is a splitter, tool bar, grid, tab strip and multipage.

Having just a splitter with grids with 100% height works great. Then you want to add some tabs or toolbars, and now the grids cannot calculate 100% height properly (does not account for other control height).

Any recommendations on how to use these controls to properly scale with the browser?

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Test.aspx.vb" Inherits="SS.Test" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<head id="Head1" runat="server">
    <title>FullWindow</title>
    <style type="text/css">
        html, body, form
        {
            height: 100%;
            margin: 0px;
            padding: 0px;
            overflow: hidden;
        }
    </style>
</head>
<body>
    <telerik:RadScriptBlock runat="server">
        <script type="text/javascript">
   
        </script>
    </telerik:RadScriptBlock>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="sc1" runat="server" ScriptMode="Release">
    </telerik:RadScriptManager>
    <telerik:RadAjaxManager ID="ram1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="grid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                    <telerik:AjaxUpdatedControl ControlID="RadGrid2" />
                    <telerik:AjaxUpdatedControl ControlID="RadGrid3" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadSplitter ID="RadSplitter1" runat="server" Height="100%" Width="100%" Orientation="Horizontal" PanesBorderSize="0" BorderSize="0">
        <telerik:RadPane ID="topPane" runat="server" Scrolling="None">
            <telerik:RadToolBar ID="toolbar1" runat="server" Width="100%">
                <Items>
                    <telerik:RadToolBarButton Text="command 1">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton Text="command 2">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton Text="command 3">
                    </telerik:RadToolBarButton>
                </Items>
            </telerik:RadToolBar>
            <telerik:RadGrid ID="grid1" Width="100%" Height="100%" runat="server">
                <ClientSettings Selecting-AllowRowSelect="true" EnablePostBackOnRowClick="true" Scrolling-AllowScroll="true" Scrolling-UseStaticHeaders="true">
                </ClientSettings>
            </telerik:RadGrid>
        </telerik:RadPane>
        <telerik:RadSplitBar runat="server">
        </telerik:RadSplitBar>
        <telerik:RadPane ID="bottomPane" runat="server" Scrolling="None">
            <telerik:RadTabStrip ID="tab1" runat="server" MultiPageID="mp1">
                <Tabs>
                    <telerik:RadTab Text="Tab 1" Selected="true">
                    </telerik:RadTab>
                    <telerik:RadTab Text="Tab 2">
                    </telerik:RadTab>
                    <telerik:RadTab Text="Tab 3">
                    </telerik:RadTab>
                </Tabs>
            </telerik:RadTabStrip>
            <telerik:RadMultiPage ID="mp1" runat="server" SelectedIndex="0">
                <telerik:RadPageView ID="RadPageView1" runat="server">
                    <telerik:RadGrid ID="RadGrid1" Width="100%" Height="100%" runat="server">
                        <ClientSettings Scrolling-AllowScroll="true" Scrolling-UseStaticHeaders="true">
                        </ClientSettings>
                    </telerik:RadGrid>
                </telerik:RadPageView>
                <telerik:RadPageView ID="RadPageView2" runat="server">
                    <telerik:RadGrid ID="RadGrid2" Width="100%" Height="100%" runat="server">
                        <ClientSettings Scrolling-AllowScroll="true" Scrolling-UseStaticHeaders="true">
                        </ClientSettings>
                    </telerik:RadGrid>
                </telerik:RadPageView>
                <telerik:RadPageView ID="RadPageView3" runat="server">
                    <telerik:RadGrid ID="RadGrid3" Width="100%" Height="100%" runat="server">
                        <ClientSettings Scrolling-AllowScroll="true" Scrolling-UseStaticHeaders="true">
                        </ClientSettings>
                    </telerik:RadGrid>
                </telerik:RadPageView>
            </telerik:RadMultiPage>
        </telerik:RadPane>
    </telerik:RadSplitter>
    </form>
</body>
</html>

Imports System.Data.SqlClient
  
Public Class Test
    Inherits System.Web.UI.Page
  
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  
  
        If IsPostBack = False Then
  
            Dim dt As New DataTable
  
            dt.Columns.Add("Data")
  
            Dim row As DataRow
  
            For i = 1 To 100
  
                row = dt.NewRow
                row("Data") = i
                dt.Rows.Add(row)
  
            Next
  
            grid1.DataSource = dt
            grid1.DataBind()
  
        End If
  
  
    End Sub
  
  
  
    Private Sub grid1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles grid1.SelectedIndexChanged
  
        Dim dt As New DataTable
  
        dt.Columns.Add("Data")
  
        Dim row As DataRow
  
        For i = 200 To 300
  
            row = dt.NewRow
            row("Data") = i
            dt.Rows.Add(row)
  
        Next
  
        RadGrid1.DataSource = dt
        RadGrid1.DataBind()
  
        dt = New DataTable
  
        dt.Columns.Add("Data")
  
  
  
        For i = 300 To 400
  
            row = dt.NewRow
            row("Data") = i
            dt.Rows.Add(row)
  
        Next
  
        RadGrid2.DataSource = dt
        RadGrid2.DataBind()
  
        dt = New DataTable
  
        dt.Columns.Add("Data")
  
  
        For i = 400 To 500
  
            row = dt.NewRow
            row("Data") = i
            dt.Rows.Add(row)
  
        Next
  
        RadGrid3.DataSource = dt
        RadGrid3.DataBind()
  
  
    End Sub
  
End Class


Pavlina
Telerik team
 answered on 25 Feb 2011
13 answers
265 views
I created the following server control by creating the readonly property:

    public class RadComboBox : Telerik.Web.UI.RadComboBox
    {
        private Label lbl = new Label();
        private bool _readOnly;
        public bool ReadOnly
        {
            get
            {
                return _readOnly;
            }
            set
            {
                _readOnly = value;
            }
        }
protected override void Render(System.Web.UI.HtmlTextWriter writer)
    {
        if (_readOnly)
        {                        
            lbl.Text = this.Text;
            lbl.ReadOnly = true;
            lbl.RenderControl(writer);
        }
        else
        {
            base.Render(writer);
        }
    }
if I use this object with RadGrid in GridTemplateColumn fixed in the ItemTemplate ReadOnly to true cause the following JS error message:

Error 'undefined' is null or not an object

radgrid is into a RadAjaxPanel and uses a masterpage that call the RadScriptManager and RadAjaxManager.

I tried to use ajaxSettings instead of RadAjaxPanel but the same error.

how can I fix it?

thanks for any replies
Vasil
Telerik team
 answered on 25 Feb 2011
2 answers
128 views
Hi All,
          Im using my Login Button inside the RadDock and i can't set the defaultbutton property of my page's form tag.Also i cant get my controls in script which is inside RadDock.I solved it by getting the clientID of btLogin .

  (ie):document.getElementById("<%=btLogin.ClientID %>")

and same problem might have been occured with defaultbutton .Here is my design.

 <form id="form1" runat="server" defaultbutton="btLogin">
<div>
<telerik:RadDockZone ID="rdzLogin" runat="server" Width="100%" Height="350px">
         <telerik:RadDock ID="rdLogin" Title="<b>Login</b>" runat="server" EnableAnimation="true"
             DefaultCommands="None" EnableDrag="false" Skin="Default" EnableRoundedCorners="true">
              <ContentTemplate>
                   <asp:Button ID="btLogin" runat="server" Login" OnClick="btLogin_Click" />
             </ContentTemplate>
        </telerik:RadDock>
    </telerik:RadDockZone> 
       </div>
</form>

I get the following error while setting defaultbutton in form tag itself and when i remove it no problem occurs :

The DefaultButton of 'form1' must be the ID of a control of type IButtonControl.

Can i set defaultbutton from code behind? Please Help me out...

Regards and Thanks,
    Titti.S

TSM
Top achievements
Rank 1
 answered on 25 Feb 2011
6 answers
49 views
I added a RadPanelBar to my project for the first time today. 

It immediately asks that you select "Build RadPanelBar" to begin creating the control.

I go into that, add some test bars, change the text, etc... Then I click OK.  In my design view I see the bars, text, font changes, etc... However, in the source view nothing happens.  Nothing is changed, so if I make any source changes then everything about my bars is lost.  I ended up just editing the RadPanelBar source by hand to add my items and make my font changes.

What am I doing wrong?  Why aren't my modifications made through the editor tool working?  I click "OK" when I finish and the design view changes, but the source remains empty.  It's odd because if I go back into the editor it still has all my settings in there, they just never move over to the Source view.

Is there something I need to do to actually commit the changes made in the RadPanelBar editor to my project?
Greg St.Pierre
Top achievements
Rank 1
 answered on 25 Feb 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
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?