Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
147 views
I set the maxdate property of the datepicker and it does not allow to select any date greater than when clicking the calendar image.

When I enter a date greater than maxdate, it does show the text box bounded by redline.

However, I leave the invalid date and click on save button, it does allow me to fire the event associated with the save button. How do I prevent this happenings?
Daniel
Telerik team
 answered on 19 Jun 2008
2 answers
149 views
Hi
 Here is my problem's description :

I have a user control with two ajax panels :

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="wuc_Transmotion.ascx.cs" 
    Inherits="wuc_Transmotion" %> 
<%@ Register Namespace="bigsea" TagPrefix="custom" %> 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server"> 
 
    <script type="text/javascript"> 
  
        function TransmotionCreated(sender, eventArgs) 
        { 
            var grid = $find("<%=BusinessGrid.ClientID %>"); 
        } 
                 
        function TransmotionGetFirstDataItemKeyValues() 
        { 
            var firstDataItem = $find("<%= BusinessGrid.MasterTableView.ClientID %>").get_dataItems()[0]; 
            return firstDataItem.getDataKeyValue("ID"); 
        } 
                 
        function InitiateAsyncRequest(argument) 
        { 
            var ajaxManager = $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>"); 
            ajaxManager.ajaxRequest(argument); 
        } 
                 
        function TransmotionRowSelected(sender, eventArgs) 
        { 
            var ajaxPanel_Detail = $find("<%= AjaxPanel_Details.ClientID %>"); 
            alert("Transmotion:ShowDetail:" + eventArgs.getDataKeyValue("ID")); 
            ajaxPanel_Detail.ajaxRequest("Transmotion:ShowDetail:" + eventArgs.getDataKeyValue("ID")); 
            return false; 
        } 
         
        function Download(link) 
        { 
            window.open(link); 
        } 
    </script> 
 
</telerik:RadScriptBlock> 
<style type="text/css"> 
    .style1 
    { 
        width: 900px; 
        height: 250px; 
    } 
    .style8 
    { 
        height: 13px; 
        background-color: #3a6ea5; 
    } 
    .style9 
    { 
        height: 404px; 
        background-color: #3a6ea5; 
    } 
    .style10 
    { 
        width: 133px; 
        text-align: left; 
        height: 100px; 
        margin: 0px; 
        background-color: #3a6ea5; 
    } 
    .style11 
    { 
        text-align: left; 
        background-color: #3a6ea5; 
    } 
    .style12 
    { 
        height: 404px; 
        width: 449px; 
        background-color: #3a6ea5; 
    } 
