Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
169 views
Just wondering if there is a load complete or post render event for radscheduler? I need to begin some other processing once the scheduler is completely loaded.

Thanks,
Dan
Dan
Top achievements
Rank 1
 answered on 04 Aug 2011
3 answers
92 views
Please give code example on

I populate my treeview from sql example
Column Name : ID
Column Name : Catalogue
Column Name : ParentID

Data

1    Cataloge1      null
2.   Catalogue2    1
3.   Catalogue3    2

The tree look like this
  
  • Catalogue1

              Catalogue2
                       Catalogue3
I want to delete the middel node "Catalogue2" then node 3 "Catalogue3" must move 1 up so the tree just have 2 nodes
    

  • Catalogue1

              Catalogue3
How do i do this when treeview is populated from sql  

    
Herman
Top achievements
Rank 1
 answered on 04 Aug 2011
4 answers
217 views
Hi

I am using Radwindow as a modal popup for inline form editing.  I have created a wizard, using standard 'asp:panels', inside the ContentTemplate of the Radwindow to break up the form in to smaller chunks. In each asp:panel there is a 'next' and 'back' button which is used to navigate between them. These buttons control server side functions to show/hide the various panels during navigation, and perform some form validation etc. in the background.  I need this server side functionality. 

I would like the Radwindow to resize the height automatically in each Panel of the wizard (to reflect the content in that panel) and to remain centred in the browser.  When I first open the Radwindow it autosizes to the content in the first Panel.  However when I click the 'next' button to show the second content panel in the wizard, the height remains stuck at the height of the first Panel - it doesn't resize to the new content height of the second panel.

I have searched around but have not found a similar scenario to auto resize the Radwindow in a wizard Panel navigation.  Any ideas?

The Telerik controls are Q3 2010 and it's ASP.NET 3.5. Thanks in advance.

Cheers

Kevin

P.S. I have also added a Div, with a width, in the Radwindow ContentTemplate
as it doesn't resize properly without this - is there a more elegant solution so that I can remove this Div ideally?  As I said I want to keep theRadwindow width constant - just vary height.

Secondly can I generally use RadAjaxpanel instead of asp:panel in pages?  Is there a benefit or overhead to this? Sorry for all the questions but am new to these controls :)

<asp:Button ID="ButtonAddNew" Text="Open RadWindow" runat="server" CausesValidation="false" OnClick="ButtonAddNew_Click" />
   
  
<telerik:RadWindowManager ID="RadWindowManager01" Modal="true" runat="server">
        <Windows>
  
         </Windows>
</telerik:RadWindowManager>
  
   
  
 <telerik:RadWindow ID="RadWindowImageEdit"
            InitialBehaviors="Pin"
            Skin="Sitefinity"
            Width="920"
            AutoSize="true"
            AutoSizeBehaviors="Height"
            EnableEmbeddedSkins="false"
            EnableEmbeddedBasestylesheet="false"
            Behaviors= "Close" 
            VisibleTitlebar="true"
            VisibleStatusbar="false"
            KeepInScreenBounds="true"      
            EnableShadow="false"
            VisibleOnPageLoad = "False"
            Modal="true"
            runat="server">
 
    <ContentTemplate>
 
 <div style="width: 867px; padding: 10px;">
 
    <telerik:RadAjaxPanel ID="RadAjaxPanel2" runat="server">
      
    
            <asp:Panel ID="panel01" runat="server">
                <!--Form part 1 content here -->
                <asp:Button ID="ButtonNext01" Text="Button1" ValidationGroup="vgText" CausesValidation="True" runat="server"
                    OnClick="OnClick_ButtonNext01" />
            </asp:Panel>
 
            <asp:Panel ID="panel02" runat="server">
                <!--Form part 2 content here -->
                <asp:Button ID="Buttonback02" ValidationGroup="vgText" Text="Button2" CausesValidation="True" runat="server"
                    OnClick="OnClick_Buttonback02" />
            </asp:Panel>
 
     
         
        </telerik:RadAjaxPanel>
  </div>
    </ContentTemplate>
</telerik:RadWindow>



Marin Bratanov
Telerik team
 answered on 04 Aug 2011
3 answers
301 views
Dear Sir:
   I have a radgrid with paging for search result, when the user search a large number of record and it take long time to retrieve the data from the stored procedue . In fact, the user normally just look at the first few page in the grid only but they still have suffer the time for get the whole result set from the database. is there anyway/sample to retrieve the record by page and how can i handle the sorting and filtering?

From CH
Radoslav
Telerik team
 answered on 04 Aug 2011
6 answers
382 views
Hi,

