Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
139 views
I have created some custom commands in the grid as follows.

<telerik:GridButtonColumn CommandName="Remove" FilterControlAltText="Filter Remove column"
    Text="Remove" UniqueName="Remove"><br>                   
</
telerik:GridButtonColumn>


I would like to place this column at the end of the grid similar to how the auto generated edit column is placed at the end.  Is this possible?
Shinu
Top achievements
Rank 2
 answered on 31 Mar 2014
2 answers
76 views
 <telerik:RadGrid
         ID="rgOfficersToCallIn"
         runat="server"
         AutoGenerateColumns="False"
         AllowPaging="True"
         AllowSorting="True"
         PageSize="17"
         CellSpacing="0" GridLines="None"
         OnSortCommand="rgOfficersToCallIn_SortCommand"
         OnPageIndexChanged="rgOfficerToCallIn_PageIndexChanged"
         EnableHeaderContextFilterMenu="True" 
         Width="1200px"
         Height="640px">
            <ClientSettings EnablePostBackOnRowClick="true">              
                <Selecting AllowRowSelect="True" />
                <Scrolling AllowScroll="true" UseStaticHeaders="True" SaveScrollPosition="true" />
            </ClientSettings>
            <MasterTableView ShowHeadersWhenNoRecords="true" NoMasterRecordsText="No Employees Records to display" GridLines="None" ItemStyle-Height="23px" Font-Size="11px" TableLayout="Auto">
                <PagerStyle Mode="NumericPages" AlwaysVisible="true"></PagerStyle>
                <Columns>             
                    <telerik:GridBoundColumn HeaderText="HR EmployeeID" HeaderStyle-Width="120px" Display="false" DataField="HREmployeeID" FilterControlWidth="40px" ShowFilterIcon="false" SortExpression="HREmployeeID"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn HeaderText="Employee Number" HeaderStyle-Width="100px" DataField="EmployeeNumber" FilterControlWidth="95px" ShowFilterIcon="false" SortExpression="EmployeeNumber"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn HeaderText="First Name" HeaderStyle-Width="70px" DataField="FirstName" FilterControlWidth="105px" ShowFilterIcon="false"  SortExpression="FirstName"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn HeaderText="Last Name" HeaderStyle-Width="70px" DataField="LastName" FilterControlWidth="84px" ShowFilterIcon="false"  SortExpression="LastName"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn HeaderText="City" HeaderStyle-Width="90px" DataField="City" FilterControlWidth="78px" ShowFilterIcon="false" SortExpression="City"></telerik:GridBoundColumn>
                   <%-- <telerik:GridBoundColumn HeaderText="Guard Card Number" HeaderStyle-Width="110px" DataField="GuardCardNumber" FilterControlWidth="72px" ShowFilterIcon="false" SortExpression="GuardCardNumber"></telerik:GridBoundColumn>                    --%>
                    <telerik:GridDateTimeColumn  HeaderText="Guard Card Expired" HeaderStyle-Width="110px" DataField="GuardCardExpired" FilterControlWidth="63px" ShowFilterIcon="false"></telerik:GridDateTimeColumn>
                   <%-- <telerik:GridBoundColumn HeaderText="Fire Arm Number" HeaderStyle-Width="90px" DataField="FireArmNumber" FilterControlWidth="72px" ShowFilterIcon="false" SortExpression="FireArmNumber"></telerik:GridBoundColumn>                   
                    <telerik:GridDateTimeColumn  HeaderText="Fire Arm Expired" HeaderStyle-Width="90px" DataField="FireArmExpired" FilterControlWidth="63px" ShowFilterIcon="false"></telerik:GridDateTimeColumn>--%>
                    <telerik:GridTemplateColumn HeaderText="On Call" HeaderStyle-Width="80px" AllowFiltering="false" UniqueName="OnCallButton">
                    <ItemTemplate>
                      <telerik:RadButton ID="btnOnCall" runat="server" Text="On Call" CommandName="OnCall" >
                          <Icon PrimaryIconCssClass="rbAdd" PrimaryIconLeft="4" PrimaryIconTop="4"></Icon>
                      </telerik:RadButton>
                    </ItemTemplate>
                    </telerik:GridTemplateColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>