</style> 
<telerik:RadDockLayout ID="DockingManager_Transmotion" runat="server" /> 
<div style="background-color: #3a6ea5;"> 
    <table class="style1"> 
        <tr> 
            <td class="style8" colspan="3"> 
                &nbsp; 
            </td> 
        </tr> 
        <tr> 
            <td class="style11" valign="top"> 
                <telerik:RadDockZone ID="DockZone_Top" runat="server" Height="230px" Width="200px" 
                    Skin="WebBlue" UniqueName="DockZone_Top" BackColor="#3a6ea5" BorderStyle="None"> 
                    <telerik:RadDock ID="Dock_Top" runat="server" Width="230px" Height="220px" Skin="WebBlue" 
                        UniqueName="Dock_Top" DefaultCommands="None" BackColor="#3a6ea5" DockMode="Docked" 
                        Pinned="True" BorderStyle="None" Title="Multi-Purpose Chair"> 
                        <ContentTemplate> 
                            <br /> 
                            <div style="text-align: center"> 
                                <img src="Transmotion/Picture3.jpg" alt="Picture1" style="width: 140px; height: 160px" /> 
                            </div> 
                        </ContentTemplate> 
                    </telerik:RadDock> 
                </telerik:RadDockZone> 
            </td> 
            <td valign="top" style="text-align: left" class="style12" rowspan="2"> 
                <telerik:RadDockZone ID="DockZone_BusinessGrid" runat="server" Height="470px" Width="500px" 
                    Skin="WebBlue" UniqueName="DockZone_BusinessGrid" BackColor="#3a6ea5" BorderStyle="None"> 
                    <telerik:RadDock ID="RadDock1" runat="server" Width="500px" Height="235px" Skin="WebBlue" 
                        UniqueName="Dock_BusinessGrid" DefaultCommands="None" BackColor="#3a6ea5" DockMode="Docked" 
                        Pinned="True" BorderStyle="None"> 
                        <ContentTemplate> 
                            <div style="text-align: center"> 
                                <img src="Transmotion/Picture1.jpg" alt="Picture2" style="width: 300px; height: 200px" /> 
                            </div> 
                        </ContentTemplate> 
                    </telerik:RadDock> 
                    <telerik:RadDock ID="Dock_BusinessGrid" runat="server" Width="500px" Height="235px" 
                        Skin="WebBlue" UniqueName="Dock_BusinessGrid" DefaultCommands="None" BackColor="#3a6ea5" 
                        DockMode="Docked" Pinned="True" BorderStyle="None"> 
                        <ContentTemplate> 
                            <telerik:RadAjaxPanel ID="AjaxPanel_BusinessGrid" runat="server" Height="200px" Width="300px" 
                                LoadingPanelID="LoadingPanel_Transmotion"> 
                                <telerik:RadGrid ID="BusinessGrid" Skin="Web20" runat="server" Height="200px" AllowMultiRowSelection="true" 
                                    AutoGenerateColumns="false" PageSize="4" AllowPaging="True" GridLines="None" 
                                    OnNeedDataSource="BusinessGrid_NeedDataSource" EnableAJAX="True" Width="500px"> 
                                    <PagerStyle Mode="NextPrevAndNumeric" /> 
                                    <MasterTableView ClientDataKeyNames="ID" TableLayout="Fixed"> 
                                        <EditFormSettings> 
                                            <PopUpSettings ScrollBars="None"></PopUpSettings> 
                                        </EditFormSettings> 
                                        <RowIndicatorColumn Visible="False"> 
                                            <HeaderStyle Width="20px"></HeaderStyle> 
                                        </RowIndicatorColumn> 
                                        <ExpandCollapseColumn Visible="False" Resizable="False"> 
                                            <HeaderStyle Width="20px"></HeaderStyle> 
                                        </ExpandCollapseColumn> 
                                        <Columns> 
                                            <telerik:GridBoundColumn DataField="ID" HeaderText="Product Code" SortExpression="ID" 
                                                UniqueName="ID"> 
                                            </telerik:GridBoundColumn> 
                                            <telerik:GridBoundColumn DataField="Name" HeaderText="Product Name" SortExpression="Name" 
                                                UniqueName="Name" HeaderStyle-Width="150px" Visible="False"> 
                                            </telerik:GridBoundColumn> 
                                            <telerik:GridBoundColumn DataField="Model" HeaderText="Product Name" SortExpression="Model" 
                                                UniqueName="Model" HeaderStyle-Width="250px"> 
                                            </telerik:GridBoundColumn> 
                                            <telerik:GridBoundColumn DataField="Company" HeaderText="Manufacturer" SortExpression="Company" 
                                                UniqueName="Company" Visible="False"> 
                                            </telerik:GridBoundColumn> 
                                            <%--<telerik:GridBoundColumn DataField="Status" HeaderText="Condition" SortExpression="Status" 
                                        UniqueName="Status"> 
                                    </telerik:GridBoundColumn>--%> 
                                            <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" /> 
                                        </Columns> 
                                    </MasterTableView> 
                                    <ClientSettings EnableRowHoverStyle="true"> 
                                        <ClientEvents OnRowSelected="TransmotionRowSelected"></ClientEvents> 
                                        <Selecting AllowRowSelect="True"></Selecting> 
                                    </ClientSettings> 
                                </telerik:RadGrid> 
                            </telerik:RadAjaxPanel> 
                        </ContentTemplate> 
                    </telerik:RadDock> 
                </telerik:RadDockZone> 
            </td> 
            <td valign="top" style="text-align: left" class="style9" rowspan="2"> 
                <telerik:RadDockZone ID="DockZone_DetailsGrid" runat="server" Height="470px" Width="245px" 
                    Skin="WebBlue" UniqueName="DockZone_DetailsGrid" BackColor="#3a6ea5" BorderStyle="None"> 
                    <telerik:RadDock ID="Dock_DetailsGrid" runat="server" Width="245px" Height="470px" 
                        Skin="WebBlue" UniqueName="Dock_DetailsGrid" DefaultCommands="None" BackColor="#3a6ea5" 
                        DockMode="Docked" Pinned="True" BorderStyle="None" Title="Product Details"> 
                        <ContentTemplate> 
                            <telerik:RadAjaxPanel ID="AjaxPanel_Details" runat="server" Height="200px" Width="300px" 
                                OnAjaxRequest="AjaxPanel_Details_AjaxRequest" LoadingPanelID="LoadingPanel_Transmotion"> 
                                <telerik:RadGrid ID="DetailsGrid" runat="server" AutoGenerateColumns="False" GridLines="None" 
                                    EnableAJAX="True" EnableAJAXLoadingTemplate="True" LoadingTemplateTransparency="55" 
                                    ShowHeader="False" Skin="Web20" Width="245px" Style="overflow: hidden; direction: ltr;" 
                                    Height="440px" OnItemCreated="DetailsGrid_ItemCreated"> 
                                    <MasterTableView ClientDataKeyNames="ID" ShowHeader="true" Width="250px" TableLayout="Fixed"> 
                                        <RowIndicatorColumn Visible="False"> 
                                            <HeaderStyle Width="20px"></HeaderStyle> 
                                        </RowIndicatorColumn> 
                                        <ExpandCollapseColumn Visible="False" Resizable="False"> 
                                            <HeaderStyle Width="20px"></HeaderStyle> 
                                        </ExpandCollapseColumn> 
                                        <Columns> 
                                            <telerik:GridTemplateColumn HeaderText="Specification" UniqueName="SpecColumn" HeaderStyle-Width="3px"> 
                                                <ItemTemplate> 
                                                    <div style="text-align: center"> 
                                                        <asp:Image ID="ProductImage" runat="server" Width="190px" ImageUrl='<%# (Eval("picUrl") is System.DBNull)? "~/Img/ImageNotAvailable.gif" : "~/Transmotion/" + Eval("picUrl") %>' 
                                                            AlternateText="No preview available" Height="160px" BorderStyle="Solid" Visible="True" /> 
                                                    </div> 
                                                    <br /> 
                                                    <asp:Literal ID="ltrlSpec" runat="server" Text='<%# Eval("Spec") + "<br/>" %>' /> 
                                                    <br /> 
                                                    <asp:HyperLink ID="HyperLink_Pdf" runat="server" Text="Download Specification Sheet" 
                                                        NavigateUrl='<%# Eval("pdfUrl")  %>' /> 
                                                    <br /> 
                                                    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="http://www.Transmotion.com">WebSite</asp:HyperLink> 
                                                    <br /> 
                                                    <asp:LinkButton ID="LinkButton_Login" runat="server">Login</asp:LinkButton> 
                                                    , 
                                                    <asp:LinkButton ID="LinkButton_Register" runat="server">Register</asp:LinkButton> 
                                                </ItemTemplate> 
                                                <HeaderStyle Width="20"></HeaderStyle> 
                                            </telerik:GridTemplateColumn> 
                                        </Columns> 
                                        <EditFormSettings> 
                                            <PopUpSettings ScrollBars="None"></PopUpSettings> 
                                        </EditFormSettings> 
                                    </MasterTableView> 
                                </telerik:RadGrid> 
                            </telerik:RadAjaxPanel> 
                        </ContentTemplate> 
                    </telerik:RadDock> 
                </telerik:RadDockZone> 
            </td> 
        </tr> 
        <tr> 
            <td class="style10" valign="top"> 
                <telerik:RadDockZone ID="DockZone_Bottom" runat="server" Height="230px" Width="200px" 
                    Skin="WebBlue" UniqueName="DockZone_Bottom" BackColor="#3a6ea5" BorderStyle="None"> 
                    <telerik:RadDock ID="Dock_Bottom" runat="server" Width="230px" Height="220px" Skin="WebBlue" 
                        UniqueName="Dock_Bottom" DefaultCommands="None" BackColor="#3a6ea5" DockMode="Docked" 
                        Pinned="True" BorderStyle="None" Title="Surgie-chair series"> 
                        <ContentTemplate> 
                            <br /> 
                            <div style="text-align: center"> 
                                <img src="Transmotion/Picture2.jpg" alt="Picture1" style="width: 190px; height: 160px" /> 
                            </div> 
                        </ContentTemplate> 
                    </telerik:RadDock> 
                </telerik:RadDockZone> 
            </td> 
        </tr> 
    </table> 
    <asp:TextBox ID="TextBox_Manufacturer" runat="server" Visible="False"></asp:TextBox> 
