Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
290 views
I am trying to add a button to the RadFileExplorer's Toolbar that will allow a user to rename a file (but will run custom programming in the code-behind), and I added the button to the Toolbar as follows:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 
        AddHandler rfeDocuments.ToolBar.ButtonClick, AddressOf toolBar_ButtonClick 
        Dim customButton As New RadToolBarButton() 
        customButton.CssClass = "test_button" 
        customButton.CommandName = "Rename" 
        customButton.Value = "TEST" 
        customButton.Text = "Rename" 
        rfeDocuments.ToolBar.Items.Add(customButton) 
End Sub 

This makes the button display in the toolbar properly.  I then try to capture the Click event using the following code:
    Protected Sub toolBar_ButtonClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadToolBarEventArgs) 
        Label1.Text = e.Item.Value
    End Sub 

When I click my Rename button, the Label says "Delete".  When I click the Refresh or Open buttons, the label displays the correct Value.  I have also tried capturing the Text of e.Item and that has not worked either, it comes back as  .  Do you have any examples of a fully functioning custom button working on the RadFileExplorer.Toolbar with the Click event being handled?  My goal is to prompt the user for the new filename then create a copy of the selected file with the new name.
Fiko
Telerik team
 answered on 28 Oct 2009
1 answer
279 views
Hi All,

How to find the "ImageButton" in the code block below from code behind page ? Code block below is part of rad grid html code in aspx file.

<rad:GridEditCommandColumn ButtonType="ImageButton" EditImageUrl="../Images/editItem.gif">
                                        <HeaderStyle Font-Bold="True" Wrap="False" />
                                        <ItemStyle Wrap="true" />
                                    </rad:GridEditCommandColumn> 

Also after finding this button, i need to write some code on click event of this button in GridEditCommandColumn . So which event i should use for this ?


Thanks in advance
Rahul
Princy
Top achievements
Rank 2
 answered on 28 Oct 2009
1 answer
145 views
Hi telerik,

I have an ASP Table with collection of RadNumericTextBoxes inside it. like this:
<asp:Table ID="tblMatrix" runat="server" CellSpacing="3" CellPadding="3">
         <asp:TableRow runat="server" ID="tblBodyRow_1">
                   <asp:TableCell runat="server" ID="tblBodyCell_R1_C2" Width="75px">
                            <telerik:RadNumericTextBox ID="txtQty_R1_C2" runat="server" Skin="AsiSkin" EnableEmbeddedSkins="False"
                                                                      Width="75px" Value="0">
                                <NumberFormat AllowRounding="false" KeepNotRoundedValue="true" DecimalDigits="0" />
                            </telerik:RadNumericTextBox>
                        </asp:TableCell>
                          .................. other cells
         </asp:TableRow >
         ................ other rows
</asp:Table >

on blur event of each text box I need to calculate total of all values in all text boxes. How do I do it in javascript?
Currently I have an OnBlure event where I traverse all textboxes inside table trying to calc. the sum... however it looks like the rendered
RadNumericTextBox consists of more then one html input control and the value of the visible control is not numeric...  Here is my code:
       ///////////////////////// =========== OnBlur Events =========== ////////////////////////////////// 
        function QtyTxt_OnBlur()  
        {             
            var cntrlMtrxTable = $get('<%= tblMatrix.ClientID %>');             
            if (cntrlMtrxTable)  
            { 
                CalculateMatrixTotals(cntrlMtrxTable); 
            } 
        } 
 
        /////////////////////////////////// UTILITIES //////////////////////////////////////// 
         
        ////////////////////////////////////////////////////////////////////////////////////// 
        /// Name: CalculateMatrixTotals() 
        /// Function Type: Event 
        /// Parameters:          
        ///////////////////////////////////////////////////////////////////////////////////// 
        function CalculateMatrixTotals(cntrlMtrxTable)  
        {             
            var cntrlTotalUsed = $get('<%= txtTotalUsed.ClientID %>'); 
            var cntrlTotalLeft = $get('<%= txtTotalLeft.ClientID %>'); 
            var cntrlCurrentLITotalQty = $get('<%= hdnCurrentLITotalQty.ClientID %>'); 
            var sumOfMatrixQty = 0; 
 
            var myInputArray = cntrlMtrxTable.getElementsByTagName("INPUT"); 
            for (var i = 0; i < myInputArray.length; i++)  
            { 
                var currInput = myInputArray[i]; 
                if (currInput.type == "text" && currInput.style.visibility != 'hidden' && currInput.id.indexOf('txtQty_') >= 0)  
                { 
                    sumOfMatrixQty += currInput.value; 
                }               
            } 
 
            if (cntrlTotalUsed && cntrlTotalLeft && cntrlCurrentLITotalQty)  
            { 
                var LITotalQty = cntrlCurrentLITotalQty.value; 
                cntrlTotalUsed.value = sumOfMatrixQty; 
                cntrlTotalLeft.value = LITotalQty - sumOfMatrixQty; 
                alert('cntrlTotalUsed.value = ' + cntrlTotalUsed.value); 
                alert('cntrlTotalLeft.value = ' + cntrlTotalLeft.value) 
                alert('sumOfMatrixQty = ' + sumOfMatrixQty); 
            } 
        } 
         
    </script> 
 
