Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
241 views
Hi,

I have a RadToolbar and a RadGrid on one page. Depending on how many row are selected in the grid some buttons in the toolbar should be active or inactive.
To achieve this I run a javascript function every time a row gets selected or deselected in the grid and I go through a switch-case to set the buttons in the right state.
So far so good, this is just some background to my problem.

My problem is that, as far as I can see, the only way to get the buttons I want to change is through the toolBar.get_items().getItem() method which takes an integer for the index of the desired item. The problem with that is that I now have to identify button by order in which they are placed, resulting in maintenance hell should the order of the buttons change.
Rather, I would like to ask the RadToolBarItemCollection collection to get me an item by specifying it's Value or CommandName.
Obviously it's not very hard to write a small function that gives me this behaviour myself, but I was wondering if it doesn't already exist and maybe I've overlooked it.
Or that there is a similar but easier approach to getting a specific button from a toolbar through it's Value or CommandName or something similar.

Regards,

Mink

Mink
Top achievements
Rank 1
 answered on 31 Aug 2009
3 answers
143 views
Hi
When I change Scheduler from Entity to WebService Drag-and-drop from grid (entity) return error after drop:
Cell index out of range 0

Please help
Peter
Telerik team
 answered on 31 Aug 2009
1 answer
135 views
I'm not sure whether to call this a bug, a feature request, or just me missing something obvious and/or doing something wrong. When I auto-tooltipify a page, and then change an element's title tag via Javascript, I would generally expect RadTooltipManager to use the new, updated title tag when displaying the tooltip. It doesn't seem to, but perhaps I'm doing something wrong. Has anyone else experienced this issue? Is the only workaround the inelegant manual update via RadTooltipManager on the client side?

In case anyone else runs into this issue, this is roughly how I'm currently working around it:
objImage.title=objImage.alt; //objImage being the element in question, currently being altered by other JS 
var objTTM=$find(strTTM); //My tooltip manager
var objTooltip = objTTM.getToolTipByElement(objImage); 
objTooltip.set_content(objImage.title); 
 

If there's a better way that doesn't involve the creation of two new objects, maybe a setting I should be including on RadTooltipManager or something along those lines, I'd love to hear it - there are situations in which I do this particular call in a loop, and while I can sometimes pre-create the tooltip manager object, that's still extra overhead I'd like to see trimmed down.

Thanks!
Svetlina Anati
Telerik team
 answered on 31 Aug 2009
1 answer
123 views

Hi,

 

I have a RadSplitter with size 100%.  It contains 2 RadPanes, the first one with a height of 152px. When I resizing the browser, the second radPane size is ok.
  

  • I do a postback and change RadSplitter visibility to hide.
  • I do a second postback and change RadSplitter visibility to show. 
  • Results:  The second RadPane is not ok when I resized the browser.

 

I have investigated RadPane control, and I found a problem with _originalHeight.

 

I reproduce problem, look code.


 

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RadPaneVisibility.aspx.cs" Inherits="BugRadPane.RadPaneVisibility" %>  
<%@ 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 id="Head1" runat="server">    
    <title></title>    
    <style type="text/css">    
    html, body, form    
    {    
      width: 100%;  
      height: 100%;    
      margin: 0;    
      paddding: 0;    
      overflow: hidden;  
    }    
        
    </style>   
</head>   
 
<body id="Service" style="margin: 0px; text-align: left;">    
    <form id="Form1" runat="server" method="post">   
        <asp:ScriptManager ID="RadScriptManager" runat="server"></asp:ScriptManager>  
                  
        <asp:Button ID="VisibilityOff" runat="server" Text="Off" OnClick="OnOff" />  
        <asp:Button ID="VisibilityOn" runat="server" Text="On" OnClick="OnOn" />  
          
        <telerik:RadSplitter ID="RadSplitter1" runat="server" Orientation="Horizontal" Height="100%" Width="100%">  
            <telerik:RadPane ID="RadPane1" runat="server" Height="152px">  
                Ruban  
            </telerik:RadPane>              
            <telerik:RadPane ID="RadPane2" runat="server">  
                Content  
            </telerik:RadPane>  
        </telerik:RadSplitter>       
    </form>  
</body>  
</html> 

 

using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Web;  
using System.Web.UI;  
using System.Web.UI.WebControls;  
 
namespace BugRadPane  
{  
   public partial class RadPaneVisibility : System.Web.UI.Page  
   {  
      protected void Page_Load(object sender, EventArgs e)  
      {  
 
      }  
 