</div> 
<telerik:RadAjaxLoadingPanel ID="LoadingPanel_Transmotion" runat="server" Height="75px" 
    Width="75px"> 
    <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' 
        style="border: 0px;" /> 
</telerik:RadAjaxLoadingPanel> 
 
 and
public void AjaxPanel_Details_AjaxRequest(object sender, AjaxRequestEventArgs e) 
    { 
        string[] args = e.Argument.Split(':'); 
 
        if (args[0] == "Transmotion") 
        { 
            if (args[1] == "ShowDetail") 
            { 
                ShowDetail(Convert.ToInt32(args[2])); 
            } 
        } 
    } 

I have a AjaxManager on my main page and with an AjaxRequest Method i Create my user control Dyanamically :
public void AjaxManager_Main_AjaxRequest(object sender, AjaxRequestEventArgs e) 
    { 
        
        string[] args = e.Argument.Split(':'); 
 
        if (args[0] == "Show_Transmotion") 
        { 
            LoadUserControl("wuc_Transmotion.ascx"); 
        } 
} 

It Shows But when i want to use this control after 2 click It Hides

What can i do ?

Regards ahmad
ahmad moghadaskhoo
Top achievements
Rank 1
 answered on 19 Jun 2008
1 answer
42 views
I have some problem with the Back or fowards Button in IE 6 Sp2 after fire the RadTabStrip 'OnClientTabSelecting' event and after RadComboBox 'OnSelectedIndexChanged' event. How do ??
Erjan Gavalji
Telerik team
 answered on 19 Jun 2008