**************************************************VB CODE****************************************
  Protected Sub rgOfficersToCallIn_ItemCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles rgOfficersToCallIn.ItemCommand
        Try
            lblMessage.Text = ""
            divMessage.Visible = False            Dim setDate As Date? = rdtpCallIn.SelectedDate.ToString()
            If setDate Is Nothing Then
                Return
            End If
            Dim cellEmployeeID As TableCell = e.Item.Cells(DirectCast(eOfficersCallInColumns.HREmployeeID, Int32))
            If e.CommandName.ToString() = "OnCall" Then
                Dim dba As New DBAccess
                If dba.InsertCallInOfficer(m_SessionID, Convert.ToInt32(cellEmployeeID.Text), setDate) Then
                    If e.Item.Selected = True Then
                        Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)
                        Dim btn As RadButton = DirectCast(item("OnCallButton").FindControl("btnOnCall"), RadButton)
                        btn.Enabled = False
                    End If
                    rgCallIn.Rebind()
                    upCallIn.Update()
                    divMessage.Visible = True
                    lblMessage.Text = "Officer is now on call for " + setDate
                Else
                    rgCallIn.DataSource = New String() {}
                    rgCallIn.DataBind()
                End If
            End If


        Catch ex As Exception
        End Try
    End Sub

Avihai
Top achievements
Rank 1
 answered on 31 Mar 2014
2 answers
242 views
Hi

I have a RadGrid with 3 columns. One of them is a GridDateTimeColumn of type DateTimePicker. I'm trying to set the default time to 4pm instead of midnight when a date is selected.

I found code on another post that shows how to set the default time for a RadDateTimePicker by using a client event for OnDateSelected but I can't get it to work if the datetimepicker is in a grid.

I added a client event for onDateSelected in the code behind (in the RadGrid1_ItemCreated sub) and it does get called when I select a date but it gives me an error when I try to set the time. The error is "Sys.ArgumentNullException: Value cannot be null. Parameter name: instance"

The client event code is

 <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
   <script type="text/javascript">  
       var isTimeSet = false;
       function timeSelecting(sender, args) {
           isTimeSet = true;
       }
       function dateSelected(sender, args) {
                        if (args.get_oldDate() == null && !isTimeSet) {
                            args.set_cancel(true);
                            isTimeSet = true;
                            sender.get_timeView().setTime(16, 0, 0, 0); //I'm getting the error on this line
                        }
                        if (isTimeSet) {
                            isTimeSet = false;
                        }
        }
    </script>
   </telerik:RadCodeBlock>

This code does work with a RadDateTimePicker on the page but won't work for the RadDateTimepicker on the RadGrid. Is there any other way I can set the default time? I'm using version 2013.3.1114.40

My RadGrid -

<telerik:RadGrid ID="RadGrid1" runat="server" CellSpacing="0" GridLines="None" AutoGenerateDeleteColumn="True"
                        AutoGenerateEditColumn="True" AutoGenerateColumns="False" Width="75%">
<MasterTableView CommandItemDisplay="Top" EditMode="InPlace" DataKeyNames="TEST_ID"
        nomasterrecordstext="No records entered">
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"
        visible="False"></RowIndicatorColumn>
