Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
316 views
Can someone post how to remove all items from a RadListBox?  This below code in the cs file doesn't work.

 

foreach (RadListBoxItem item in RadListBox1.Items)

 

 {

 

    item.Remove();

 

    //RadListBox1.Items.Remove(item);

}

My (hopefully temporary) workaround for this is that I create an empty DataSet and rebind that to the RadListBox.

Mathew
Top achievements
Rank 1
 answered on 25 Feb 2011
2 answers
102 views
We're using the Grid_RowDrop EventHandler to perform a few operations after a row is dropped from one grid to another. The only issue we've run into is that we need to dynamically change some text outside of the two grids after the drop occurs. One possible way to do this would be with some Javascript, but while it's easy to call Javascript before the drop finishes with OnRowDropping and OnRowDropped, I can't find a way to call Javascript after the Grid_RowDrop EventHandler completes. If there's a way to do this, it would be great to know.

On the other hand, if it's better to update this text from within the Grid_RowDrop EventHandler itself by putting the text in a control (RadAjaxPanel maybe?), that would work too. We'd appreciate some advice either way on the best solution to this problem. Thanks.
Mike
Top achievements
Rank 1
 answered on 25 Feb 2011
3 answers
141 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
177 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
210 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
168 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
133 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
179 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
123 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
282 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
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?