4 answers
641 views
Maybe there's an easy way to do this that I'm missing, but I'm pulling my hair out here.

I have a class that has a field...for example:
protected int? _MNIIdentityID;  
public int? MNIIdentityID {  
    get { return _MNIIdentityID; }  
    set { _MNIIdentityID = value; }  
} 

When I bind an instance of the class to a FormView, I can't seem to make it work. 

If I bind to Text, I can't get empty strings to work correctly.

If I bind to DbValue, I get an error that it can't convert double? to int?.

Any suggestions, short of using a non-numeric textbox?
Chris T.
Top achievements
Rank 1
 answered on 19 Jun 2008
1 answer
96 views
Hi All

Why does this line of code return null when it is in a usercontrol?

$find(

"AjaxManager")


And how can I fix it?

Cheers
Jon
Vlad
Telerik team
 answered on 19 Jun 2008
3 answers
290 views
My grid displays 3 columns. When inserting a new record, the editform doesn't close automatically, but when I click the 'Cancel-button' the record has been added to the grid. What's wrong/missing in my code?

   Protected Sub gvTask_InsertCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles gvTask.InsertCommand  
        If IsValid Then  
            Dim SoortBewerking As TextBox = TryCast(e.Item.FindControl("txtSoortBewerking"), TextBox)  
            Dim status As CheckBox = TryCast(e.Item.FindControl("chkStatus"), CheckBox)  
            Dim Icon As RadComboBox = TryCast(e.Item.FindControl("cmbIcons"), RadComboBox)  
            InsertDb(SoortBewerking.Text, status.Checked = True, Int32.Parse(Icon.SelectedValue))  
 
        End If  
    End Sub  
    Private Sub InsertDb(ByVal SoortBewerking As String, ByVal Status As Boolean, ByVal Icon As Integer)  
        Dim strSQL As String = _ 
                    "INSERT INTO tblBewerkingen " & _  
                    "(soortbewerking, status, IconId) " & _  
                    "VALUES " & _  
                    "(@soortbewerking, @status, @IconId)"  
        Dim Command As New SqlCommand(strSQL)  
 
        Command.Parameters.AddWithValue("@SoortBewerking", SoortBewerking)  
        Command.Parameters.AddWithValue("@Status", Status)  
        Command.Parameters.AddWithValue("@IconId", Icon)  
 
 
        DBPortal.Execute(Command)  
 
 
    End Sub 

    <Columns> 
        <telerik:GridBoundColumn DataField="BewerkingId" DataType="System.Int32"   
            HeaderText="BewerkingId" ReadOnly="True" SortExpression="BewerkingId"   
            UniqueName="BewerkingId" Visible="False">  
        </telerik:GridBoundColumn> 
        <telerik:GridTemplateColumn HeaderText="Taak"   
            SortExpression="SoortBewerking" UniqueName="SoortBewerking">  
            <ItemTemplate> 
            <asp:Label runat="server" ID="lblSoortBewerking" Text='<%#Eval("SoortBewerking") %>'></asp:Label> 
            </ItemTemplate> 
            <EditItemTemplate> 
            <asp:TextBox runat="server" Width="100px" ID="txtSoortBewerking" Text='<%#Bind("SoortBewerking") %>'></asp:TextBox> 
            </EditItemTemplate> 
         </telerik:GridTemplateColumn> 
         <telerik:GridTemplateColumn HeaderText="Active"   
            SortExpression="Status" UniqueName="Status">  
            <ItemTemplate> 
            <asp:CheckBox runat="server" ID="chkStatus" Text='<%#Eval("Status") %>' /> 
            </ItemTemplate> 
            <EditItemTemplate> 
            <asp:CheckBox runat="server" ID="chkStatus" Text='<%#Bind("Status") %>' /> 
            </EditItemTemplate> 
            </telerik:GridTemplateColumn> 
        <telerik:GridTemplateColumn> 
                            <ItemTemplate> 
                            <asp:Image runat="server" ID="Icon"   
                                                    ImageUrl='<%# "~/Images/"+DataBinder.Eval(Container.DataItem, "Icon") %>' /> 
                            </ItemTemplate>   
                            <EditItemTemplate> 
                                <telerik:RadComboBox ID="cmbIcons" runat="server" DataSourceID="dsIcons"   
                                    DataValueField="IconId" DataTextField="IconName" AllowCustomText="false" HighlightTemplatedItems="true"   
                                    Skin="Office2007" SelectedValue='<%#Bind("IconId") %>' Text="Select a icon">  
                                    <CollapseAnimation Duration="200" Type="OutQuint" /> 
                                    <HeaderTemplate> 
                                    <table width="400px" border="0">  
                                    <tr> 
                                    <td width="30px"></td> 
                                    <td width="100px">Name</td> 
                                    </tr> 
                                    </table> 
                                    </HeaderTemplate> 
                                          <ItemTemplate> 
                                        <table style="border-bottom: 1px dotted #EFEFEF; margin-bottom: 10px; font-size: 11px;" 
                                            width="98%">  
                                            <tr> 
                                                <td> 
                                                <asp:Image runat="server" ID="Icon" 
                                                    ImageUrl='<%# "~/Images/"+DataBinder.Eval(Container.DataItem, "Icon") %>' /> 
                                                </td> 
                                                <td> 
                                                    ImageUrl='<%# "~/Images/"+DataBinder.Eval(Container.DataItem, "Icon") %>' /> 
 
                                                </td> 
                                            </tr> 
                                        </table> 
                                    </ItemTemplate> 
                                    <Items><telerik:RadComboBoxItem Selected="true" runat="server"/></Items> 
                                </telerik:RadComboBox> 
                            </EditItemTemplate>         
        </telerik:GridTemplateColumn> 
 
        <telerik:GridEditCommandColumn ButtonType="ImageButton">  
        <headerstyle width="20px" /> 
        </telerik:GridEditCommandColumn> 
        <telerik:GridButtonColumn ConfirmText="Delete this task?" ButtonType="ImageButton" CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">  
        <HeaderStyle Width="20px" /> 
        </telerik:GridButtonColumn> 
    </Columns> 
 
