Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
108 views
Hi,

I am using the Editor to create html and add form elements to the html, more specifically Textboxes and TextAreas. Textboxes contain a value property which shows up in the properties pane at the bottom. In this area you can paste your own text.

A Textarea does not contain a value property, thus does not show up in the properties pane. In Internet Explorer the content of a TextArea can be changed by double clicking the TextArea and editing in-place. But when you try to paste, the textarea disappears and gets replaced by the pasted text

Is there a way to paste text into the value of a TextArea?

Kind regards,
Dries
Rumen
Telerik team
 answered on 13 Jan 2010
2 answers
125 views

Hi,

I don't understand if this is possible... I've search and read a lot in examples and forum but I don't found any.

My scenario is a DetailsView within some ComboBox in edit template...

...when I'm in edit mode I will be select the binded value in the Combobox
(like when appends with this code <telerik:RadComboBox ID="RadCmb1" runat="server" ... SelectedValue='<%# Bind("Value")) %>' > )
...but I my case I load the ComboBox data from a webservice, but there are not items while a text is write in combo and for this reason the binding operation throws a error.

I use webservice for performance because the items in combobox are very much...
...there is a way to select an item from value when binding DetailsView?

Thanks
New

Simon
Telerik team
 answered on 13 Jan 2010
3 answers
171 views
Why am I not able to do this with the stylesheetmanager?
    <telerik:RadStyleSheetManager ID="ssm" runat="server" EnableStyleSheetCombine="true"
        <StyleSheets> 
            <telerik:StyleSheetReference Path="~/Apps/RTO/styles/rto.css"  /> 
            <telerik:StyleSheetReference Path="~/Apps/RTO/styles/popup.css" /> 
        </StyleSheets> 
    </telerik:RadStyleSheetManager> 

T. Tsonev
Telerik team
 answered on 13 Jan 2010
2 answers
148 views

Folks,

 

Environment: RadControls for ASP.NET AJAX Q2 2009 SP1 with Visual Studio 2008 SP1.  I am using Northwind Employee Table as prototype for my RadGrid and Form template with just 5 columns ([EmployeeID], [LastName], [FirstName], [City], [Country]).

 

Currently, if DataField ‘Country’ is Null it updates the Datafield value to “USA”. However if it is not Null, it does not update the Datafield value to “USA”; keeps the edited value.

 

My intention: 

1)  For each rows, I would like to assign automatically
SqlDataSource1.UpdateParameters["Country"].DefaultValue = “USA"  (i.e. GridBoundColumnCountry’ value  be “USA”) after each RadGrid1_UpdateCommand whether it is null or has any existing values.

 

2) Can I change the GridBoundColumnCountry’ to read only so that user’s can’t make any changes to that column? But I should be to update it automatically as per #1.

 

Below is my codes. Thanks for any help.

 

GC_0620



_________
.ASPX
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_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></title>  
</head> 
<body> 
    <form id="form1" runat="server">  
    <div> 
      
        <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">  
        </telerik:RadScriptManager> 
      
    </div> 
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"   
        ConnectionString="<%$ ConnectionStrings:NorthWindConnectionString %>"   
        DeleteCommand="DELETE FROM [Employees] WHERE [EmployeeID] = @EmployeeID"   
        InsertCommand="INSERT INTO [Employees] ([LastName], [FirstName], [City], [Country]) VALUES (@LastName, @FirstName, @City, @Country)"   
        SelectCommand="SELECT [EmployeeID], [LastName], [FirstName], [City], [Country] FROM [Employees] ORDER BY [LastName]"   
        UpdateCommand="UPDATE [Employees] SET [LastName] = @LastName, [FirstName] = @FirstName, [City] = @City, [Country] = @Country WHERE [EmployeeID] = @EmployeeID">  
        <DeleteParameters> 
            <asp:Parameter Name="EmployeeID" Type="Int32" /> 
        </DeleteParameters> 
        <UpdateParameters> 
            <asp:Parameter Name="LastName" Type="String" /> 
            <asp:Parameter Name="FirstName" Type="String" /> 
            <asp:Parameter Name="City" Type="String" /> 
            <asp:Parameter Name="Country" Type="String" /> 
            <asp:Parameter Name="EmployeeID" Type="Int32" /> 
        </UpdateParameters> 
        <InsertParameters> 
            <asp:Parameter Name="LastName" Type="String" /> 
            <asp:Parameter Name="FirstName" Type="String" /> 
            <asp:Parameter Name="City" Type="String" /> 
            <asp:Parameter Name="Country" Type="String" /> 
        </InsertParameters> 
    </asp:SqlDataSource> 
    <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True"   
        AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"   
        AllowAutomaticDeletes="True" AllowAutomaticInserts="True" 
            AllowAutomaticUpdates="True" 
        DataSourceID="SqlDataSource1" GridLines="None"   
        AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True"   
        onupdatecommand="RadGrid1_UpdateCommand" > 