<ExpandCollapseColumn Visible="True"
        FilterControlAltText="Filter ExpandColumn column" Created="True"></ExpandCollapseColumn>
    <Columns>
        <telerik:GridDateTimeColumn AllowFiltering="False" AllowSorting="False"
            DataField="TEST_DATE" DataType="System.DateTime"
            FilterControlAltText="Filter column column" HeaderText="Test Date and Time"
            PickerType="DateTimePicker" ShowSortIcon="False" UniqueName="TEST_DATE" >
                <ColumnValidationSettings EnableRequiredFieldValidation="true">
                    <RequiredFieldValidator ForeColor="Red" ErrorMessage="!"></RequiredFieldValidator>                   
                </ColumnValidationSettings>               
        </telerik:GridDateTimeColumn>
        <telerik:GridNumericColumn AllowFiltering="False" AllowSorting="False"
            DataField="TEST" DecimalDigits="1" FilterControlAltText="Filter column1 column"
            HeaderText="Test Column" UniqueName="TEST">
                <ColumnValidationSettings EnableRequiredFieldValidation="true">
                    <RequiredFieldValidator ForeColor="Red" ErrorMessage="!"></RequiredFieldValidator>                                                
                </ColumnValidationSettings>
        </telerik:GridNumericColumn>
        <telerik:GridBoundColumn AllowFiltering="False" AllowSorting="False"
            DataField="TEST_ID" FilterControlAltText="Filter column2 column"
            HeaderText="Test ID" UniqueName="TEST_ID" Visible="False">    
        </telerik:GridBoundColumn>
    </Columns>
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
<PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
    <CommandItemTemplate>
        <table class="style1">
            <tr>
                <td align="right">
                    <asp:LinkButton ID="add" runat="server" CommandName="InitInsert"
                        ForeColor="#0066FF" Text="Add more"></asp:LinkButton>
                </td>
            </tr>
        </table>
    </CommandItemTemplate>
</MasterTableView>
<PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
<FilterMenu EnableImageSprites="False"></FilterMenu>
                    </telerik:RadGrid>