<EditFormSettings ColumnNumber="2" CaptionDataField="SoortBewerking" CaptionFormatString="Edit properties">  
<PopUpSettings ScrollBars="None"></PopUpSettings> 
<FormTableItemStyle Wrap="false" VerticalAlign="Top" /> 
<FormMainTableStyle GridLines="Horizontal" CellPadding="3" CellSpacing="0" BackColor="#FFFFCC" Width="100%" /> 
<FormTableStyle CellSpacing="0" CellPadding="2" Width="50px" Height="50px" BackColor="#FFFFCC" HorizontalAlign="NotSet" /> 
<FormTableAlternatingItemStyle Wrap="false" VerticalAlign="Top" /> 
<EditColumn ButtonType="ImageButton" InsertText="Insert Task" UpdateText="Update Task" UniqueName="EditCommandColumn1" CancelText="Cancel Edit"></EditColumn> 
<FormTableButtonRowStyle HorizontalAlign="Right" /> 
</EditFormSettings> 
</MasterTableView> 
    </telerik:RadGrid> 
    <asp:SqlDataSource ID="dsTask" runat="server"   
        ConnectionString="<%$ ConnectionStrings:DBPortal %>"   
        DeleteCommand="DELETE FROM [tblBewerkingen] WHERE [BewerkingId] = @original_BewerkingId"   
        InsertCommand="INSERT INTO [tblBewerkingen] ([SoortBewerking], [Status], [IcondId]) VALUES (@SoortBewerking, @Status, @IconId)"   
        SelectCommand="SELECT tblBewerkingen.BewerkingId, tblBewerkingen.SoortBewerking, tblBewerkingen.Status, tblIcons.Icon, tblBewerkingen.IconId FROM tblBewerkingen LEFT OUTER JOIN tblIcons ON tblBewerkingen.IconId = tblIcons.IconId"   
        UpdateCommand="UPDATE [tblBewerkingen] SET [SoortBewerking] = @SoortBewerking, [Status] = @Status, [IconId] = @IconId WHERE [BewerkingId] = @original_BewerkingId AND [SoortBewerking] = @original_SoortBewerking AND [Status] = @original_Status AND [IconId] = @original_IconId"   
                ConflictDetection="CompareAllValues"   
        OldValuesParameterFormatString="original_{0}">  
        <DeleteParameters> 
            <asp:Parameter Name="BewerkingId" Type="Int32" /> 
        </DeleteParameters> 
        <UpdateParameters> 
            <asp:Parameter Name="SoortBewerking" Type="String" /> 
            <asp:Parameter Name="Status" Type="Boolean" /> 
            <asp:Parameter Name="IconId" Type="Int32"/>  
            <asp:Parameter Name="original_BewerkingId" Type="Int32" /> 
            <asp:Parameter Name="original_SoortBewerking" Type="String" /> 
            <asp:Parameter Name="original_Status" Type="Boolean" /> 
            <asp:Parameter Name="original_IconId" Type="Int32" /> 
        </UpdateParameters> 
        <InsertParameters> 
            <asp:Parameter Name="SoortBewerking" Type="String" /> 
            <asp:Parameter Name="Status" Type="Boolean" /> 
            <asp:Parameter Name="IconId" Type="Int32" /> 
        </InsertParameters> 
    </asp:SqlDataSource> 
    <asp:SqlDataSource ID="dsIcons" runat="server"   
        ConnectionString="<%$ ConnectionStrings:DBPortal %>"   
        SelectCommand="SELECT * FROM [tblIcons]">  
    </asp:SqlDataSource> 