</telerik:RadScriptBlock> 




Yavor
Telerik team
 answered on 28 Oct 2009
5 answers
125 views

Hello ,
i am using a radRotator emedded in webpart the rotator works fine in asp web application , but when i use my web part the rotator didn't works fine . it didn't rotate to all item it just display the item no 2 then the rotator rotate to an empty item .and stop and nothing else occures ,

here is rotator

<%

@ Control Language="C#" AutoEventWireup="true" Inherits="SACMSharePointWebPart.uc_FastTickerNews" %>

 

<%

@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI, Version=2009.1.402.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4" %>

 

        <telerik:RadRotator ID="NewsRotator" RotatorType="AutomaticAdvance" ScrollDirection="Up" 
            SlideShowAnimation-Type="Fade" ScrollDuration="200" runat="server" Width="100%" 
            FrameDuration="6000" ItemHeight="30px" ItemWidth="100%" Height="30px" InitialItemIndex="0" 
            Skin="Vista">  
            <ItemTemplate> 
                <table style="text-align: right;">  
                    <tr style="height: 30px;">  
                        <td> 
                            <div style="width: 100%; filter: alpha(opacity=90); font-weight: bold; font-family: Tahoma;  
                                background-color: #fff"> 
                                <%# Eval("Location") %> 
                                &nbsp; :&nbsp;</div> 
                        </td> 
                        <td style="padding-left: 10px">  
                            <div style="width: 100%; filter: alpha(opacity=90); font-family: Tahoma;  
                                background-color: #fff"> 
                                <telerik:RadTicker ID="RadTicker1" runat="server">  
                                    <Items> 
                                        <telerik:RadTickerItem Text='<%# Eval("Title") %>' /> 
                                    </Items> 
                                </telerik:RadTicker> 
                            </div> 
                        </td> 
                    </tr> 
                </table> 
            </ItemTemplate> 
        </telerik:RadRotator> 

and the rotator code behind
    public class uc_FastTickerNews : UserControl  
    {  
        public RadRotator NewsRotator  
        {  
            get 
            {  
                return this.FindControl("NewsRotator") as RadRotator;  
            }  
        }  
 
        /// <summary>  
        /// Handles the Load event of the Page control.  
        /// </summary>  
        /// <param name="sender">The source of the event.</param>  
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>  
        protected void Page_Load(object sender, EventArgs e)  
        {  
            List<TickerNewsContainer> lst = new List<TickerNewsContainer>();  
            lst.Add(new TickerNewsContainer { Title = "NEW NEWS", Location = "LOCATION 1" });  
            lst.Add(new TickerNewsContainer { Title = "NEW NEWS", Location = "LOCATION 2 " });  
            lst.Add(new TickerNewsContainer { Title = "NEW NEWS", Location = "3 LOCATION" });  
            lst.Add(new TickerNewsContainer { Title = "NEW NEWS", Location = "LOCATION4 " });  
            lst.Add(new TickerNewsContainer { Title = "NEW NEWS", Location = "5 LOCATION" });  
            lst.Add(new TickerNewsContainer { Title = "NEW NEWS", Location = "6 LOCATION" });  
            lst.Add(new TickerNewsContainer { Title = "NEW NEWS", Location = "LOCATION7 " });  
            lst.Add(new TickerNewsContainer { Title = "NEW NEWS", Location = "8 LOCATION" });  
            lst.Add(new TickerNewsContainer { Title = "NEW NEWS", Location = "9 LOCATION" });  
            lst.Add(new TickerNewsContainer { Title = "NEW NEWS", Location = "10 LOCATION" });  
            lst.Add(new TickerNewsContainer { Title = "NEW NEWS", Location = "LOCATION 11" });  
            lst.Add(new TickerNewsContainer { Title = "NEW NEWS", Location = "LOCATION 12 " });  
            lst.Add(new TickerNewsContainer { Title = "NEW NEWS", Location = "13 LOCATION" });  
            lst.Add(new TickerNewsContainer { Title = "NEW NEWS", Location = "LOCATION14 " });  
            lst.Add(new TickerNewsContainer { Title = "NEW NEWS", Location = "15 LOCATION" });  
            lst.Add(new TickerNewsContainer { Title = "NEW NEWS", Location = "16 LOCATION" });  
            lst.Add(new TickerNewsContainer { Title = "NEW NEWS", Location = "LOCATION17 " });  
            lst.Add(new TickerNewsContainer { Title = "NEW NEWS", Location = "18 LOCATION" });  
            this.NewsRotator.DataSource = lst;  
            this.NewsRotator.DataBind();  
        }  
    } 


