Telerik Forums
UI for ASP.NET AJAX Forum
8 answers
333 views

How do I add a custom tool icon?

Here's what I have so far:

<%

@ Page Language="C#" AutoEventWireup="true" CodeFile="RadEdit.aspx.cs" Inherits="RadEdit" %>
<%
@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<html>
<
head>
<
style>
body{background-color:#f0f0f0;}

.FieldLabel{background-image: url(FieldLabel.gif);}

</
style>
</
head>
<
body>
<
form runat="server">
<
telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
<
telerik:RadEditor ID="RadEditor1" runat="server" Skin="WebBlue" ToolsFile="FormTools.xml"></telerik:RadEditor>
</
form>
<
script>
Telerik.Web.UI.Editor.CommandList["FieldLabel"] = function(commandName, editor, args) { editor.pasteHtml("<span id=\"FiledLabel\">Field Label</span>"); }
</script>
</
body>
</
html>

FormTools.xml:

<root>
<
tools name="CustomTools" dockable="true" enabled="true">
<
tool name="FieldLabel" />
</tools>
</root>

Everything works except that the default icon is not replaced by FieldLabel.gif.

Please, No Themes, Skins, Subdirectories, dropdown listboxes or any other code that might confuse the issue. It seems to me to be how the tool is referenced in the <style> tag.

Rumen
Telerik team
 answered on 16 May 2008
3 answers
161 views
Hello

I have a simple raddocklayout, with 2 dock zones and one raddock.
The doc is acting as a toolbar and has a few buttons in it, and it will doc to the top or left of my content pane, which at the moment for testing purposes is a blank image.

The dock starts off at the top and looks fine and all the buttons are horizontally next to each other, when I drag it to the left it resizes its self and the buttons fall below each other.

If I drag the RadDock out of the dockzones the buttons fall horizontally next to each other again, but if I drag the Dock from the left DockZone straight to the top dockzone the RadDock doesn't resize, and I get a vertical scroll bar..

It appears as a bug as it seems strange that it resizes when I drag to the left zone.

Here is my code, could you advise if I am doing something wrong, or if it is indeed a bug.

<style type="text/css">  
        #wrapper  
        {  
            text-align: left;  
            margin: 0px auto;  
            padding: 0px;  
            border: 0;  
            width: 600px;  
        }  
        #head  
        {  
            float: left;  
            width: 505px;  
        }  
        #corner  
        {  
            float: left;  
            width: 95px;  
            color: Red;  
        }  
        #side-a  
        {  
            height: 500px;  
            float: left;  
            width: 95px;  
            text-align: left;  
        }  
        #side-b  
        {  
            margin: 0;  
            float: left;  
            width: 505px;  
        }  
    </style> 
    <asp:ScriptManager ID="ScriptManager" runat="server" /> 
    <telerik:RadDockLayout ID="RadDockLayoutMain" runat="server">  
        <div id="wrapper">  
            <div id="corner">  
            </div> 
            <div id="head">  
                <telerik:RadDockZone BorderWidth="0" ID="dockTop" Height="40" Width="500" runat="server" 
                    Orientation="Horizontal">  
                    <telerik:RadDock BorderWidth="0" ID="RadDock1" runat="server" DockHandle="Grip">  
                        <ContentTemplate> 
                            <asp:Button ID="button1" runat="server" Text="butt1" /> 
                            <asp:Button ID="button2" runat="server" Text="butt2" /> 
                            <asp:Button ID="button3" runat="server" Text="butt3" /> 
                            <asp:Button ID="button4" runat="server" Text="butt4" /> 
                        </ContentTemplate> 
                    </telerik:RadDock> 
                </telerik:RadDockZone> 
            </div> 
            <div id="container">  
                <div id="side-a">  
                    <telerik:RadDockZone Height="500" BorderWidth="0" ID="dockLeft" runat="server" Orientation="Vertical">  
                    </telerik:RadDockZone> 
                </div> 
                <div id="side-b">  
                   <img src="" width="500" height="500" /> 
                </div> 
            </div> 
        </div> 
    </telerik:RadDockLayout> 

Thanks

Bex
Sophy
Telerik team
 answered on 16 May 2008
17 answers
330 views
I noticed that the client side Appointment object does not have the Resources collection in it.

How can I have an external edit custom RadWindow, for a scheduler with multiple resources?

For example I have 3 Sales People in ResourceView and a database of clients, which can be seen by any of my 3 sales people.  So I would have a 3 column ResourceView schedule and a RadWindow popup...with possibly a grid for all the customers (unless you have a better suggestion).

I could add the resource to the advanced edit form but that would create a drop down and with >100+ clients, it would not make sense to filter them through the drop down.

So I need a custom window, RadWindow, but I need to know how to send it the Resource.ID from the Appointment?

Thank you, the scheduler is awesome so far!
LGG
T. Tsonev
Telerik team
 answered on 16 May 2008
1 answer
161 views
I have 2 combo boxes on my page.  when I change the first one, it loads the 2nd combo data (using a template).  However, the SELECTED item displayed in the combo box does not change.

telerik:RadComboBox ID="cmbCarrier" runat="server" DataSourceID="sqlCarrier" 
        DataTextField="Name" DataValueField="CARRIER_ID" AutoPostBack="True" Width="388px" CausesValidation="False">  
        <CollapseAnimation Duration="200" Type="OutQuint" /> 
    </telerik:RadComboBox> 
    Select Contract:  
    <telerik:RadComboBox  ID="cmbContract" runat="server" DataSourceID="sqlContracts" MarkFirstMatch="true" OnDataBound="cmbContract_DataBound" EnableLoadOnDemand="true" HighlightTemplatedItems="true"   Width="420px"  OnItemDataBound="cmbContract_ItemDataBound" OnSelectedIndexChanged="cmbContract_SelectedIndexChanged" CausesValidation="False" > 
                                <HeaderTemplate> 
                            <table style="width: 100%; text-align: left">  
                                <tr> 
                                    <td style="width: 125px;">  
                                        Contract ID  
                                    </td> 
                                    <td style="width: 125px;">  
                                        Carrier  
                                    </td> 
                                    <td style="width: 125px;">  
                                        Description  
                                    </td> 
                                </tr> 
                            </table> 
                        </HeaderTemplate> 
                        <ItemTemplate> 
                            <table style="width: 100%; text-align: left">  
                                <tr> 
                                     <td style="width: 125px;">  
                                        <%# DataBinder.Eval(Container.DataItem, "CONTRACT_ID") %> 
                                    </td> 
                                    <td style="width: 125px;">  
                                        <%# DataBinder.Eval(Container.DataItem, "Name") %> 
                                    </td> 
                                    <td style="width: 125px;">  
                                        <%# DataBinder.Eval(Container.DataItem, "DESCRIPTION") %> 
                                    </td> 
                                 
                                </tr> 
                            </table> 
                        </ItemTemplate> 
        <CollapseAnimation Duration="200" Type="OutQuint" /> 
    </telerik:RadComboBox> 
    protected void cmbContract_ItemDataBound(object sender, Telerik.Web.UI.RadComboBoxItemEventArgs e)  
    {  
        {  
            e.Item.Text = ((DataRowView)e.Item.DataItem)["CONTRACT_ID"].ToString() + "; " + ((DataRowView)e.Item.DataItem)["Name"].ToString() + "; " + ((DataRowView)e.Item.DataItem)["DESCRIPTION"].ToString();  
            e.Item.Value = ((DataRowView)e.Item.DataItem)["CONTRACT_ID"].ToString() + "; " + ((DataRowView)e.Item.DataItem)["Name"].ToString() + "; " + ((DataRowView)e.Item.DataItem)["DESCRIPTION"].ToString();  
        }  
 
    } 

I simply want the first item in the list to be displayed.
Rosi
Telerik team
 answered on 16 May 2008
1 answer
56 views

How can i give the Script in RADAjaxManager like this for ScriptManager ??

It is possible for ScriptManager.

<asp:ScriptManager ID="Temp" runat="Server">

<

Scripts>

<asp:ScriptReference Path="~/JScript.js" />

</Scripts>

</

asp:ScriptManager>

Steve
Telerik team
 answered on 16 May 2008
2 answers
150 views
I’m looking for a way to hide columns in the RadGrid that does not contain any data.

Anyone got an idea on how to do this without iterating the whole grid?
Carsten Højgaard
Top achievements
Rank 1
 answered on 16 May 2008
3 answers
226 views
Hi,

I got a problem using RadGrid v2008.1.415.20: the GridEditCommandColumn OK button's image is missing when adding a new row. It's there when editing an existing row. The cancel image is always present.

This is both in IE6 and Firefox 2, with all the different skins I tried (Default2006, Default, Web20).

I'm using the following code to create the RadGrid on a bare page:

<telerik:RadGrid ID="rgrdTransits" runat="server" OnNeedDataSource="rgrdTransits_NeedDataSource" AutoGenerateColumns="false" Skin="Default2006"> 
   <MasterTableView DataKeyNames="Id" CommandItemDisplay="Top" EditMode="InPlace"> 
      <Columns> 
         <telerik:GridBoundColumn DataField="Id" DataType="System.Int32" HeaderText="Id" SortExpression="Id" UniqueName="Id" > 
         </telerik:GridBoundColumn> 
         <telerik:GridBoundColumn DataField="Nom" HeaderText="Nom" SortExpression="Nom" UniqueName="Nom"> 
         </telerik:GridBoundColumn> 
         <telerik:GridEditCommandColumn ButtonType="ImageButton"> 
         </telerik:GridEditCommandColumn> 
      </Columns> 
   </MasterTableView> 
</telerik:RadGrid> 

Any ideas how to solve this issue ?

Thanks,

Dominic.
Sebastian
Telerik team
 answered on 16 May 2008
3 answers
151 views

I have a 3-tier hierarchical grid that looks like this:

Areas
    Attributes
        Details

In the Attributes detail table, there are three columns: Description, Grade and Comments. I am performing in-place editing and have chosen to use a GridDropDownColumn tied to a LinqDataSource to bring back a simple english-value pair list that fills the Grade column. This is causing a problem on the client that apparently stops the RadAjaxManager from working. If I take the dropdown out and put a regular bound control back in, all is well. Other custom columns seem to work ok.

Another problem I've run into is that the Description field is supposed to be a read-only field and is marked as such. There are times when hitting Update or Cancel that the grid forgets it's a read-only field and presents a textbox instead.

A third problem I'm having is that when I perform an action that fills the grid I run the following code to turn on edit mode by default in the Attributes detail table:

Protected Sub grdRatingDetail_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles grdRatingDetail.PreRender  
 
     For Each nestedViewItem As GridNestedViewItem In grdRatingDetail.MasterTableView.GetItems(GridItemType.NestedView)  
         For Each newnest As GridTableView In nestedViewItem.NestedTableViews  
             For Each row As GridDataItem In newnest.Items  
                 row.Edit = True 
             Next  
         Next  
     Next  
 
End Sub 

This code works great every time except the first time the grid is shown - in that case, all the rows' backgrounds are yellow indicating they're in edit mode, but no controls show and the Edit column still shows "Edit" instead of "Update/Cancel."

Rob
Princy
Top achievements
Rank 2
 answered on 16 May 2008
4 answers
214 views
Hi,
I have a grid that has its datasource set server-side.
I have added a GridButtonColumn. What i want to do is instead of when the button is clicked going to the server-side _ItemCommand of the grid, i want it to run a javascript function client-side...

Is this possible ? here is my GridButtonColumn code...

<

Columns><telerik:GridButtonColumn Text="View" CommandName="View"></telerik:GridButtonColumn></Columns>


Thanks
Mark

Mark
Top achievements
Rank 1
 answered on 16 May 2008
7 answers
237 views
I am trying to create an IFRAME within a radEditor WCM field control, but it is getting stripped out when I publish the page.

I have ALLOWSCRIPTS=TRUE in config.xml and I have ALLOWSPECIALTAGS=TRUE in the RadE:radEditorField control in my page layout.

Is there a workaround?

Thanks,
John
John Way
Top achievements
Rank 1
 answered on 16 May 2008
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?