Yavor
Telerik team
 answered on 19 Jun 2008
1 answer
94 views
Hi,

When i click AjaxSpellCheck in the RadEditor, there is a change in the height of the editor as because it is displaying the yellow backgrounded message "Spell check in progress, Finish  & Cancel Buttons".

Because of this there is no consistency in height and the editor is loosing its visual apperance. Moreover it is overlapping the controls placed just below the editor.

Is it not possible to over come this by providing vertical scrollbar inside the body of the editor instead of expanding its height.

George
Telerik team
 answered on 19 Jun 2008
3 answers
168 views
When a selected section of C# code is copied from the Visual Studio IDE, then pasted into the RADEditor, each line is wrapped in a <P> element causing excessive line spacing and all the indentation is lost. StripFormattingOptions is set to "None".

Any idea how I can improve this experience?
Tervel
Telerik team
 answered on 19 Jun 2008
2 answers
120 views
Hi,

I my custom dialog page I have a button wich call a function that close my custom dialog and return a value to the editor using the CloseDlg() function.

But I hava a little problem with this function, it seems like after the custom dialog is closed it is instantaneously reloaded and so,the custom dialog page cannot be closed.

Here is my command function and callback function in MOSSEditorTool.js:
var RadEditorClientObject = null;
RadEditorCommandList["FlvManager"] = function FlvManagerCommand(commandName, editor, args)
{
     RadEditorClientObject = editor;
     editor.ShowDialog(
    "/_wpresources/RadEditorSharePoint/4.3.2.0__1f131a624888eeed/RadControls/Editor/Dialogs/FlvManager.aspx",
    null,
    495,
    435,
    CustomDialogCallBack,
    null,
    "Flv Manager");
};
function CustomDialogCallBack(returnValue)
{
    if(returnValue)
    {
       RadEditorClientObject.PasteHtml(returnValue.value);
    }
}

And in my custom dialog box, I have this javascript code:

 <script type="text/javascript">
    InitializeRadWindow();
    </script>
if (window.attachEvent)
{
    window.attachEvent("onload", initDialog);
}
else if (window.addEventListener)
{
    window.addEventListener("load", initDialog, false);
}

var content = document.getElementById("infoHidden");

function getRadWindow()
{
   if (window.RadWindow)
   {
      return window.RadWindow;
   }
   if (window.frameElement && window.frameElement.RadWindow)
   {
      return window.frameElement.RadWindow;
   }
   return null;
}

var clientParameters;
function initDialog()
{
    clientParameters = getRadWindow().ClientParameters;   
    content.value = clientParameters;
}
 function insertFlvLink()
{
    var returnValue =
    {
        value:document.getElementById('hiddenInfo')
    };
    alert("return value = " + returnValue.value);
    CloseDlg(returnValue);
}