I can able to format the cells of the RadGrid.  I want to format footer and group footer based on some condition like in the following code. 
Look at the following code which i format for the cell:
Protected Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound  
        'Is it a GridDataItem  
        If (TypeOf (e.Item) Is GridDataItem) Then  
            'Get the instance of the right type  
            Dim dataBoundItem As GridDataItem = e.Item  
 
            Dim a As New ArrayList  
            a.Add("M9_Sep")  
            a.Add("M10_Oct")  
            a.Add("M11_Nov")  
            a.Add("M12_Dec")  
            a.Add("M1_Jan")  
            a.Add("M2_Feb")  
            a.Add("M3_Mar")  
            a.Add("M4_Apr")  
            a.Add("M5_May")  
 
            For i As Integer = 0 To 8  
                Dim s As Integer = 0 
                Integer.TryParse(dataBoundItem(a(i)).Text, s)  
 
                Select Case s  
                    Case Is > 120  
                        dataBoundItem(a(i)).BackColor = Drawing.Color.Red  
                    Case 90 To 120  
                        dataBoundItem(a(i)).BackColor = Drawing.Color.Green  
                    Case 60 To 89  
                        dataBoundItem(a(i)).BackColor = Drawing.Color.Yellow  
                    Case Is < 60 
                        dataBoundItem(a(i)).BackColor = Drawing.Color.Purple  
                End Select  
            Next  
        End If 

Thanks.

Regards
Syed Arshad

Tsvetina
Telerik team
 answered on 04 Aug 2011
0 answers
125 views
Hello,
I have a table colulmn which contains some IDs. And I have a List<something> which contains reference values for those IDs. Is there a simple way to display those values in the grid column?
It's not possible to use data relations and so on, and the only way to get data is the way described above. And it's not possible to use a ComboBox to display data. I tried to create a template column and put the label there but this would take very much time when combination of large lists and tables is used. Is there a way to do that faster?

Here is what I do in template:
public override void InstantiateIn(Control container)
        {
            Label lbl = new Label();
            lbl.DataBinding += label_DataBinding;
            container.Controls.Add(lbl);
}        
 
        void label_DataBinding(object sender, System.EventArgs e)
        {
            Label lbl = (Label)sender; 
            GridDataItem dataItem = lbl.NamingContainer as GridDataItem;
            DataRowView drv = (DataRowView)dataItem.DataItem;
            RefItem item = Item.refdef.ItemsFlat.Find(m => m.Id == drv[Item.user_name].ToGuid());
            if (item == null)
            {
                lbl.Text = "";
                return;
            }
            lbl.Text = item.Caption;
        }
Dmitry
Top achievements
Rank 1
 asked on 04 Aug 2011
0 answers
119 views
Hi, I have the following problem, I have an Ajax Accordion and I have a js callAccordionExtender.js in the master page I have RadScriptManager and sends me the nexterror: Microsoft JScript runtime error: Object does not support this property or method, couldhelp?

pag. aspx
<%@ Page Language="VB" MasterPageFile="~/MasterPages/master1.master"
    AutoEventWireup="false" CodeFile="page.aspx.vb" Inherits="test_page" Title="page" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphJavaScript" runat="Server">
    <script src="../Scripts/AccordionExtender.js" type="text/javascript"></script>
    <script type="text/javascript">
        var accordionAllExpanded = false;
        var launch = false;
        function pageLoad() {
            if (launch) {
                $find('<%=modalManualFee.ClientID %>').show();
            }
            setAccordionExtension();
        }
        function hideModal() {
            $find('<%=modalManualFee.ClientID %>').hide();
        }
        function launchModal() {
            launch = true;
        }
        function HideButtonOnClick(button) {
            if (typeof Page_ClientValidate != 'undefined') {
                Page_ClientValidate();
                if (Page_IsValid) button.style.display = 'none';
            }
            else {
                button.style.display = 'none';
            }
        }
        function accordionExpandAll(button) {
            $find('<%=accLocations.ClientID %>_AccordionExtender')._expandAllPanes(!accordionAllExpanded);
            if (!accordionAllExpanded) {
                button.innerText = "Collapse All";
                button.className = "button left icon_collapse"
            }
            else {
                button.innerText = "Expand All";
                button.className = "button left icon_expand"
            }
            accordionAllExpanded = !accordionAllExpanded;
        }
    </script>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="cphContentMain" runat="Server">
 <telerik:RadAjaxManager ID="AjaxManager" runat="server">
        <AjaxSettings>
 <telerik:AjaxSetting AjaxControlID="accLocations">
                <UpdatedControls>
 <telerik:AjaxUpdatedControl ControlID="pnlCart" LoadingPanelID="RadAjaxLoadingPanel" />
 </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
<ajaxToolkit:Accordion ID="accLocations" EnableViewState="true" runat="server">
                <HeaderTemplate>
.........
 </ajaxToolkit:Accordion>
</asp:Content>
file js