alse here is the web part code

   [

Guid("d879501c-6386-4646-bd57-cd012ca9f6e6")]

 

 

   public class SACMFastTickerNews : System.Web.UI.WebControls.WebParts.WebPart

 

   {

 

       public uc_FastTickerNews FastTickerNews { get; set; }

 

 

       
       public
SACMFastTickerNews()

 

       {

       }

       protected override void CreateChildControls()  
        {  
            base.CreateChildControls();  
            this.FastTickerNews = (uc_FastTickerNews)Page.LoadControl("~/_controltemplates/uc_FastTickerNews.ascx");  
            this.Controls.Add(this.FastTickerNews);  
        }
        #region Events & Fixers  
 
        protected override void OnInit(EventArgs e)  
        {  
            base.OnInit(e);  
         ScriptManager scriptManager = ScriptManager.GetCurrent(this.Page);  
            if (scriptManager == null)  
            {  
                scriptManager = new ScriptManager();  
                if (this.Page.Form.FindControl("ScriptManager1") == null)  
                {  
                    scriptManager.ID = "ScriptManager1";  
                    this.Page.Form.Controls.AddAt(0, scriptManager);  
                }  
            }  
            return scriptManager;  
        }
        #endregion 
   }

please help me :)
Fiko
Telerik team
 answered on 28 Oct 2009
4 answers
438 views

I have columns with defined CssClass, like this one, for instance:

<telerik:GridBoundColumn HeaderStyle-CssClass='GridHeaderGreen ca' ItemStyle-CssClass='ca' HeaderText='Status' SortExpression='Wizard.AlertStatus.Name' DataField='Status.Name' />

In some cases I want to override the look of row cells for every column, i.e. i need to take ItemStyle.CssClass for the column and complement it with some additional class:

protected void rgAlertConfigView_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
if ((e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem) && e.Item.DataItem != null)
{

....
for (var i = 0; i < item.Cells.Count; i++)
{
item.Cells[i].CssClass = String.Format("{0} {1}", item.OwnerTableView.Columns[i].ItemStyle.CssClass, [some class depending on data in the row]); 
}
}

rgView_ItemCreated(sender, e);
}

This stuff does not work, because there is some mess: item.Cells.Count = 12, item.OwnerTableView.Columns.Count = 10 (this is correct value) and there is no straight correspondence between Cell and Column and I cannot see how to establish it (?)

Every cell should be able to 'know' what is its column style.

p.s. Thanks to myself! At last I found solution:

for (var i = 0; i < item.OwnerTableView.Columns.Count; i++)
{
item[item.OwnerTableView.Columns[i]].CssClass = String.Format("{0} {1}{2}", item.OwnerTableView.Columns[i].ItemStyle.CssClass, item[item.OwnerTableView.Columns[i]].CssClass, dimmed);
}

Alexander
Top achievements
Rank 1
 answered on 28 Oct 2009
0 answers
75 views
i have a rad combobx which have two columns headings: Emp_ID and Emp_Name.
this is my .aspx page.



<%

@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Multicolumntest._Default" %>

 

<%

 

@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

 

 

 

<!

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

<

 

html xmlns="http://www.w3.org/1999/xhtml" >

 