Can someone help me about this problem?
Thank you in advance
Kamran Baygani
Top achievements
Rank 1
 answered on 19 Jun 2008
1 answer
76 views
My grid displays 3 columns. When inserting a new record, the editform doesn't close automatically, but when I click the 'Cancel-button' the record has been added to the grid. What's wrong/missing in my code?

   Protected Sub gvTask_InsertCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles gvTask.InsertCommand  
        If IsValid Then  
            Dim SoortBewerking As TextBox = TryCast(e.Item.FindControl("txtSoortBewerking"), TextBox)  
            Dim status As CheckBox = TryCast(e.Item.FindControl("chkStatus"), CheckBox)  
            Dim Icon As RadComboBox = TryCast(e.Item.FindControl("cmbIcons"), RadComboBox)  
            InsertDb(SoortBewerking.Text, status.Checked = True, Int32.Parse(Icon.SelectedValue))  
 
        End If  
    End Sub  
    Private Sub InsertDb(ByVal SoortBewerking As String, ByVal Status As Boolean, ByVal Icon As Integer)  
        Dim strSQL As String = _ 
                    "INSERT INTO tblBewerkingen " & _  
                    "(soortbewerking, status, IconId) " & _  
                    "VALUES " & _  
                    "(@soortbewerking, @status, @IconId)"  
        Dim Command As New SqlCommand(strSQL)  
 
        Command.Parameters.AddWithValue("@SoortBewerking", SoortBewerking)  
        Command.Parameters.AddWithValue("@Status", Status)  
        Command.Parameters.AddWithValue("@IconId", Icon)  
 
 
        DBPortal.Execute(Command)  
 
 
    End Sub 

    <Columns> 
        <telerik:GridBoundColumn DataField="BewerkingId" DataType="System.Int32"   
            HeaderText="BewerkingId" ReadOnly="True" SortExpression="BewerkingId"   
            UniqueName="BewerkingId" Visible="False">  
        </telerik:GridBoundColumn> 
        <telerik:GridTemplateColumn HeaderText="Taak"   
            SortExpression="SoortBewerking" UniqueName="SoortBewerking">  
            <ItemTemplate> 
            <asp:Label runat="server" ID="lblSoortBewerking" Text='<%#Eval("SoortBewerking") %>'></asp:Label> 
            </ItemTemplate> 
            <EditItemTemplate> 
            <asp:TextBox runat="server" Width="100px" ID="txtSoortBewerking" Text='<%#Bind("SoortBewerking") %>'></asp:TextBox> 
            </EditItemTemplate> 
         </telerik:GridTemplateColumn> 
         <telerik:GridTemplateColumn HeaderText="Active"   
            SortExpression="Status" UniqueName="Status">  
            <ItemTemplate> 
            <asp:CheckBox runat="server" ID="chkStatus" Text='<%#Eval("Status") %>' /> 
            </ItemTemplate> 
            <EditItemTemplate> 
            <asp:CheckBox runat="server" ID="chkStatus" Text='<%#Bind("Status") %>' /> 
            </EditItemTemplate> 
            </telerik:GridTemplateColumn> 
        <telerik:GridTemplateColumn> 
                            <ItemTemplate> 
                            <asp:Image runat="server" ID="Icon"   
                                                    ImageUrl='<%# "~/Images/"+DataBinder.Eval(Container.DataItem, "Icon") %>' /> 
                            </ItemTemplate>   
                            <EditItemTemplate> 
                                <telerik:RadComboBox ID="cmbIcons" runat="server" DataSourceID="dsIcons"   
                                    DataValueField="IconId" DataTextField="IconName" AllowCustomText="false" HighlightTemplatedItems="true"   
                                    Skin="Office2007" SelectedValue='<%#Bind("IconId") %>' Text="Select a icon">  
                                    <CollapseAnimation Duration="200" Type="OutQuint" /> 
                                    <HeaderTemplate> 
                                    <table width="400px" border="0">  
                                    <tr> 
                                    <td width="30px"></td> 
                                    <td width="100px">Name</td> 
                                    </tr> 
                                    </table> 
                                    </HeaderTemplate> 
                                          <ItemTemplate> 
                                        <table style="border-bottom: 1px dotted #EFEFEF; margin-bottom: 10px; font-size: 11px;" 
                                            width="98%">  
                                            <tr> 
                                                <td> 
                                                <asp:Image runat="server" ID="Icon" 
                                                    ImageUrl='<%# "~/Images/"+DataBinder.Eval(Container.DataItem, "Icon") %>' /> 
                                                </td> 
                                                <td> 
                                                    ImageUrl='<%# "~/Images/"+DataBinder.Eval(Container.DataItem, "Icon") %>' /> 
 
                                                </td> 
                                            </tr> 
                                        </table> 
                                    </ItemTemplate> 
                                    <Items><telerik:RadComboBoxItem Selected="true" runat="server"/></Items> 
                                </telerik:RadComboBox> 
                            </EditItemTemplate>         
        </telerik:GridTemplateColumn> 
 
        <telerik:GridEditCommandColumn ButtonType="ImageButton">  
        <headerstyle width="20px" /> 
        </telerik:GridEditCommandColumn> 
        <telerik:GridButtonColumn ConfirmText="Delete this task?" ButtonType="ImageButton" CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">  
        <HeaderStyle Width="20px" /> 
        </telerik:GridButtonColumn> 
    </Columns> 
 