      protected void OnOff(object sender, EventArgs e)  
      {  
         RadSplitter1.Visible = false;  
      }  
 
      protected void OnOn(object sender, EventArgs e)  
      {  
         RadSplitter1.Visible = true;  
      }  
   }  
} 

 

Thanks

 

Annie

Svetlina Anati
Telerik team
 answered on 31 Aug 2009
1 answer
127 views
Based on an example from another thread I am using the following command to open a dialog window from the link manager:
 Type.registerNamespace("Telerik.Web.UI.WindowBehaviors");

function ShowCustomDialog(popupUrl, width, height)
{ 
...
    var dialogOpener = Telerik.Web.UI.Dialogs.CommonDialogScript.get_windowReference().get_dialogOpener();

    dialogOpener.openUrl( 
        popupUrl, argument, width, height, callbackFunction, null,  
        "Menu Selector", true,  
        Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move, 
        false, true); 
}
The problem is that the window behaviors are being ignored and all the controls - refresh, pin, minimize, maximize - are showing.

How do I open the dialog withput the extra controls.
Rumen
Telerik team
 answered on 31 Aug 2009
1 answer
188 views
Due to browswer issues I am in the process of migrating from the classic RadEditor to the ASP.NET AJAX Editor.
I wish to keep my existing image manager.
In the old version I could customise the LinkManagerControl.ascx to handle image retrieval for table cell background images.
Now that the ImageDialogCaller tool is used how do I customise it so that it returns the url from my image manager.
Rumen
Telerik team
 answered on 31 Aug 2009
2 answers
133 views
As mentioned in a previous post, I am trying to localize a RadGrid using local resource files. I have successfully done most of the localization (header text etc.), but when I use the default RadGrid form to add/edit an item the column names are still appearing in English within the form.

How can I set these to either (a) the same as the header text within the grid, or (b) a value from the local resource file?

Thanks,

Jason
Jason Thacker
Top achievements
Rank 1
 answered on 31 Aug 2009
1 answer
56 views
Hi,

I need an example how to use OfType<> for the grids

How can i get to know how many items in the grid are GridEditableItem?

Can any one help please. thank you,


Regards,

Sai
Princy
Top achievements
Rank 2
 answered on 31 Aug 2009
2 answers
464 views
Hi,

i want to set the HeaderText in a GridBoundColumn by a Databinding expression.

<telerik:GridBoundColumn DataField="Text" HeaderText='<%# MyAssembly.MyHeaderText %>' >

I got the following Exception:

Databinding expressions are only supported on objects that have a DataBinding event. Telerik.Web.UI.GridBoundColumn does not have a DataBinding event.

Can you help me? what is the best Practices to solve this Problem?

Best Regards
Thomas
Thomas
Top achievements
Rank 1
 answered on 31 Aug 2009
2 answers
474 views

Hi to all,

i need support to access a RadGrid GridCheckBoxColumn clientside.

I want to check if a GridCheckBoxColumn is checked to show Message in a RadWindow if the selected item (depending of the GridCheckBoxColumn value) is really to deleted?

In the JavaScript - Function "OnClientButtonClicking" it is not possible for me to access the value of the GridCheckBoxColumn.

 
 
<script type="text/javascript">  
      
    var RadGrid1;  
      
    function GetGridObject(sender, eventArgs) {  
        RadGrid1 = sender;  
    }  
 
      
    function OnClientButtonClicking(sender, args) {  
        var comandName = args.get_item().get_commandName();  
        if (comandName == "Save") {  
            alert('arrived');  
            var DataItems = $find("<%=Grid1.ClientID %>").get_masterTableView().get_dataItems();  
            for (i = 0; i < DataItems.length; i++) {  
                  
        // HOW can i get the Checkbox value by UniqueName (ckbDelete)  
        var combo = $telerik.findControl(DataItems[i].get_element(), "ckbDelete"); // = FAILED  
                alert(combo.get_id());     
                }  
            }  
            return false;  
        }  
      
     