<

 

head runat="server">

 

 

 

<title>Untitled Page</title>

 

</

 

head>

 

<

 

body>

 

 

 

<form id="form1" runat="server">

 

 

 

<div>

 

 

 

 

<asp:

 

 

 

<asp:ScriptManager ID="ScriptManager1" runat="server">

 

 

 

</asp:ScriptManager>

 

 

 

 

<telerik:RadComboBox ID="RadComboBox1" Height="290px" Width="420px" runat="server" Skin="Vista"

 

 

 

onitemsrequested="RadComboBox1_ItemsRequested"

 

 

 

onselectedindexchanged="RadComboBox1_SelectedIndexChanged"

 

 

 

onitemdatabound="RadComboBox1_ItemDataBound">

 

<

 

CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>

 

<

 

HeaderTemplate>

 

<

 

table>

 

 

 

<tr>

 

 

 

<td width="100px">

 

 

 

<b>EmployeeName</b>

 

 

 

</td>

 

 

 

<td width="200px">

 

 

 

<b>EmployeeID</b>

 

 

 

</td>

 

 

 

 

</tr>

 

 

 

</table>

 

</

 

HeaderTemplate>

 

<

 

ItemTemplate>

 

</

 

ItemTemplate>

 

</

 

telerik:RadComboBox>

 

 

 

 

 

</div>

 

 

 

</form>

 

</

 

body>

 

</

 

html>

 

 





i want to add some items to these columns from windows sharepoint list. so please help me if someone knows about it.
please write C# and .aspx page code
Thanks
Ahmad Nawaz
Top achievements
Rank 1
 asked on 28 Oct 2009
3 answers
146 views
Hi,

i have recognized, that the RadEditor has an powerful HtmlRepair function.
If i set the content of the editor:
<div><li>test<li>test2</li></div> 
 

it produces an output like this
<div> 
<li>test</li> 
<li>test2</li> 
</div> 
 

Now i have the problem that i have to use this html-repair functionality without the editor.
Is this possible?

Thanks in advance!


Rumen
Telerik team
 answered on 28 Oct 2009
1 answer
119 views
Hi,

I have created a master gridview with a child gridview and I would like to insert a new record into the child grid using a user control. 

My only problem is that in this child user control, I need to know which parent record the child record belongs to.  Is there a way from within the user control to determine this?  

Thanks,
Mel
 
Princy
Top achievements
Rank 2
 answered on 28 Oct 2009
1 answer
197 views
Hi

Im trying to build a toolbar which consists of 3 sets of buttons grouped over 3 rows e.g.
[row #1]
[row #2]
[row #3]

I've set my toolbar to ShowOnFocus and am using the technique described in this article to ensure that the toolbar appears in a single <Div> at the top of the page.  My problem is how do I force my toolbar buttons to appear in separate rows ?  All my toolbar buttons seem to take up all available width before spilling onto a new line (meaning that I end up with only 1 or 2 toolbar rows - not the 3 which I want).

Q1
From what I can see the width of the toolbar is controlled via CSS and there is nothing in the XML documentation which allows me to declare a new row in my toolbar.  How can I achieve this ?

Q2
Also, I note in the documentation an attribute <tools IsRibbon="true"> which should make my toolbar be displayed as a Microsoft Office style ribbon.  On setting this I do not see any difference in the appearance of my toolbar.  Is there something else I need to set to make this work ?

Q3
I have added a custom toolbar button which hides the editor and displays its contents using a <DIV> (basically to simulate what the final page will look like).  When this button is pressed I want to disable all other buttons in my toolbar but cannot find any documentation in the client API which will do this.  Is this possible ?

Thanks


Martin
Telerik team
 answered on 28 Oct 2009
1 answer
96 views
Is there a guide somewhere for dummies in converting a web app to a Sharepoint web part?  I have built a RadGrid with a fair amount of customization in a RadControls CSharp Web Application using Q3 2009 controls.  The online documentation regarding RadControls and Sharepoint has info on how to create a web part from scratch with RadControls but not in converting an existing web app.  Based upon my search for a solution so far, it seems I might have to convert the web app to a user control first, which I've tried, but have yet to be successful.

Has anyone done a conversion such as this before?  Any insight would be greatly appreciated.

Thanks,
Tim
Yavor
Telerik team
 answered on 28 Oct 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?