<EditFormSettings ColumnNumber="2" CaptionDataField="SoortBewerking" CaptionFormatString="Edit properties">  
<PopUpSettings ScrollBars="None"></PopUpSettings> 
<FormTableItemStyle Wrap="false" VerticalAlign="Top" /> 
<FormMainTableStyle GridLines="Horizontal" CellPadding="3" CellSpacing="0" BackColor="#FFFFCC" Width="100%" /> 
<FormTableStyle CellSpacing="0" CellPadding="2" Width="50px" Height="50px" BackColor="#FFFFCC" HorizontalAlign="NotSet" /> 
<FormTableAlternatingItemStyle Wrap="false" VerticalAlign="Top" /> 
<EditColumn ButtonType="ImageButton" InsertText="Insert Task" UpdateText="Update Task" UniqueName="EditCommandColumn1" CancelText="Cancel Edit"></EditColumn> 
<FormTableButtonRowStyle HorizontalAlign="Right" /> 
</EditFormSettings> 
</MasterTableView> 
    </telerik:RadGrid> 
    <asp:SqlDataSource ID="dsTask" runat="server"   
        ConnectionString="<%$ ConnectionStrings:DBPortal %>"   
        DeleteCommand="DELETE FROM [tblBewerkingen] WHERE [BewerkingId] = @original_BewerkingId"   
        InsertCommand="INSERT INTO [tblBewerkingen] ([SoortBewerking], [Status], [IcondId]) VALUES (@SoortBewerking, @Status, @IconId)"   
        SelectCommand="SELECT tblBewerkingen.BewerkingId, tblBewerkingen.SoortBewerking, tblBewerkingen.Status, tblIcons.Icon, tblBewerkingen.IconId FROM tblBewerkingen LEFT OUTER JOIN tblIcons ON tblBewerkingen.IconId = tblIcons.IconId"   
        UpdateCommand="UPDATE [tblBewerkingen] SET [SoortBewerking] = @SoortBewerking, [Status] = @Status, [IconId] = @IconId WHERE [BewerkingId] = @original_BewerkingId AND [SoortBewerking] = @original_SoortBewerking AND [Status] = @original_Status AND [IconId] = @original_IconId"   
                ConflictDetection="CompareAllValues"   
        OldValuesParameterFormatString="original_{0}">  
        <DeleteParameters> 
            <asp:Parameter Name="BewerkingId" Type="Int32" /> 
        </DeleteParameters> 
        <UpdateParameters> 
            <asp:Parameter Name="SoortBewerking" Type="String" /> 
            <asp:Parameter Name="Status" Type="Boolean" /> 
            <asp:Parameter Name="IconId" Type="Int32"/>  
            <asp:Parameter Name="original_BewerkingId" Type="Int32" /> 
            <asp:Parameter Name="original_SoortBewerking" Type="String" /> 
            <asp:Parameter Name="original_Status" Type="Boolean" /> 
            <asp:Parameter Name="original_IconId" Type="Int32" /> 
        </UpdateParameters> 
        <InsertParameters> 
            <asp:Parameter Name="SoortBewerking" Type="String" /> 
            <asp:Parameter Name="Status" Type="Boolean" /> 
            <asp:Parameter Name="IconId" Type="Int32" /> 
        </InsertParameters> 
    </asp:SqlDataSource> 
    <asp:SqlDataSource ID="dsIcons" runat="server"   
        ConnectionString="<%$ ConnectionStrings:DBPortal %>"   
        SelectCommand="SELECT * FROM [tblIcons]">  
    </asp:SqlDataSource> 
Shinu
Top achievements
Rank 2
 answered on 19 Jun 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?