function setAccordionExtension() {
    Sys.Application.add_load(Sys.Extended.UI.AccordionBehavior.prototype._expandAllPanes =
                function expandAllPanes(openOrClose) {
                    this._changeSelectedIndex(-1, true);
                    for (var i = 0; i < this._panes.length; i++) {
                        // Get the animation for each pane (creating it on demand if it doesn't
                        // already exist)
                        var pane = this._panes[i];
                        var animation = this._getAnimation(pane);
                        animation._opening = openOrClose;
                        var open = null;
                        var close = null;


                        // Stop any animations that are still playing (i.e. that haven't finished
                        // opening or closing from changing previous panes)
                        if (animation.get_isPlaying()) {
                            animation.stop();
                        }


                        // Get the pane ready to be animated by setting
                        this._startPaneChange(pane, animation._opening);


                        // Setup the fade effect if we are using it
                        if (this._fadeTransitions) {
                            animation._fade.set_effect(animation._opening ? Sys.Extended.UI.Animation.FadeEffect.FadeIn :
                                Sys.Extended.UI.Animation.FadeEffect.FadeOut);
                        }


                        // Set the length animation and the target
                        if (this._autoSize === Sys.Extended.UI.AutoSize.Fill) {
                            animation.set_target(pane.content._original);
                            animation._length.set_startValue(CommonToolkitScripts.getContentSize(pane.content._original).height);
                            animation._length.set_endValue(animation._opening ? this._getRemainingHeight(true) : 0);
                        } else {
                            animation.set_target(pane.content);
                            animation._length.set_startValue(pane.content.offsetHeight);
                            animation._length.set_endValue(animation._opening ? this._getRemainingHeight(false) : 0);
                        }


                        //Open or Close all the pannels
                        if (openOrClose) {
                            animation._opening = true;
                            open = animation;


                            if (open) {
                                open.play();
                            }
                        }
                        else {
                            animation._opening = false;
                            close = animation;
                            if (close) {
                                close.play();
                            }
                        }
                    }
                }
                );
}
ROLANDO
Top achievements
Rank 1
 asked on 04 Aug 2011
3 answers
117 views
I want to display an error message in the grid if some operation has failed  (update, delete, etc)
Ive followed an example suggested in the forums, but it doesnt work

protected void RadGridImages_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            List<Business.Logic.BusinessObjects.ArtistImage> lst = new List<Business.Logic.BusinessObjects.ArtistImage>();
            int aid = -1;
            bool isOK = int.TryParse(this.HiddenArtistID.Value, out aid);
            if (isOK)
            {
                lst = artistImageManager.Get(aid);
                if (lst != null)
                {
                    this.RadGridImages.DataSource = lst;
                }
                else
                {
                    if (this.RadGridImages.DataSourceID == "")
                    {
                        this.RadGridImages.DataSource = new string[] { };
                    }
                }
            }
            if (!string.IsNullOrEmpty(gridMessage))
            {
                DisplayMessage(gridMessage);
            }
        }
        private void DisplayMessage(string text)
        {
            RadGridImages.Controls.Add(new LiteralControl(string.Format("<span style='color:red'>{0}</span>", text)));
        }

gridMessage is supplied a value when something fails, I then rebind the grid

there IS a value in gridMessage when the NeedDataSource is fired, but the error message never gets displayed.
Anyone see what Im doing wrong here ?
Maria Ilieva
Telerik team
 answered on 04 Aug 2011
2 answers
143 views
Hi,

My aspx page has radgrid and a dropdownlist. I want to populate this dropdownlist based on the value captured from a cell on selecting a single radgrid row.

I have set AllowMultiRowSelection ="false"  and on clientsettings <Selecting AllowRowSelect="True"></Selecting>.

How can I do this?

Or if am using <ClientEvents OnRowSelected="RowSelected" /> and call some javascript I can get the cell value. How will I make use of this to populate the dropdown. The dropdown population is in codebehind.

Thanks,
Shinu
Top achievements
Rank 2
 answered on 04 Aug 2011
1 answer
112 views
I would like to use RadEditor to edit content in a CMS.

Of course I want WYSIWYG editing using the same style sheet that I use in the website.

From what I have read in the forums and documentation it seems that I need to create a second style sheet just for RadEditor to use.

In my CMS system the dynamic content is in a specific container, so I hoped I could just specify the ID or class name of the container and RadEditor could use the website style sheet but this does not appear to be possible. (something like CKEDITOR's bodyClass or bodyId)

My other option, which I have used with other editors, is to make the CSS classes that are used in the content area the default for that HTML tag. For example, if all hyperlinks in the content area are to be red then that is the default for the "A" tag and if I want any other colour outside of the content area then I apply a class name to it. This method works with RadEditor except it ruins the display of toolbars and dialogs if some attributes are changed, for example LI tags. Unfortunately the RadEditor style sheet for toolbars and dialogs don't reset a lot of CSS attributes.

So my question is, is there a way of using RadEditor in this circumstance, without having to create a second style sheet and have to maintain two style sheets?
Rumen
Telerik team
 answered on 04 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?