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

I'm trying to attach a client-side focus event to the RadEditor, which I'm using in Preview mode.
I've tried to follow some of the examples hat I've seen on the forum here.  I've got it working correctly in IE, however I'm having trouble in Firefox or Chrome - the focus event doesn't seem to get triggered.

The JavaScript I'm using to set up the focus event is:

<script type="text/javascript">
    function setupEditorFocus(editor, eventArgs) {
        var EditorElement = editor.get_contentArea();
        $telerik.addExternalHandler(EditorElement, "focus", function () {
            editorFocus(editor.get_id());
        });
    }
    function editorFocus(editorId) {
        document.getElementById("messageArea").innerHTML = "Set focus " + Date();
    }
     
</script>

And my RadEditor is set up using:

<telerik:RadEditor id="RadEditor1" runat="server" onclientload="setupEditorFocus" editmodes="Preview">
    <Content>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</Content>
</telerik:RadEditor>


Thanks in advance for any help!

Richard
Richard
Top achievements
Rank 1
 answered on 31 May 2013
10 answers
432 views
How can I set the grid to collapse it's groups on load via client side script.

I was previously doing this server side but I need to grid to stay expanded for people who have javascript disabled (the grid only collapses if the user has javascript on)

Vasil
Telerik team
 answered on 31 May 2013
5 answers
127 views
For those wanting to remove the default width on RadTextBoxes (or in my case RadNumericTextBoxes) you've probably come across this outdated solution. Here's the updated method that I used to solve this problem:
function RemoveWidth(sender, args) {
    sender.get_wrapperElement().style.removeProperty("width");
}

Attach this to the client OnLoad event and you should be good to go.

