Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
110 views
Hi, I want to change htm's name and his links too, for this i'm trying to use radeditor, my question is, it's posible to modify links in htm with radeditor in c#?, i'm trying with this code:
 RadEditor1.Content = ReadFile(Server.MapPath("~/"+Root()+"/example.htm");
                    string mod = Root().Replace(" ", "%20");
                    RadEditor1.Content.Replace("href='"+mod,"href='"+NewRoot);
                     using (StreamWriter externalFile = new StreamWriter(Path.Combine(Server.MapPath("~/"+NewRoot), "Newexample.htm"), false, Encoding.UTF8))//Open file for writing and write content
                    {
                        externalFile.Write(RadEditor1.Content);
                    }
 protected string ReadFile(string path)
    {
        if (!System.IO.File.Exists(path))
        { return string.Empty; }//fin if file exists
        using (System.IO.StreamReader sr = new System.IO.StreamReader(path, Encoding.GetEncoding("macintosh")))
        { return sr.ReadToEnd(); }
    }
but I think that Replace() no work with html, please help me
Rumen
Telerik team
 answered on 17 Jul 2012
1 answer
161 views
Hi, 

Since 2012.2.607.35 my delete column imageurl is not showing my custom image anymore. It is showing the Telerik default one.

I didn't change anything in my code.

ASPX:
<telerik:RadGrid ID="gridAllergies" runat="server" CellSpacing="0" GridLines="None">
            <ClientSettings>
                <Selecting CellSelectionMode="None"></Selecting>
            </ClientSettings>
            <MasterTableView CommandItemDisplay="Top">
                <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
                <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                </RowIndicatorColumn>
                <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridEditCommandColumn FilterControlAltText="Filter EditCommandColumn column"
                        ButtonType="ImageButton" EditText="Modifier" Resizable="False" EditImageUrl="Images/Icons/006-Write-New-Icon.png"
                        UniqueName="colEdit">
                        <HeaderStyle Width="32px"></HeaderStyle>
                        <ItemStyle Width="32px" />
                    </telerik:GridEditCommandColumn>
                    <telerik:GridButtonColumn CommandName="Delete"
                        FilterControlAltText="Filter column column" Text="Supprimer" UniqueName="colDelete"
                        ButtonType="ImageButton" ImageUrl="Images/Icons/059-Close-Delete-circle-Icon.png"
                        ConfirmDialogType="Classic">
                        <HeaderStyle Width="32px"></HeaderStyle>
                        <ItemStyle Width="32px" />
                    </telerik:GridButtonColumn>
                    <telerik:GridBoundColumn DataField="palg_noauto" FilterControlAltText="Filter column1 column"
                        UniqueName="colNoAuto" Visible="False" ReadOnly="True">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="allergie" FilterControlAltText="Filter column2 column"
                        UniqueName="colAllergie" CurrentFilterFunction="StartsWith" FilterDelay="1500"
                        ShowFilterIcon="false" ReadOnly="True">
                    </telerik:GridBoundColumn>
                    <telerik:GridCheckBoxColumn DataField="isGroupe" DataType="System.Boolean" FilterControlAltText="Filter column column"
                        ReadOnly="True" UniqueName="colIsGroupe" ShowFilterIcon="false" AllowFiltering="False">
                        <ItemStyle HorizontalAlign="Center" />
                        <HeaderStyle HorizontalAlign="Center" Width="64px" />
                    </telerik:GridCheckBoxColumn>
                    <telerik:GridDateTimeColumn DataField="Date" FilterControlAltText="Filter column3 column"
                        UniqueName="colDate" CurrentFilterFunction="StartsWith" FilterDelay="1500" ShowFilterIcon="false"
                        DataType="System.String" EditFormHeaderTextFormat="">
                    </telerik:GridDateTimeColumn>
                    <telerik:GridDropDownColumn FilterControlAltText="Filter column8 column" UniqueName="colGenerique"
                        ListValueField="gene_numero" ListTextField="gene_nom" ShowFilterIcon="False"
                        Visible="False" DropDownControlType="RadComboBox" DataField="gene_numero">
                    </telerik:GridDropDownColumn>
                    <telerik:GridDropDownColumn FilterControlAltText="Filter column7 column" UniqueName="colGroupeDesc"
                        ListValueField="gral_numero" ListTextField="gral_description" ShowFilterIcon="False"
                        Visible="False" DropDownControlType="RadComboBox" DataField="gral_numero">
                    </telerik:GridDropDownColumn>
                    <telerik:GridBoundColumn DataField="palg_texte_1" FilterControlAltText="Filter column4 column"
                        UniqueName="colTexte1" CurrentFilterFunction="StartsWith" FilterDelay="1500"
                        ShowFilterIcon="false">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="palg_texte_2" FilterControlAltText="Filter column5 column"
                        UniqueName="colTexte2" CurrentFilterFunction="StartsWith" FilterDelay="1500"
                        ShowFilterIcon="false">
                    </telerik:GridBoundColumn>
                    <telerik:GridCheckBoxColumn DataField="isImprime" FilterControlAltText="Filter colImprimer column"
                        UniqueName="colImprimer" Visible="False">
                    </telerik:GridCheckBoxColumn>
                </Columns>
                <SortExpressions>
                    <telerik:GridSortExpression FieldName="allergie" SortOrder="Ascending" />
                </SortExpressions>
                <EditFormSettings>
                    <EditColumn ButtonType="PushButton" CancelText="Annuler" UpdateText="Enregistrer"
                        InsertText="Ajouter" FilterControlAltText="Filter EditCommandColumn column">
                    </EditColumn>
                </EditFormSettings>
            </MasterTableView>
            <FilterMenu EnableImageSprites="False">
            </FilterMenu>
            <EditItemStyle BackColor="Silver" />
        </telerik:RadGrid>

Thanks.
Shinu
Top achievements
Rank 2
 answered on 17 Jul 2012
1 answer
50 views
Hi,

how can i fire Javascript function when "Check All" in RadCombobox is checked.

Thanks
Princy
Top achievements
Rank 2
 answered on 17 Jul 2012
1 answer
131 views
Hi,

I was using the file explorer to load files from a shared path as shown in the article http://www.telerik.com/support/kb/aspnet-ajax/fileexplorer/physical-paths-and-different-content-types.aspx.
I have a couple of file explorer controls on my page. For one of them the shared path is formed dynamically. When I run the project I am not able to see files in that control. Is it because I don't have a mapping specified for that particular path. How can i resolve this?
Dobromir
Telerik team
 answered on 17 Jul 2012
1 answer
66 views

What is wrong with what I did below. the current directory has 149 files. I change directories to one I know has 0 file and I still get 149 files for the count.

var explorer = $find("RadFileExplorer1");
var treeDir = explorer.get_tree().get_selectedNode();
var currentDir = explorer.getFileExplorerItemFromNode(treeDir).get_path(); // explorer.get_currentDirectory();
explorer.set_currentDirectory(currentDir, 0);
explorer.clearFolderCache();
var filesCnt = explorer.get_fileList().get_items().length;
Dobromir
Telerik team
 answered on 17 Jul 2012
1 answer
59 views
On Firefox (not with IE or Chrome) with the latest version of Telerik editor I get a new <br /> at end of text at every post to the page.

This occur only when switching to html view . Any way to avoid this ???


UPDATE: this occur only with ConvertToXhtml enabled. 


Currently we have this filters enabled:
RemoveScripts,EncodeScripts,FixUlBoldItalic,FixEnclosingP,IECleanAnchors,MozEmStrong,ConvertFontToSpan,OptimizeSpans,ConvertToXhtml,ConvertCharactersToEntities,IndentHTMLContent


with newlinemode P
Rumen
Telerik team
 answered on 17 Jul 2012
1 answer
640 views
Ok, I have a radgrid (nothing fancy)

<telerik:RadGrid runat="server" ID="rgdGroupOrder" CellSpacing="0" GridLines="None">
    <MasterTableView AutoGenerateColumns="False">
        <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
        <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
            <HeaderStyle Width="20px"></HeaderStyle>
        </RowIndicatorColumn>
        <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
            <HeaderStyle Width="20px"></HeaderStyle>
        </ExpandCollapseColumn>
        <Columns>
            <telerik:GridBoundColumn DataField="Accession" DataType="System.Int64" FilterControlAltText="Filter Accession column"
                HeaderText="Acc #" SortExpression="Accession" UniqueName="Accession">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Description" FilterControlAltText="Filter Description column"
                HeaderText="Exam" SortExpression="Description" UniqueName="Description">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Status" FilterControlAltText="Filter Status column"
                HeaderText="Status" SortExpression="Status" UniqueName="Status">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="ScheduleTime" DataType="System.DateTime" FilterControlAltText="Filter ScheduleTime column"
                HeaderText="Time" SortExpression="ScheduleTime" UniqueName="ScheduleTime" DataFormatString="{0:t}">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Modality" FilterControlAltText="Filter Modality column"
                HeaderText="Modality" SortExpression="Modality" UniqueName="Modality">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="ExamDate" DataType="System.DateTime" FilterControlAltText="Filter ExamDate column"
                HeaderText="ExamDate" SortExpression="ExamDate" UniqueName="ExamDate">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Resource" FilterControlAltText="Filter Resource column"
                HeaderText="Resource" SortExpression="Resource" UniqueName="Resource">
            </telerik:GridBoundColumn>
        </Columns>
        <EditFormSettings>
            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
            </EditColumn>
        </EditFormSettings>
    </MasterTableView>
    <FilterMenu EnableImageSprites="False">
    </FilterMenu>
</telerik:RadGrid>

And I have a radiobutton list (also not fancy)
<asp:RadioButtonList ID="rblGroupOptions" runat="server" AutoPostBack="false">
    <asp:ListItem Text="Apply to this exam only" Value="single"></asp:ListItem>
    <asp:ListItem Text="Apply to all in this group with same modality" Value="modality"
        Selected="True"></asp:ListItem>
    <asp:ListItem Text="Apply to all in this group for all modalities" Value="all"></asp:ListItem>
</asp:RadioButtonList>

And I have javascript functions that filter the grid based off of the radiobuttonlist
<telerik:RadCodeBlock ID="radcodeblock1" runat="server">
    <script type="text/javascript">
 
        function filterByAcc() {
            var grid = $find("<%=rgdGroupOrder.ClientID %>");
            if (grid != null) {
                var acc = "<%= AccessionNumber %>";
                var master = $find('<%=rgdGroupOrder.ClientID %>').get_masterTableView();
                master.filter("Modality", "", "NoFilter");
                master.filter("Accession", acc, "EqualTo");
            }
        }
        function filterByModality() {
            var grid = $find("<%=rgdGroupOrder.ClientID %>");
            if (grid != null) {
                var modality = "<%= Modality %>";
                var master = $find('<%=rgdGroupOrder.ClientID %>').get_masterTableView();
                master.filter("Accession", "", "NoFilter");
                master.filter("Modality", modality, "EqualTo");
            }
        }
        function clearFilters() {
            var grid = $find("<%=rgdGroupOrder.ClientID %>");
            if (grid != null) {
                var master = $find('<%=rgdGroupOrder.ClientID %>').get_masterTableView();
                master.filter("Modality", "", "NoFilter");
                master.filter("Accession", "", "NoFilter");
            }
        }
    
    </script>
</telerik:RadCodeBlock>

I've tied these javascript functions to the clientside clickevents of the radiobuttons. 

Not only do they not work, but they cause a postback that I have to handle using the radajaxmanager.  Which is what I was trying to avoid because this is in a usercontrol and some of the pages may have a lot of data on them.

Now, because it IS posting back I can set the filters server-side which I want to completely avoid.

Any suggestions?
Eyup
Telerik team
 answered on 17 Jul 2012
1 answer
59 views
ASP.NET AJAX: 2012.2.607.40
Visual Studio 2010 SP1
Browsers: Internet Explorer 8, Firefox 13, Opera 11

Hello,

If the ID of a RadGrid contains the word "Header", Javascript exeption raises on filter button of a column, the filter menu doesn't appear (see annexed image BugIDGrid_FilterJavascript.jpg), doesn't matter the DataSource of the RadGrid.

Below a list of IDs containing the word "Header" that give or not the mentionned javascript expection.
  • "Header_...": exception raised
  • "_Header_...": ok
  • "M_Header...": exception raised
  • "MHeader....": ok

Can Telerik and someone else confirm this problem?

Line raising the exception:

this._buildFilterMenuItemList(this._filterMenu,f._data.FilterListOptions,f._data.DataTypeName,f._data.CurrentFilterFunction,f);
The variable 'f' is null, because the following function, getColumnByUniqueName(), above the previous line returns null:
var f=a.getColumnByUniqueName(i);
The function getColumnByUniqueName() calls "this.get_columns()" of RadGrid that returns an empty list in this case even if columns are added declaratively in RadGrid.

One workaround, of course, is not to use the word "Header" for an ID of Telerik controls.

Best regards,
Alain

Eyup
Telerik team
 answered on 17 Jul 2012
2 answers
106 views
Hi,

On my page (aspx). I have this code

RadAjaxManager ajaxManager = RadAjaxManager.GetCurrent(Page);
 ajaxManager.AjaxRequest += new RadAjaxControl.AjaxRequestDelegate(this.RadAjaxManager1_AjaxRequest);

I load a user control dynamically

var ucToolMfgInfo = (UserControls_ToolsDetailsMfgInfoUC)Page.LoadControl("~/Tools/UserControls/ToolsDetailsMfgInfoUC.ascx");

This user control has button which opens a radwindow. The javascript on this user control is on radscriptblock. When the radwindow open, On the radwindow, when I click submit button, it saves data and then  it calls function from aspx page to refresh the browserwindow. It is browserwindow.refeshGridComponent. I can get the alert test111 but the ajaxmanager does not refresh and it does not call RadAjaxmanager_ajaxrequest function to update the grid on the user control.
function refreshGridComponent(arg, arg1) {
                alert('test111');
                var ajaxManager = $find("<%= RadAjaxManager.GetCurrent(this.Page).ClientID %>");
                ajaxManager.ajaxRequest("Component"); 
            }

In the Radajaxmanager_ajaxrequest function on aspx page

protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
{
   try
   {
          if (e.Argument == "Component")
                    LoadUserControls("A3");
    }
}

Any help is appreciated.

Thanks.

Andrey
Telerik team
 answered on 17 Jul 2012
2 answers
145 views
Hello again,

I have come across a strange rendering issue with the HtmlChart as you can see in the screenshot attached.  The chart is nested in a radgrid and populates the data just fine.  The axis for both y and x along with the points in the line series all render correctly with no issue.  But the actual grid and the line itself of the chart render way off to the right for some reason.  This seems to happen in all versions of IE from 6 thru 9.

Any help would of course be appreciated.

Following is the markup for the radgrid on the page:

<telerik:RadGrid ID="ReportsDataGrid" runat="server"
    AutoGenerateColumns="false"
    AllowPaging="true"
    AllowFilteringByColumn="true"
    DataSourceID="ReportsDataSource"
    ShowGroupPanel="true"
    PageSize="25">
    <GroupingSettings CaseSensitive="false" />
    <MasterTableView DataSourceID="ReportsDataSource" DataKeyNames="SenderAddress,SourceIP"
    GroupLoadMode="Server" CommandItemDisplay="Top">
        <Columns>
            <telerik:GridBoundColumn DataField="SenderAddress" HeaderText="Sender Email Address" />
            <telerik:GridBoundColumn DataField="SourceIP" HeaderText="Sender Source IP Address" />
            <telerik:GridBoundColumn DataField="Messages" HeaderText="Messages" DataFormatString="{0:N0}" />
            <telerik:GridBoundColumn DataField="Volume" HeaderText="Volume (KB)" DataFormatString="{0:N0}" />
        </Columns>
        <PagerStyle
            Mode="NextPrevAndNumeric"
            Position="Bottom"
            AlwaysVisible="true"
            />
        <CommandItemSettings 
            ShowAddNewRecordButton="false"
            ShowExportToExcelButton="true" 
            ShowExportToCsvButton="true"
            />
        <NestedViewTemplate>
            <asp:Panel runat="server" ID="InnerContainer" Visible="false">
                <div class="nestedchartcontentpane" style="position:relative">
                    <asp:Label ID="SelectedRecordEmail" runat="server" Text='<%# Eval("SenderAddress") %>' Visible="false" />
                    <asp:Label ID="SelectedRecordIP" runat="server" Text='<%# Eval("SourceIP") %>' Visible="false" />
                    <telerik:RadHtmlChart runat="server" ID="ReportsDataChart" Width="900" Height="300"
                        Transitions="true" DataSourceID="ReportsNestedDataSource"  >
                        <Legend>
                            <Appearance Visible="false" />
                        </Legend>
                        <PlotArea>
                            <XAxis MajorTickType="Outside" MinorTickType="None" DataLabelsField="Date">
                                <LabelsAppearance DataFormatString="{0}" RotationAngle="45" />
                                <TitleAppearance Visible="true" Text="Date" />
                                <MinorGridLines Visible="false" />
                            </XAxis>
                            <YAxis MajorTickType="Outside" MinorTickType="None">
                                <LabelsAppearance DataFormatString="{0:N0}" RotationAngle="0" />
                                <TitleAppearance Visible="true" Text="Messages" />
                                <MinorGridLines Visible="false" />
                            </YAxis>
                            <Series>
                                <telerik:LineSeries Name="Messages" MissingValues="Gap" DataField="Messages">
                                    <LabelsAppearance Visible="false" />
                                    <TooltipsAppearance DataFormatString="{0:N0}" />
                                </telerik:LineSeries>
                            </Series>
                        </PlotArea>
                    </telerik:RadHtmlChart>
                    <asp:SqlDataSource ID="ReportsNestedDataSource" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:asp_statistics %>" 
                        SelectCommand="GetReportsExchTopRelayAddressesChart" 
                        SelectCommandType="StoredProcedure">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="ReportsSelectedDate" Name="date"
                                PropertyName="SelectedDate" Type="DateTime" />
                            <asp:ControlParameter ControlID="ReportsOn" Name="type"
                                PropertyName="SelectedValue" Type="String" />
                            <asp:ControlParameter ControlID="ReportsDataUnit" Name="unit"
                                PropertyName="SelectedValue" Type="String" />
                            <asp:ControlParameter ControlID="SelectedRecordEmail" Name="address"
                                PropertyName="Text" Type="String" />
                            <asp:ControlParameter ControlID="SelectedRecordIP" Name="sourceip"
                                PropertyName="Text" Type="String" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                </div>
            </asp:Panel>
        </NestedViewTemplate>
    </MasterTableView>
    <ExportSettings 
        HideStructureColumns="true"
        ExportOnlyData="true"
        IgnorePaging="true"
        OpenInNewWindow="true"
        />
</telerik:RadGrid>
Slav
Telerik team
 answered on 17 Jul 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?