</script> 
 
 
<table class="style1" cellpadding="0" cellspacing="0">  
    <tr> 
        <td style="width: 100%">  
            <telerik:RadToolBar ID="rtbOne"   
                                style="display: block; float: none"    
                                runat="server"   
                                OnClientButtonClicking="OnClientButtonClicking" 
                                OnButtonClick="rtbOne_ButtonClick"   
                                Width="100%">  
                <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
                <Items> 
                     
                    <telerik:RadToolBarButton runat="server"   
                        ImageUrl="~/Image_01.png"   
                        CommandName="Save" Text="Save"   
                        ToolTip="Save...">  
                    </telerik:RadToolBarButton>                                             
                </Items> 
            </telerik:RadToolBar> 
        </td> 
     </tr> 
</table> 
    <telerik:RadGrid ID="Grid1" runat="server" BorderStyle="Solid"   
        AllowMultiRowEdit="True" Width="100%"   
        AutoGenerateColumns="False" onitemdatabound="Grid1_ItemDataBound"   
        OnItemCreated="Grid1_ItemCreated" 
        OnNeedDataSource="Grid1_OnNeedDataSource"   
        oncancelcommand="Grid1_CancelCommand" GridLines="None">  
        <HeaderContextMenu> 
            <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
        </HeaderContextMenu> 
        <PagerStyle Mode="NumericPages"></PagerStyle> 
        <ClientSettings allowrowsdragdrop="false" AllowColumnsReorder="false"    
                ReorderColumnsOnClient="false">  
                <Selecting AllowRowSelect="True" /> 
                <Scrolling AllowScroll="false" UseStaticHeaders="false" /> 
                <ClientEvents OnGridCreated="GetGridObject"></ClientEvents> 
        </ClientSettings> 
        <MasterTableView EditMode="InPlace" GridLines="Both" BorderStyle="Solid" GroupsDefaultExpanded="true" runat="server">  
          
            <GroupByExpressions> 
                <telerik:GridGroupByExpression> 
                    <SelectFields> 
                        <telerik:GridGroupByField   
                                FieldName="Text_one"   
                                HeaderText=" " 
                                HeaderValueSeparator=" ">  
                        </telerik:GridGroupByField> 
                    </SelectFields>    
                    <GroupByFields> 
                        <telerik:GridGroupByField   
                                FieldName="Text_one"   
                                SortOrder="Ascending">  
                        </telerik:GridGroupByField> 
                    </GroupByFields>                                    
                </telerik:GridGroupByExpression> 
            </GroupByExpressions> 
          
            <Columns> 
                <telerik:GridEditCommandColumn  UniqueName="editCommand"   
                    HeaderImageUrl="~/Images/Edit.gif"   
                    ButtonType="ImageButton"   
                    CancelImageUrl="~/Images/Cancel.gif"   
                    UpdateImageUrl="~/Images/Save.gif"   
                    EditImageUrl="~/Images/Edit.gif">  
                <ItemStyle Width="20px"></ItemStyle> 
                </telerik:GridEditCommandColumn> 
              
                <telerik:GridCheckBoxColumn UniqueName="ckbDelete"   
                    HeaderImageUrl="~/Images/Close.gif">  
 
                <HeaderStyle HorizontalAlign="Center"></HeaderStyle> 
                    <ItemStyle Width="20px" /> 
                </telerik:GridCheckBoxColumn> 
 
                <telerik:GridBoundColumn DataField="Id" UniqueName="Id"   
                    Visible="false">  
                </telerik:GridBoundColumn> 
     
                                                     
                <telerik:GridTemplateColumn HeaderText="Text Group" GroupByExpression="" Groupable="true" 
                    DataField="CT" UniqueName="CT" Visible="false">  
                    <ItemStyle Width="200px"/>  
                    <ItemTemplate> 
                        <asp:Label runat="server" Text='<%# Eval("text") %>'   
                            CssClass=""></asp:Label> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
 
                <telerik:GridTemplateColumn HeaderText="Description" DataField="Temptext"   
                    UniqueName="Temptext">  
                    <ItemTemplate> 
                        <asp:Label runat="server" Text='<%# Eval("Temptext") %>' CssClass=""></asp:Label> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
               
            </Columns>                     
        </MasterTableView> 
        <FilterMenu> 
            <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
        </FilterMenu> 
 
    </telerik:RadGrid> 
 
 
      
 

This doesn´t work:

// HOW can i get the Checkbox value by UniqueName (ckbDelete)  
var combo = $telerik.findControl(DataItems[i].get_element(), "ckbDelete"); // = FAILED  
alert(combo.get_id()); 

Thanks for your support.
Regards Laz
Laz
Top achievements
Rank 1
 answered on 31 Aug 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?