(I'll leave it up to Telerik to update the Code Library and/or correct my solution.)
Vasil
Telerik team
 answered on 31 May 2013
3 answers
102 views
I am receiving this error when i click on a radbutton when running my website in Azure, but it runs perfectly in the emulator.

[NullReferenceException: Object reference not set to an instance of an object.]
   System.Object.GetType() +0
   Telerik.Web.UI.RadCompression.Compress(HttpApplication application) +803
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +270

This error was gotten by using Fiddler...

Thoughts

Michael
Radoslav
Telerik team
 answered on 31 May 2013
1 answer
98 views
On this example, http://demos.telerik.com/aspnet-ajax/filter/examples/overview/defaultcs.aspx how can I make orderdate date only on filter, do not show the time filter, If I have a time filter, how to make the filter show time only?

Thanks!
Eyup
Telerik team
 answered on 31 May 2013
1 answer
63 views
How to get data items of nested grid(2nd level). I have to get all rows values on client side.
Princy
Top achievements
Rank 2
 answered on 31 May 2013
1 answer
84 views
Hi,

I am using a RadGrid with a HeaderContextMenu.  I would like to use a custom skin on the RadGrid (EnableEmbeddedSkins="false", Skin=""), but an embedded skin (Skin="Default") on the RadMenu/HeaderContextMenu.  How do I accomplish this?

Thanks,
Dave
Shinu
Top achievements
Rank 2
 answered on 31 May 2013
2 answers
100 views
Hello

I'm having trouble with a RadWindow, but first I want to quickly explain the order of the items that I have on the page.

Please see image001.png code corresponding to the following

<td colspan="6">
                   <telerik:RadTabStrip ID="tabInformation" runat="server" SelectedIndex="0" Width="100%"
                       MultiPageID="RadMultiPage1" CausesValidation="False" OnTabClick="tabInformation_TabClick">
                       <Tabs>
                           <telerik:RadTab runat="server" Text="Comentarios" Selected="True" PageViewID="Comments">
                           </telerik:RadTab>
                           <telerik:RadTab runat="server" Text="Teléfonos" PageViewID="Phones">
                           </telerik:RadTab>
                           <telerik:RadTab runat="server" Text="Direcciones" PageViewID="Address">
                           </telerik:RadTab>
                           <telerik:RadTab runat="server" Text="Correos Electrónicos" PageViewID="Emails">
                           </telerik:RadTab>
                       </Tabs>
                   </telerik:RadTabStrip>
                   <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0">
 
                       <telerik:RadPageView ID="RadPageView4" runat="server" Width="100%">
                           <telerik:RadTextBox ID="txtComments" runat="server" Height="100px" TextMode="MultiLine" Width="550px"></telerik:RadTextBox>
                       </telerik:RadPageView>
                       <telerik:RadPageView ID="RadPageView1" runat="server">
                           <telerik:RadToolBar ID="radPhones" runat="server" OnButtonClick="radPhones_ButtonClick">
                               <Items>
                                   <telerik:RadToolBarButton runat="server" CommandName="New" ImageUrl="~/Images/ToolBar/new.png"
                                       Text="Nuevo" CausesValidation="false">
                                   </telerik:RadToolBarButton>
                               </Items>
                           </telerik:RadToolBar>
                           <telerik:RadGrid ID="dtgPhones" runat="server" AutoGenerateColumns="False" CellSpacing="0" GridLines="None">
                               <ExportSettings>
                                   <Pdf PageWidth="" />
                               </ExportSettings>
                               <MasterTableView NoMasterRecordsText="No hay registros para mostrar.">
                                   <CommandItemSettings ExportToPdfText="Export to PDF" />
                                   <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True"></RowIndicatorColumn>
                                   <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True"></ExpandCollapseColumn>
                                   <Columns>
                                       <telerik:GridBoundColumn DataField="PHONE_ID" FilterControlAltText="Filter PHONE_ID column" HeaderText="ID" UniqueName="PHONE_ID" Visible="false"></telerik:GridBoundColumn>
                                       <telerik:GridBoundColumn DataField="PERSON_ID" FilterControlAltText="Filter PERSON_ID column" HeaderText="ID_PERSON" UniqueName="PERSON_ID" Visible="false"></telerik:GridBoundColumn>
                                       <telerik:GridBoundColumn DataField="INDICATIVE" FilterControlAltText="Filter INDICATIVE column" HeaderText="Indicativo" UniqueName="INDICATIVE"></telerik:GridBoundColumn>
                                       <telerik:GridBoundColumn DataField="PHONE" FilterControlAltText="Filter NUMERO column" HeaderText="Número" UniqueName="NUMERO"></telerik:GridBoundColumn>
                                       <telerik:GridBoundColumn DataField="EXTENSION" FilterControlAltText="Filter EXTENSION column" HeaderText="Ext." UniqueName="EXTENSION"></telerik:GridBoundColumn>
                                       <telerik:GridBoundColumn DataField="TYPE_DESCRIPTION" FilterControlAltText="Filter TYPE_DESCRIPTION column" HeaderText="Tipo" UniqueName="TYPE_DESCRIPTION"></telerik:GridBoundColumn>
                                       <telerik:GridBoundColumn DataField="TYPE" FilterControlAltText="Filter TYPE column" HeaderText="Tipo" UniqueName="TYPE" Visible="False">
                                       </telerik:GridBoundColumn>
                                       <telerik:GridCheckBoxColumn DataField="PRINCIPAL" FilterControlAltText="Filter PRINCIPAL column" HeaderText="Principal" UniqueName="PRINCIPAL">
                                           <HeaderStyle HorizontalAlign="Center" />
                                           <ItemStyle HorizontalAlign="Center" />
                                       </telerik:GridCheckBoxColumn>
                                       <telerik:GridCheckBoxColumn DataField="ACTIVE" FilterControlAltText="Filter ACTIVE column" HeaderText="Active" UniqueName="ACTIVE">
                                           <HeaderStyle HorizontalAlign="Center" />
                                           <ItemStyle HorizontalAlign="Center" />
                                       </telerik:GridCheckBoxColumn>
                                   </Columns>
                                   <PagerStyle PageSizeControlType="RadComboBox" />
                               </MasterTableView><PagerStyle PageSizeControlType="RadComboBox" />
                               <FilterMenu EnableImageSprites="False"></FilterMenu>
                           </telerik:RadGrid>
                       </telerik:RadPageView>
 
                       <telerik:RadPageView ID="RadPageView2" runat="server">
                           <telerik:RadGrid ID="dtgAddress" runat="server" AutoGenerateColumns="False" CellSpacing="0" GridLines="None">
                               <ExportSettings>
                                   <Pdf PageWidth="" />
                               </ExportSettings>
                               <MasterTableView NoMasterRecordsText="No hay registros para mostrar.">
                                   <CommandItemSettings ExportToPdfText="Export to PDF" />
                                   <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True">
                                       <HeaderStyle Width="20px" />
                                   </RowIndicatorColumn>
                                   <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True">
                                       <HeaderStyle Width="20px" />
                                   </ExpandCollapseColumn>
                                   <Columns>
                                       <telerik:GridBoundColumn DataField="ADDRESS_ID" FilterControlAltText="Filter ADDRESS_ID column" HeaderText="ID" UniqueName="ADDRESS_ID" Visible="false"></telerik:GridBoundColumn>
                                       <telerik:GridBoundColumn DataField="PERSON_ID" FilterControlAltText="Filter PERSON_ID column" HeaderText="PersonID" UniqueName="PERSON_ID" Visible="false"></telerik:GridBoundColumn>
                                       <telerik:GridBoundColumn DataField="ADDRESS" FilterControlAltText="Filter ADDRESS column" HeaderText="Dirección" UniqueName="ADDRESS"></telerik:GridBoundColumn>
                                       <telerik:GridBoundColumn DataField="TYPE" FilterControlAltText="Filter TYPE column" HeaderText="Tipo" UniqueName="TYPE" Visible="false"></telerik:GridBoundColumn>
                                       <telerik:GridBoundColumn DataField="TYPE_DESCRIPTION" FilterControlAltText="Filter TYPE_DESCRIPTION column" HeaderText="Tipo" UniqueName="TYPE_DESCRIPTION"></telerik:GridBoundColumn>
                                       <telerik:GridCheckBoxColumn DataField="PRINCIPAL" FilterControlAltText="Filter PRINCIPAL column" HeaderText="Principal" UniqueName="PRINCIPAL">
                                           <HeaderStyle HorizontalAlign="Center" />
                                           <ItemStyle HorizontalAlign="Center" />
                                       </telerik:GridCheckBoxColumn>
                                       <telerik:GridCheckBoxColumn DataField="ACTIVE" FilterControlAltText="Filter ACTIVE column" HeaderText="Active" UniqueName="ACTIVE">
                                           <HeaderStyle HorizontalAlign="Center" />
                                           <ItemStyle HorizontalAlign="Center" />
                                       </telerik:GridCheckBoxColumn>
                                   </Columns>
                                   <PagerStyle PageSizeControlType="RadComboBox" />
                               </MasterTableView>
                               <PagerStyle PageSizeControlType="RadComboBox" />
                               <FilterMenu EnableImageSprites="False">
                               </FilterMenu>
                           </telerik:RadGrid>
                       </telerik:RadPageView>
                       <telerik:RadPageView ID="RadPageView3" runat="server">
                           <telerik:RadGrid ID="dtgEmails" runat="server" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True" AutoGenerateColumns="False" CellSpacing="0" GridLines="None">
                               <ExportSettings>
                                   <Pdf PageWidth="" />
                               </ExportSettings>
                               <MasterTableView NoMasterRecordsText="No hay registros para mostrar.">
                                   <CommandItemSettings ExportToPdfText="Export to PDF" />
                                   <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True">
                                       <HeaderStyle Width="20px" />
                                   </RowIndicatorColumn>
                                   <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True">
                                       <HeaderStyle Width="20px" />
                                   </ExpandCollapseColumn>
                                   <Columns>
                                       <telerik:GridBoundColumn DataField="MAIL_ID" FilterControlAltText="Filter MAIL_ID column" HeaderText="ID" UniqueName="MAIL_ID" Visible="false"></telerik:GridBoundColumn>
                                       <telerik:GridBoundColumn DataField="PERSON_ID" FilterControlAltText="Filter PERSON_ID column" HeaderText="PersonID" UniqueName="PERSON_ID" Visible="false"></telerik:GridBoundColumn>
                                       <telerik:GridBoundColumn DataField="EMAIL" FilterControlAltText="Filter EMAIL column" HeaderText="Correo" UniqueName="EMAIL"></telerik:GridBoundColumn>
                                       <telerik:GridBoundColumn DataField="TYPE" FilterControlAltText="Filter TYPE column" HeaderText="Tipo" UniqueName="TYPE" Visible="false"></telerik:GridBoundColumn>
                                       <telerik:GridBoundColumn DataField="TYPE_DESCRIPTION" FilterControlAltText="Filter TYPE_DESCRIPTION column" HeaderText="Tipo" UniqueName="TYPE_DESCRIPTION"></telerik:GridBoundColumn>
                                       <telerik:GridCheckBoxColumn DataField="PRINCIPAL" FilterControlAltText="Filter PRINCIPAL column" HeaderText="Principal" UniqueName="PRINCIPAL">
                                           <HeaderStyle HorizontalAlign="Center" />
                                           <ItemStyle HorizontalAlign="Center" />
                                       </telerik:GridCheckBoxColumn>
                                       <telerik:GridCheckBoxColumn DataField="ACTIVE" FilterControlAltText="Filter ACTIVE column" HeaderText="Active" UniqueName="ACTIVE">
                                           <HeaderStyle HorizontalAlign="Center" />
                                           <ItemStyle HorizontalAlign="Center" />
                                       </telerik:GridCheckBoxColumn>
                                   </Columns>
                                   <EditFormSettings>
                                       <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                       </EditColumn>
                                   </EditFormSettings>
                                   <PagerStyle PageSizeControlType="RadComboBox" />
                               </MasterTableView>
                               <PagerStyle PageSizeControlType="RadComboBox" />
                               <FilterMenu EnableImageSprites="False">
                               </FilterMenu>
                           </telerik:RadGrid>
                       </telerik:RadPageView>
 
                   </telerik:RadMultiPage>
                   <telerik:RadWindowManager ID="RadWindowEditors" runat="server" Behaviors="Resize, Close, Move" VisibleStatusbar="False"></telerik:RadWindowManager>
               </td>

This is the problem
You can navigate the tabs without problems, but if the user is in the tab "Telefonos" and press the button Nuevo (New) shows the window see imagen002.png, the user can save or close and the window disappears, but when switching between tabs, the window reappears, as if the user would click on the button again.

The code of the Nuevo (New) button is as follows:

RadWindowEditors.Modal = true;
RadWindowEditors.CenterIfModal = true;
 
string url = string.Format("PersonsPhonesEditor.aspx?action=new&personID={0}", lblIDPerson.Text.Trim());
 
RadWindow newWindow = new RadWindow();
newWindow.NavigateUrl = url;
newWindow.VisibleOnPageLoad = true;
newWindow.Height = 300;
newWindow.Width = 550;
RadWindowEditors.Windows.Add(newWindow);


Thanks


Jhon Williams
Top achievements
Rank 1
 answered on 31 May 2013
1 answer
559 views
Hello, 
How to extract values from a GridEditFormItem from server side.
Here is my code.

ASP Markup :
<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" CellSpacing="0"
    Skin="Transparent" GridLines="None" PageSize="10" AllowCustomPaging="True" AutoGenerateColumns="False"
    AllowSorting="True" OnItemDataBound="RadGrid1_ItemDataBound1" OnRowDrop="RadGrid1_OnRowDrop"
    AllowAutomaticUpdates="true" OnUpdateCommand="RadGrid1_UpdateCommand">
    <PagerStyle Mode="NumericPages" />
    <ClientSettings AllowRowsDragDrop="True">
        <Selecting AllowRowSelect="true" />
        <ClientEvents OnRowDropping="rowDropping" OnRowDblClick="RowDblClick" OnCommand="GridCommand" />
        <Resizing AllowColumnResize="true" />
    </ClientSettings>
    <MasterTableView AllowCustomPaging="False" AutoGenerateColumns="false" Caption="<%$Resources:BrandixResources, PWI_UnplannedItemsGrid_Title%>"
        Visible="True" DataKeyNames="ID, Effort" AllowNaturalSort="false" ClientDataKeyNames="Subject, Description, Effort">
        <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
        <SortExpressions>
            <telerik:GridSortExpression FieldName="DueDateTime" SortOrder="Ascending" />
        </SortExpressions>
        <Columns>
            <telerik:GridBoundColumn UniqueName="ID" Visible="false" DataField="ID" ReadOnly="True">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn HeaderText="<%$Resources: Resources, Subject%>"
                DataField="Subject" UniqueName="Subject" ReadOnly="True">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn HeaderText="<%$Resources: Resources,  DueDate%>"
                DataField="DueDateTime" DataFormatString="{0:dd/MM/yyyy} {0:hh}:{0:mm} {0:tt}"
                ReadOnly="True">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn HeaderText="<%$Resources: Resources, Effort%>"
                DataField="Effort">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn HeaderText="<%$Resources: Resources,  UnplannedHours%>"
                DataField="UnplannedHours" ReadOnly="True">
            </telerik:GridBoundColumn>
            <telerik:GridTemplateColumn HeaderText="<%$Resources: Resources,  DraftPlan%>"
                UniqueName="DraftPlan" SortExpression="Status" ReadOnly="True">
                <ItemTemplate>
                    <asp:Label ID="lblGridStatus" runat="server" />
                </ItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
        <EditFormSettings>
            <EditColumn UniqueName="EditCommandColumn1">
            </EditColumn>
        </EditFormSettings>
    </MasterTableView>
</telerik:RadGrid>

Javascript : 

var editedRow;
 
        function RowDblClick(sender, eventArgs) {
            editedRow = eventArgs.get_itemIndexHierarchical();
            $find("<%= RadGrid1.ClientID %>").get_masterTableView().editItem(editedRow);
        }
 
        function GridCommand(sender, args) {
            if (args.get_commandName() != "Edit") {
                editedRow = null;
            }
        }


C# code : 
Attempt 1 :
protected void RadGrid1_UpdateCommand(object sender, GridCommandEventArgs e)
{
    GridEditableItem item = e.Item as GridEditableItem;
    Dictionary<string, string> values = new Dictionary<string, string>();
    item.ExtractValues(values);
    int id = Convert.ToInt32(item.GetDataKeyValue("ID"));
}

Attempt 2 : 
protected void RadGrid1_UpdateCommand(object sender, GridCommandEventArgs e)
{
    GridEditableItem item = e.Item as GridEditableItem;
    Dictionary<string, string> values = new Dictionary<string, string>();
    e.Item.OwnerTableView.ExtractValuesFromItem(values, item);
}

When I double click a row, the edit form pops below the row. But when I change the value and click update. It is not getting the new value. Instead its getting the old value. Please tell me how to get the new value.

Img1 : The new value I entered,
Img2 : Value I get from the code.

Really need some help on this.
Elliott
Top achievements
Rank 2
 answered on 30 May 2013
7 answers
514 views
Hi All

I have a radgrid and a button

While clicking the button the datas in the radgrid in exported to the pdf.

But the font size in pdf is 12pt.

I want it to be 8pt.

Is there any possible way.

Thank you

-Anto
L
Top achievements
Rank 1
 answered on 30 May 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?