<MasterTableView datakeynames="EmployeeID" CommandItemDisplay="TopAndBottom"  Name = "Master" datasourceid="SqlDataSource1">  
<RowIndicatorColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</RowIndicatorColumn> 
 
<ExpandCollapseColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</ExpandCollapseColumn> 
    <Columns> 
        <telerik:GridBoundColumn DataField="EmployeeID" DataType="System.Int32"   
            HeaderText="EmployeeID" ReadOnly="True" SortExpression="EmployeeID"   
            UniqueName="EmployeeID">  
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="LastName" HeaderText="LastName"   
            SortExpression="LastName" UniqueName="LastName">  
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="FirstName" HeaderText="FirstName"   
            SortExpression="FirstName" UniqueName="FirstName">  
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="City" HeaderText="City"   
            SortExpression="City" UniqueName="City">  
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="Country" HeaderText="Country"     
            SortExpression="Country" UniqueName="Country">  
        </telerik:GridBoundColumn> 
    </Columns> 
                    <EditFormSettings EditFormType="Template">  
                    <FormTemplate> 
                        <table id="Table2" cellspacing="2" cellpadding="1" width="100%" border="0" rules="none" 
                            style="border-collapse: collapse; background: white;">  
                             
                            <tr> 
                                <td> 
                                    <table id="Table4" cellspacing="1" cellpadding="1" width="250" border="0" class="module">  
                                        <tr> 
                                            <td> 
                                                FirstName:</td> 
                                            <td> 
                                                <asp:TextBox ID="TextBox2" Text='<%# Bind( "FirstName") %>' runat="server" > 
                                                </asp:TextBox></td>  
                                        </tr> 
                                        <tr> 
                                            <td> 
                                                Last Name:</td> 
                                            <td> 
                                                <asp:TextBox ID="TextBox3" Text='<%# Bind( "LastName") %>' runat="server" > 
                                                </asp:TextBox></td>  
                                        </tr> 
                                        <tr> 
                                            <td> 
                                                City:</td> 
                                            <td> 
                                                <asp:TextBox ID="Textbox5" Text='<%# Bind( "City") %>' runat="server">  
                                                </asp:TextBox></td>  
                                        </tr> 
                                        <tr> 
                                            <td> 
                                                Country:</td> 
                                            <td> 
                                                <asp:TextBox ID="TextBox4" Text='<%# Bind( "Country") %>' runat="server" > 
                                                </asp:TextBox></td>  
                                        </tr> 
                                    </table> 
                                </td> 
                                <td> 
                                </td> 
                            </tr> 
                            <tr> 
                                <td align="right" colspan="2">  
                                    <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' 
                                        runat="server"  CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>  
                                    </asp:Button>&nbsp;  
                                    <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False" 
                                        CommandName="Cancel"></asp:Button></td>  
                            </tr> 
                        </table> 
                    </FormTemplate> 
                </EditFormSettings> 
 
</MasterTableView> 
        <ClientSettings> 
            <Selecting AllowRowSelect="True" /> 
        </ClientSettings> 
    </telerik:RadGrid> 
    </form> 
</body> 
</html> 
 

.Code Behind
using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Web;  
using System.Web.UI;  
using System.Web.UI.WebControls;  
using Telerik.Web.UI;  
 
 
public partial class _Default : System.Web.UI.Page  
{  
    protected void Page_Load(object sender, EventArgs e)  
    {  
 
    }  
    protected void RadGrid1_UpdateCommand(object source, GridCommandEventArgs e)  
    {  
        if (e.Item is GridEditableItem && e.Item.IsInEditMode && e.Item.OwnerTableView.Name == "Master")  
        {  
            SqlDataSource1.UpdateParameters["Country"].DefaultValue = "USA";  
 
       }  
    }  
      
}  
 
Radoslav
Telerik team
 answered on 13 Jan 2010
5 answers
196 views
I have a RadMenu that has two top-level items, each with a transparent PNG image.  When the menu is loaded, I can see the menu's background color behind the transparent part of the PNG as expected.  However, when I hover over the menu and the menu's highlighted background color shows, the non-highlighted color is what is displayed behind the transparent part of the PNG.  Not only that, but this odd coloring is offest about 8px (1/2 the width of the PNG) to the right.

I've attached an image of what this looks like.

Obviously, this is ugly and isn't what I would consider "releasable" when we go to testing in a couple of days.  What can be done about this?

PS: For some reason, "Default", "Black", "Simple", "Telerik", and "Web20" all seem to not show this odd coloring.
Ryan
Top achievements
Rank 1
 answered on 13 Jan 2010
1 answer
90 views
Hi,
Is it possible to have a self-referencing hierarchy grid and bind the nested rows server side?