Adding Client Event in code behind

 Protected Sub RadGrid1_ItemCreated(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemCreated
        If (TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode) Then
   If TypeOf e.Item Is GridEditFormInsertItem OrElse TypeOf e.Item Is GridDataInsertItem Then
               
   Dim editor1 As GridDateTimeColumnEditor = CType(item.EditManager.GetColumnEditor("TEST_DATE"), GridDateTimeColumnEditor)
               
   Dim dtp1 As RadDateTimePicker = editor1.PickerControl                
               
                 dtp1.ClientEvents.OnDateSelected = "dateSelected"
                 Dim rtv1 As RadTimeView = editor1.SharedTimeView
                 rtv1.Interval = New TimeSpan(0, 30, 0)
   rtv1.OnClientTimeSelected = "timeSelecting"
             End If
     End If
 End Sub


Thanks
JJ
Top achievements
Rank 1
 answered on 30 Mar 2014
2 answers
212 views
I have an aspx web application develop with the Telerik ajax control suite version 2012.2.812.40 which is running on a Win2003 server and IIS version 6.

When the app is deployed under a virtual directory off one of the existing web sites it runs correctly, but when it is deployed on its own site, the Telerik controls are rendered with a different look and do not function properly.  The textbox control is used on the login page and in the latter case the width is smaller and the control always return a blank string to the logic, regardless of what is entered (the app therefore can't get past the login page).  See the attachments below; the urls for the sites are as follows:

Main Site: www.happc360.com
Virtual Directory Site: www.westernesse.com/happc360

Both deployments are pointing to the SAME location on the web server and therefore are running exactly the same code, style sheets, config, etc.  They are also running in the same application pool.

I have gone over the IIS properties of the main site and the virtual directory with a fine tooth comb, but can't see any significant differences.

What would be causing this?




Richard
Top achievements
Rank 1
 answered on 30 Mar 2014
0 answers
92 views
I need to make an empty RadGrid so that a user can click on add button  or remove button and start adding or deleting his information to the RadGrid and insert those information into a sql server table.( I just want to manipulate the data of that sql server table but I don't want to show the data of the table in the RadGrid)   I have tried all the example but it doesn't work for me. Please help me to find my way in this concept.
shemein
Top achievements
Rank 1
 asked on 30 Mar 2014
0 answers
67 views
I would like to find & compare an earlier row item during the dataBind on my grid.  Here's a partial code I'm hoping to complete:

protected void RadGridX_ItemDataBound(object sender, GridItemEventArgs e)
{
    if (e.Item is GridDataItem)
    {
        GridDataItem item = e.Item as GridDataItem;
        if (item["Name"].Text == "RowIWant")
        {
            foreach(string colName in colNames)
            {
                //get this row's value
                int thisValue = Convert.ToInt32(item[colname].Text);

                // get the value from the RowToCompare
                int earlierValue = ???

            }
        }
    }
}



Scott
Top achievements
Rank 1
 asked on 30 Mar 2014
2 answers
492 views
Hi
Anybody can help me how to change combobox selected value from another combobox selected value when click button (Copy from Mailing). I would like to publish my code and attached with image what i want to do. Appreciate for any help.

Client Side
(
 function bindEventHandlers() {
            $telerik.$('#btnCopyFromBilling').unbind('click').bind('click', function () {
                oncopyfrombilling('COPYBILLING');
            });
            $telerik.$('#btnCopyFromMailing').unbind('click').bind('click', function () {
                oncopyfrombilling('COPYMAILING');
            });
        }
function selectRadComboboxByValue(radcombo, value) {
            radcombo.set_selectedIndex(value);
            debugger
        }
        function oncopyfrombilling(args) {
            var txtAreaBillingAddress = $get('<%=txtAreaBillingAddress.ClientID%>');
            var ddlBillingRegion = $find('<%=ddlBillingRegion.ClientID%>');
            var ddlBillingCity = $find('<%=ddlBillingCity.ClientID%>');
            var txtBillingPostal = $get('<%=txtBillingPostal.ClientID%>');
            var ddlBillingCountry = $find('<%=ddlBillingCountry.ClientID%>');
            
            var txtAreaMailingAddress = $get('<%=txtAreaMailingAddress.ClientID%>');
            var ddlMailingRegion = $find('<%=ddlMailingRegion.ClientID%>');
            var ddlMailingCity = $find('<%=ddlMailingCity.ClientID%>');
            var txtMailingPostal = $get('<%=txtMailingPostal.ClientID%>');
            var ddlMailingCountry = $find('<%=ddlMailingCountry.ClientID%>');
            
            if (args === 'COPYMAILING') {
                alert(args);
                txtAreaBillingAddress.value = txtAreaMailingAddress.value;
                ddlBillingRegion.set_value(ddlMailingRegion.get_value());
                ddlBillingCity.set_value(ddlMailingCity.get_value());
                txtBillingPostal.value = txtMailingPostal.value;
                ddlBillingCountry.set_value(ddlMailingCountry.get_value());
            }
 else if (args === 'COPYBILLING') {
                txtAreaMailingAddress.value = txtAreaMailingAddress.value;
                ddlMailingRegion.set_value(ddlBillingRegion.get_value());
                ddlMailingRegion.set_value(ddlBillingCity.get_value());
                ddlMailingRegion.value = txtBillingPostal.value;
                ddlMailingRegion.set_value(ddlBillingCountry.get_value());
            }
)

ASPX
(
<div class="divStatusAddressFieldSet" id="BillingMailing">
                        <div class="divEmptyRow">
                        </div>
                        <fieldset class="longestFieldset">
                            <legend>
                                <u>5</u>. Billing Address
                            </legend>
                            <div class="divFormControls">
                                <div class="divText">
                                </div>
                                <div class="divInput">
                                    <input type="button" id="btnCopyFromMailing" value="Copy from Mailing (X) " />
                                </div>
                            </div>
                            <div class="divLongFormControls">
                                <div class="divText">
                                    <label>
                                        Address
                                    </label>
                                </div>
                                <div class="divInput">
                                    <textarea id="txtAreaBillingAddress" runat="server" style="height: 95%; width: 96%"></textarea>
                                </div>
                            </div>
                            <div class="divFormControls">
                                <div class="divText">
                                    <label>
                                        Region
                                    </label>
                                </div>
                                <div class="divInput">
                                    <telerik:RadComboBox ID="ddlBillingRegion" runat="server" Skin="Default" ShowDropDownOnTextboxClick="true"
                                                         EmptyMessage="Region" Width="100%" Font-Size="11px" EnableLoadOnDemand="true">
                                        <HeaderTemplate>
                                            <asp:Label ID="lblRegion" runat="server" Text="Region" Font-Bold="true" Font-Size="11px"></asp:Label>
                                        </HeaderTemplate>
                                    </telerik:RadComboBox>
                                   <%-- <telerik:RadDropDownList ID="ddlBillingRegion" runat="server"></telerik:RadDropDownList>--%>
                                </div>
                            </div>
                            <div class="divFormControls">
                                <div class="divText">
                                    <label>
                                        City
                                    </label>
                                </div>
                                <div class="divInput">
                                   <telerik:RadComboBox ID="ddlBillingCity" runat="server" Skin="Default" ShowDropDownOnTextboxClick="true"
                                                         EmptyMessage="City" Width="100%" Height="300px" Font-Size="11px" EnableLoadOnDemand="true">
                                        <HeaderTemplate>
                                            <asp:Label ID="lblBillingCity" runat="server" Text="City" Font-Bold="true" Font-Size="11px"></asp:Label>
                                        </HeaderTemplate>
                                    </telerik:RadComboBox>
                                    <%-- <telerik:RadDropDownList ID="ddlBillingCity" runat="server"></telerik:RadDropDownList>--%>
                                </div>
                            </div>
                            <div class="divFormControls">
                                <div class="divText">
                                    <label>
                                        Postal/Zip code
                                    </label>
                                </div>
                                <div class="divInput">
                                    <input type="text" id="txtBillingPostal" runat="server" />
                                </div>
                            </div>
                            <div class="divFormControls">
                                <div class="divText">
                                    <label>
                                        Country
                                    </label>
                                </div>
                                <div class="divInput">
                                  <telerik:RadComboBox ID="ddlBillingCountry" runat="server" Skin="Default" ShowDropDownOnTextboxClick="true"
                                                         EmptyMessage="Country" Width="100%" Font-Size="11px" EnableLoadOnDemand="true">
                                        <HeaderTemplate>
                                            <asp:Label ID="lblGuestCountry" runat="server" Text="Nationality" Font-Bold="true"
                                                       Font-Size="11px"></asp:Label>
                                        </HeaderTemplate>
                                    </telerik:RadComboBox>
                                    <%--  <telerik:RadDropDownList ID="ddlBillingCountry" runat="server" ></telerik:RadDropDownList>--%>
                                </div>
                            </div>
                        </fieldset>
                        <div class="divEmptyRow">
                        </div>
                        <fieldset class="longestFieldset">
                            <legend>
                                <u>6</u>. Mailing Address
                            </legend>
                            <div class="divFormControls">
                                <div class="divText">
                                </div>
                                <div class="divInput">
                                    <input type="button" id="btnCopyFromBilling" value="Copy from billing (Y) " />
                                </div>
                            </div>
                            <div class="divLongFormControls">
                                <div class="divText">
                                    <label>
                                        Address
                                    </label>
                                </div>
                                <div class="divInput">
                                    <textarea id="txtAreaMailingAddress" runat="server" style="height: 95%; width: 96%"></textarea>
                                </div>
                            </div>
                            <div class="divFormControls">
                                <div class="divText">
                                    <label>
                                        Region
                                    </label>
                                </div>
                                <div class="divInput">
                                    <telerik:RadComboBox ID="ddlMailingRegion" runat="server" Skin="Default" ShowDropDownOnTextboxClick="true"
                                                         EmptyMessage="Region" Width="100%" Font-Size="11px" EnableLoadOnDemand="true">
                                        <HeaderTemplate>
                                            <asp:Label ID="lblRegion" runat="server" Text="Region" Font-Bold="true" Font-Size="11px"></asp:Label>
                                        </HeaderTemplate>
                                    </telerik:RadComboBox>
                                </div>
                            </div>
                            <div class="divFormControls">
                                <div class="divText">
                                    <label>
                                        City
                                    </label>
                                </div>
                                <div class="divInput">
                                    <telerik:RadComboBox ID="ddlMailingCity" runat="server" Skin="Default" ShowDropDownOnTextboxClick="true"
                                                         EmptyMessage="City" Width="100%" Font-Size="11px" EnableLoadOnDemand="true">
                                        <HeaderTemplate>
                                            <asp:Label ID="lblMainlingCity" runat="server" Text="City" Font-Bold="true" Font-Size="11px"></asp:Label>
                                        </HeaderTemplate>
                                    </telerik:RadComboBox>
                                </div>
                            </div>
                            <div class="divFormControls">
                                <div class="divText">
                                    <label>
                                        Postal/Zip code
                                    </label>
                                </div>
                                <div class="divInput">
                                    <input type="text" id="txtMailingPostal" runat="server" />
                                </div>
                            </div>
                            <div class="divFormControls">
                                <div class="divText">
                                    <label>
                                        Country
                                    </label>
                                </div>
                                <div class="divInput">
                                    <telerik:RadComboBox ID="ddlMailingCountry" runat="server" Skin="Default" ShowDropDownOnTextboxClick="true"
                                                         EmptyMessage="Country" Width="100%" Height="300px" Font-Size="11px" EnableLoadOnDemand="true">
                                        <HeaderTemplate>
                                            <asp:Label ID="lblMailingCountry" runat="server" Text="Nationality" Font-Bold="true"
                                                       Font-Size="11px"></asp:Label>
                                        </HeaderTemplate>
                                    </telerik:RadComboBox>
                                </div>
                            </div>
                        </fieldset>
                    </div>
)
 
Myo
Top achievements
Rank 1
 answered on 30 Mar 2014
6 answers
749 views
Hi
I am a newbie so please excuse if this is too easy!

I am using a RadGrid and want to catch a double click on a row and then process a VB code routine I have to setup some data values, update a table and pass control over to another page to display a report. All the code in the VB is fine and works if I just press a button and catch the click. I just need the grid double click to do the same.

I have trawled the forums for hours and tried various code snippets from different posts but none of them seem to work. What I have is this

ASPX
<script type="text/javascript">
    function RowDoubleClick(index) {
        __doPostBack("<%= grdDashboards.UniqueId %>", "RowDblClicked:" + this.Rows[index].ItemIndex);
    }
    </script>


Also in the ASPX are a couple of Grid client settings
<telerik:RadGrid ID="grdDashboards" runat="server">
   <ClientSettings EnableRowHoverStyle="true">
     <ClientEvents OnRowDblClick="RowDoubleClick"></ClientEvents>
   </ClientSettings>
 </telerik:RadGrid>


Then in the VB behind I have
Protected Overrides Sub RaisePostBackEvent(ByVal source As IPostBackEventHandler, ByVal eventArgument As String)
       MyBase.RaisePostBackEvent([source], eventArgument)
 
       If ([source] Is grdDashboards) And (eventArgument.IndexOf("RowDblClicked") <> -1) Then
           Dim item As GridDataItem = grdDashboards.Items(Integer.Parse(eventArgument.Split(":"c)(1)))
 
           Response.Write([String].Format("ReportID:{0}", item.GetDataKeyValue("ReportID")))
 
       End If
   End Sub

This never seems to get called as a breakpoint nevers gets processed.

Where my test VB  code above has the Response.Write debug output I just want to call my Sub that does all the work of passing on to the next page.

All the code has been copy/pasted from examples in here.

Problem is, double clicking on the RadGrid (grdDashboards) has no effect. Nothing is firing off.

Any help much appreciated as a deadline is looming!!

Just to be clear, I am using VS2010, Framework 4, VB.NET code behind with the following Imports at the head of the VB page

Imports System.Data
Imports System.Data.SqlClient
Imports Telerik.Web.UI

Many thanks
Mark
Silvio Silva Junior
Top achievements
Rank 2
 answered on 29 Mar 2014
2 answers
183 views
Okay, something changed in the most recent version. We used to be able to use the advanced editor as follows.

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">   
    
    <%-- register the RadWindow for the Advanced Editing --%>
    <telerik:RadWindow runat="server" ID="RadWindowAdvEditor" NavigateUrl="~/RegisterPro/radeditorwindow.aspx" EnableEmbeddedBaseStylesheet="true" VisibleTitlebar="true" OnClientShow="SetDialogContent" OnClientPageLoad="SetDialogContent" Behaviors="Maximize,Close,Move" Width="800px" Modal="true" Height="700px" />

<fieldset id="FieldSetMain" class="ui-widget ui-widget-content ui-corner-all" style="padding: 10px; width: 960px;">
        <legend id="LegendEventManager" class="ui-widget-header ui-corner-all">  Events Manager  </legend>
        <%-- Grid for add/edit/delete events (master and sub) --%>
        <div style="float: left;">
            <%-- script for the RadWindow --%>
            <telerik:RadScriptBlock ID="RadScriptBlockEditor" runat="server">
                <script type="text/javascript">
                    //![CDATA[
 
                    var myEditorContent = null;
                    var myMessageType = "CommandExecute?";
                    var myEditor;
 
                    jQuery(function () {
                        if (typeof (RadEditorCommandList) != "undefined") {
                            Telerik.Web.UI.Editor.CommandList["RichEditor"] = function (commandName, editor, args) {
                                myEditor = editor;                                      // set editor object so we can use it from window return - SetEditorContent
                                myEditorContent = editor.get_html(true);              //get RadEditor content
                                $find("<%= RadWindowAdvEditor.ClientID%>").show();     //open RadWindow
                                    }
                                }
                            })
 
                            function SetEditorContent(content) {
                                //set content to RadEditor on the main page from RadWindow                                               
                                myEditor.set_html(content);
                            }
 
                            function SetDialogContent(oWnd) {
                                var myContentWindow = oWnd.get_contentFrame().contentWindow;
                                if (myContentWindow && myContentWindow.setContent) {
                                    window.setTimeout(function () {
                                        //pass and set the content from the mane page to RadEditor in RadWindow                                                       
                                        myContentWindow.setContent(myEditorContent);
                                    }, 500);
                                }
                            }

<telerik:RadGrid runat="server" ID="RadGridEventMaster" Height="100%" Width="97%" AllowMultiRowSelection="false" AutoGenerateColumns="True" ShowHeader="False" AllowAutomaticUpdates="false" AllowAutomaticInserts="false">
                        <MasterTableView CommandItemDisplay="Top" NoMasterRecordsText="There are no events to display..." DataKeyNames="EventMasterId" EditMode="EditForms" AllowAutomaticUpdates="false" AllowAutomaticInserts="false">
                            <CommandItemTemplate>
 
 
                            <%-- Edit form master event template --%>
                            <EditFormSettings EditFormType="Template">
                                <FormTemplate>
 
                                        <telerik:RadGrid runat="server" ID="RadGridEventSub" Height="100%" Width="100%" AllowMultiRowSelection="false" AutoGenerateColumns="false" OnItemCommand="RadGridEventSub_ItemCommand" OnDeleteCommand="RadGridEventSub_DeleteCommand" OnInsertCommand="RadGridEventSub_InsertCommand" OnUpdateCommand="RadGridEventSub_UpdateCommand" OnNeedDataSource="RadGridEventSub_NeedDataSource"
                                            OnItemDataBound="RadGridEventSub_ItemDataBound" OnItemCreated="RadGridEventSub_ItemCreated" AllowAutomaticUpdates="true" AllowAutomaticInserts="true">
                                            <MasterTableView CommandItemDisplay="Top" NoMasterRecordsText="There are no events to display..." DataKeyNames="EventMasterId, EventSubId, GroupId, Name, EventTypeId, BoardPositionId" EditMode="EditForms">
                                                <CommandItemSettings AddNewRecordText="Add a new sub event" ShowRefreshButton="false" />
 
 
 
                                                                                    <div>
                                                                                        <telerik:RadEditor runat="server" ID="RadEditorEmailNotificationMsg" ToolsWidth="100%" Height="200px" Width="100%" EnableResize="false" ContentAreaMode="Div" Content='<%# Eval("EmailNotificationMsg") %>'>
                                                                                            <Tools>
                                                                                                <telerik:EditorToolGroup>
                                                                                                    <telerik:EditorTool Name="RichEditor" Text="Open Advanced Editor" />
                                                                                                    <telerik:EditorTool Name="Bold" />
                                                                                                    <telerik:EditorTool Name="Italic" />
                                                                                                    <telerik:EditorTool Name="Underline" />
                                                                                                    <telerik:EditorTool Name="Cut" />
                                                                                                    <telerik:EditorTool Name="Copy" />
                                                                                                    <telerik:EditorTool Name="Paste" />
                                                                                                    <telerik:EditorTool Name="FontName" />
                                                                                                    <telerik:EditorTool Name="RealFontSize" />
                                                                                                </telerik:EditorToolGroup>
                                                                                            </Tools>
                                                                                        </telerik:RadEditor>
                                                                                    </div>

                                    </div>
                                </FormTemplate>
                            </EditFormSettings>
                            <%-- Edit form template --%>
                        </MasterTableView>
                    </telerik:RadGrid>
                </div>
            </FormTemplate>
        </EditFormSettings>
    </MasterTableView>
</telerik:RadGrid>


Okay instead of putting 10000 lines of code i took pieces out to show what we are doing and was working. 

We declare a RadWindow at the beginning of code (line 150) - "RadWindowAdvEditor"
We set code for the Editor before the Grid (which worked (line 208) - moving after the grid didnt matter (line 1472)) - "RadScriptBlockEditor"

We have 2 Grids, 1 Grid holds a master record (line 259) and when in edit mode it shows another Grid (line 466) which hold sub items of the master record. So you edit one of the sub items from the sub grid and it shows 3 editors and lots of other stuff. All in a EditFormSettings->FormTemplate of the sub grid. 

The user, before the update Q1 2014, was able to click on the RichEditor icon and open up the RadWindow to edit and it sent back the content and updated the RadEditor embedded in the EditForm correctly. This worked for years, we were on a 2013 version. You can see from the last code snippet that the RadEditors are indeed embedded in 2 grids.

Now we tried to change it around, put the script at the end. We cant put it after the RadEditor object declare due to it being in a Edit form. The reason is all of a sudden the clients are getting the dreaded "The command RichEditor is not implemented yet."   

We have other forms w/o the Grids and Edit Forms - just laying on a WebForm and it works fine. The code is BEFORE the declaration of the RadEditor and we dont have a problem.

Please advise! We have clients who can not use the advanced editor for the their registration emails that we provide for them.

Thanks Telerik!







SDI
Top achievements
Rank 1
 answered on 29 Mar 2014
3 answers
171 views
Hi, 

Is it possible to show an empty label when the column has a zero value? I've tried DataFormatString="{0:#}" but it doesn't work.



<telerik:RadHtmlChart runat="server" ID="RadHtmlChart1" Height="550px" Style="left: 10px; right: 10px;"  >
    <PlotArea>
        
        <Series>
            <telerik:ColumnSeries DataFieldY="AcumuladoAnt"  Name="<%$Resources:htmlChartAnterior %>" >
               <LabelsAppearance DataFormatString="{0:#}"></LabelsAppearance>
                
            </telerik:ColumnSeries>
            <telerik:ColumnSeries DataFieldY="AcumuladoAct" Name="<%$Resources:htmlChartActual %>">
                 <LabelsAppearance DataFormatString="{0:#}" ></LabelsAppearance>
            </telerik:ColumnSeries>
        </Series>
        <XAxis DataLabelsField="Mes">
            <TitleAppearance Text="<%$Resources:htmlChartMes %>">
                <TextStyle Margin="20" />
            </TitleAppearance>
            <MajorGridLines Visible="false" />
            <MinorGridLines Visible="false" />
        </XAxis>
        <YAxis>
            <TitleAppearance Text="<%$Resources:htmlChartImporte %>">
                <TextStyle Margin="20" />
            </TitleAppearance>
              
            <MinorGridLines Visible="false" />
        </YAxis>
    </PlotArea>
    <ChartTitle Text="<%$Resources:htmlChartTitle %>">
    </ChartTitle>
    <Legend>
        <Appearance BackgroundColor="White" Position="Bottom">
            <TextStyle Bold="false" FontFamily="Helvetica" Italic="false" Color="Black" FontSize="12"
                Margin="0" Padding="0" />
        </Appearance>
    </Legend>
</telerik:RadHtmlChart>

Here is a screenshot of the graph.

Thank you
Roberto

Jim
Top achievements
Rank 1
 answered on 28 Mar 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?