<telerik:RadGrid ID="radGridUnits" runat="server" AllowPaging="false" Width="100%" 
            AllowSorting="false" AutoGenerateColumns="false" GridLines="Both" CssClass="selfHierarchyTable"  
            oninsertcommand="radGridUnits_InsertCommand"  
            onupdatecommand="radGridUnits_UpdateCommand"  
            ondeletecommand="radGridUnits_DeleteCommand" 
            onitemdatabound="radGridUnits_ItemDataBound"  
            onneeddatasource="radGridUnits_NeedDataSource" 
            OnItemCreated="radGridUnits_ItemCreated" 
            OnColumnCreated="radGridUnits_ColumnCreated" 
            Skin="Default" onitemcommand="radGridUnits_ItemCommand"
             
            <mastertableview commanditemdisplay="Top" datakeynames="ID, ParentID"  
                HierarchyLoadMode="ServerOnDemand"   
                editmode="EditForms" name="Master" Width="100%"  
                nomasterrecordstext="<%$ Resources:resources,Msg_NoUnits %>"  
                tablelayout="Fixed"
                <SelfHierarchySettings ParentKeyName="ParentID" KeyName="ID" /> 
                <commanditemsettings addnewrecordtext="<%$ Resources:resources,Grid_AddUnit %>" refreshtext="<%$ Resources:resources,Grid_Refresh %>" /> 
                <Columns> 
                    <telerik:GridTemplateColumn UniqueName="Name2" HeaderText="<%$ Resources:resources,Label_Name %>"
                        <ItemTemplate> 
                            <asp:Button ID="MyExpandCollapseButton" runat="server" CommandName="ExpandCollapse" OnClick="button_Click"></asp:Button> 
                            <asp:Label ID="labelName" runat="server" Text='<%# Eval("Name") %>'></asp:Label> 
                        </ItemTemplate> 
                    </telerik:GridTemplateColumn> 

I was guessing that I should use ItemCommand event and check for ExpandCollapse argument but I cant figure out how to add the table structure to the grid then.
Maybe it's not exactly an self referencing grid I'm after, the important thing is to bind every level server side because it's a lot of levels and total number of rows.
 
Is this possible?

Regards,
Mattias

Tsvetoslav
Telerik team
 answered on 13 Jan 2010
2 answers
107 views
Hi,

Is it possible to change the value of the GridDropDownColumn EmptyListItemText at runtime in the ItemDataBound event?
I want to change the value for that EmptyListItem depending on the data which this item is bound to...

Kind Regards,
Raymond
IT Support
Top achievements
Rank 1
 answered on 13 Jan 2010
4 answers
176 views
Some users of my website get overlapping items in a dropdownbox (SEE ATTACHED FILE).
I am using a telerik dropdown control in a radgrid:

 

<telerik:GridDropDownColumn DataField="TaskID" ItemStyle-Width="380px" DataSourceID="DSTaskCombo"

 

 

HeaderText="Task" ItemStyle-Wrap="True" ListTextField="TaskToShow" ListValueField="TaskID" UniqueName="TaskID"

 

 

 

ColumnEditorID="TaskID" ItemStyle-Font-Size="9px" >

 

 

 

</telerik:GridDropDownColumn>

 

 

 

 

And when editing:

<

 

telerik:GridDropDownListColumnEditor ID="TaskID" runat="server" DropDownStyle-CssClass="ActiveDropDown" DropDownStyle-Width="260px" DropDownStyle-Font-Size="9px" />

 

 

 

 

 


Do anyone have a solution.

 

 

 

Simon
Telerik team
 answered on 13 Jan 2010
3 answers
109 views
I am running into a Javascript runtime error - Object doesn't support this property or method - while trying to use the radopen function. Here is the code snippet:

 

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>    
 
 
   
<script type="text/javascript">    
 
function openWin()    
{   
 
 
 
    var oWnd = window.radopen("/Checkout/FindDistributorPopup.aspx"null);    
}  
 
 </script>  
 
 
 

I am trying to call this JS function on a button's onclick event:

<button onclick="openWin();">Search for Distributor</button>

 

 

 

Thanks in advance for your help.

 

 

 

 

Mark Galbreath
Top achievements
Rank 2
 answered on 13 Jan 2010
2 answers
186 views
Hi

I am looking at developing an iPhone app (browser) with Radmenu with the iPhone template.

I have noticed in the example that all the menu items and links are in one page, is it possible that the menu can load on demand, for example, I click on first item menu, then second, but the third item menu will need to be populated from an online database, then when the user clicks on a menu item, it will load the page with the details.

For example my menu would be as follows.


Seminars >   Monday  
                     Tuesday
                     Wednesday > Load all seminars for Wednesday as a menu from db (when clicked) > Seminar 1
                                                                                                                                                        > Seminar 2 (click and load from db)


Wondering if this is possible to load info when clicked.

Richard

Kamen Bundev
Telerik team
 answered on 13 Jan 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?