Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
107 views

Hello,

 

if i bind a RadGrid with a DataTable as DataSource.
There are no columns in the RadGrid only the DataSource had some.

Displaying the data works.

 

I have to let the user group the columns. It don't work if there are none.

GridColumnGroup colGrp = new GridColumnGroup();
            colGrp.Name = TextBox1.Text;
            colGrp.HeaderText = TextBox1.Text;
             
            RadGrid1.MasterTableView.ColumnGroups.Add(colGrp);
             
            RadGrid1.MasterTableView.Columns[0].ColumnGroupName = TextBox1.Text;
            RadGrid1.MasterTableView.Columns[1].ColumnGroupName = TextBox1.Text;

 

Please take a look at the added pictures.

Viktor Tachev
Telerik team
 answered on 01 Nov 2016
1 answer
98 views

I have an odd issue with the display date being in the wrong culture. When simply adding the control on the HTML side, there is no problem.

However, in our situation, we have the datepicker embedded in a user control. The user control is then dynamically created on the fly when needed using the TemplateControl.LoadControl method.

I have read an older article in the UI for WPF forum that I can set the Culture to Null. However, I cannot seem to do this programatically on the ASP.NET side, as we are using UI for AJAX. Any help with this issue would be greatly appreciated.

Viktor Tachev
Telerik team
 answered on 01 Nov 2016
1 answer
54 views

I am facing an issue with close and rebind radwindow when i click button to close window and rebind radgrid in parent page.

it work on IE, chrome but it does not close and rebind data on safari.

 

RadWindow code behind

protected void Button1_Click(object sender, EventArgs e)

    {

         InjectScript.ClosePopup(this, "CloseAndRebind('navigateToInserted')");

    }

InjectScript class

public static void ClosePopup(Page p, string jsFunc)
    {
        ScriptManager.RegisterStartupScript(p, p.GetType(), "CloseWindow", jsFunc, true);             
    }

 

t

 

Eyup
Telerik team
 answered on 01 Nov 2016
1 answer
206 views

 

I've got a custom Context Menu that is accessible from anywhere in my grids for setting gridlines (horizontal, vertical, both, none), or export to excel, which I've gotten to work very well.

I would also like to include the HeaderContextMenu (columns) only, so the users can customize the columns displayed.  I've been completely unsuccessful in getting those to work as one item.  In short, is there an easy way to add the columns like those shown in the HeaderContextMenu to my custom context menu and have it function like it does from the HeaderContext menu, with persisting the displayed columns after the users makes their column display choices.

As it is now, I have my custom context on the grid and the headercontext columns accessible from the header only.

 

 

 

Eyup
Telerik team
 answered on 01 Nov 2016
1 answer
108 views
Hi;
I'm having problems, when I try to export with HtmlFormatProvider the OpenOffice/LibreOffice docx files.
If the file is created with MSWord there's no problems, all works fine, the problem is with LibreOffice/Openoffice generated-documents.
Please, I need help 'cause some of my customers uses LibreOffice to create the docx documents.
+++++++++++++++++++++++ CODE ++++++++++++++++++++++++++
                docxProvider = new DocxFormatProvider();
                htmlProvider = new HtmlFormatProvider();

                if(this._DocXByteArray == null)
                    this._DocXByteArray = System.IO.File.ReadAllBytes(this._DocXPath);

                document = docxProvider.Import(this._DocXByteArray);
                        
                htmlProvider.ExportSettings.DocumentExportLevel = DocumentExportLevel.Fragment;
                htmlProvider.ExportSettings.ImagesExportMode = ImagesExportMode.Embedded;
                htmlProvider.ExportSettings.StylesExportMode = StylesExportMode.Embedded;
                        
                string html = htmlProvider.Export(document); //heres crash with the down error trace
+++++++++++++++++++++++ CODE ++++++++++++++++++++++++++
I'm always getting this error
++++++++++++++++++++++++ ERROR TRACE ++++++++++++++++++++++++
  at Telerik.Windows.Documents.Flow.FormatProviders.Html.Model.Elements.ParagraphElementBase.GetDefaultStyleId(IHtmlExportContext context, String& styleId)
  at Telerik.Windows.Documents.Flow.FormatProviders.Html.Model.Elements.HtmlElementBase.CopyStyleFrom(IHtmlExportContext context, IElementWithStyle element)
  at Telerik.Windows.Documents.Flow.FormatProviders.Html.Model.Elements.ParagraphElementBase.OnBeforeWrite(IHtmlWriter writer, IHtmlExportContext context)
  at Telerik.Windows.Documents.Flow.FormatProviders.Html.Model.Elements.HtmlElementBase.Write(IHtmlWriter writer, IHtmlExportContext context)
  at Telerik.Windows.Documents.Flow.FormatProviders.Html.Model.Elements.HtmlElementBase.WriteContent(IHtmlWriter writer, IHtmlExportContext context)
  at Telerik.Windows.Documents.Flow.FormatProviders.Html.Model.Elements.HtmlElementBase.Write(IHtmlWriter writer, IHtmlExportContext context)
  at Telerik.Windows.Documents.Flow.FormatProviders.Html.Export.HtmlExporter.ExportDocumentFragment(IHtmlWriter writer, IHtmlExportContext context)
  at Telerik.Windows.Documents.Flow.FormatProviders.Html.Export.HtmlExporter.Export(IHtmlWriter writer, IHtmlExportContext context)
  at Telerik.Windows.Documents.Flow.FormatProviders.Html.HtmlFormatProvider.ExportOverride(RadFlowDocument document, Stream output)
  at Telerik.Windows.Documents.Common.FormatProviders.FormatProviderBase`1.Export(T document, Stream output)
  at Telerik.Windows.Documents.Common.FormatProviders.TextBasedFormatProviderBase`1.Export(T document)
++++++++++++++++++++++++ END ERROR TRACE ++++++++++++++++++++++++

Thx
Mihail
Telerik team
 answered on 01 Nov 2016
1 answer
118 views
Hi;
I'm having problems, when I try to export with HtmlFormatProvider the OpenOffice/LibreOffice docx files.
If the file is created with MSWord there's no problems, all works fine, the problem is with LibreOffice/Openoffice generated-documents.
Please, I need help 'cause some of my customers uses LibreOffice to create the docx documents.
+++++++++++++++++++++++ CODE ++++++++++++++++++++++++++
                docxProvider = new DocxFormatProvider();
                htmlProvider = new HtmlFormatProvider();

                if(this._DocXByteArray == null)
                    this._DocXByteArray = System.IO.File.ReadAllBytes(this._DocXPath);

                document = docxProvider.Import(this._DocXByteArray);
                        
                htmlProvider.ExportSettings.DocumentExportLevel = DocumentExportLevel.Fragment;
                htmlProvider.ExportSettings.ImagesExportMode = ImagesExportMode.Embedded;
                htmlProvider.ExportSettings.StylesExportMode = StylesExportMode.Embedded;
                        
                string html = htmlProvider.Export(document); //heres crash with the down error trace
+++++++++++++++++++++++ CODE ++++++++++++++++++++++++++
I'm always getting this error
++++++++++++++++++++++++ ERROR TRACE ++++++++++++++++++++++++
  at Telerik.Windows.Documents.Flow.FormatProviders.Html.Model.Elements.ParagraphElementBase.GetDefaultStyleId(IHtmlExportContext context, String& styleId)
  at Telerik.Windows.Documents.Flow.FormatProviders.Html.Model.Elements.HtmlElementBase.CopyStyleFrom(IHtmlExportContext context, IElementWithStyle element)
  at Telerik.Windows.Documents.Flow.FormatProviders.Html.Model.Elements.ParagraphElementBase.OnBeforeWrite(IHtmlWriter writer, IHtmlExportContext context)
  at Telerik.Windows.Documents.Flow.FormatProviders.Html.Model.Elements.HtmlElementBase.Write(IHtmlWriter writer, IHtmlExportContext context)
  at Telerik.Windows.Documents.Flow.FormatProviders.Html.Model.Elements.HtmlElementBase.WriteContent(IHtmlWriter writer, IHtmlExportContext context)
  at Telerik.Windows.Documents.Flow.FormatProviders.Html.Model.Elements.HtmlElementBase.Write(IHtmlWriter writer, IHtmlExportContext context)
  at Telerik.Windows.Documents.Flow.FormatProviders.Html.Export.HtmlExporter.ExportDocumentFragment(IHtmlWriter writer, IHtmlExportContext context)
  at Telerik.Windows.Documents.Flow.FormatProviders.Html.Export.HtmlExporter.Export(IHtmlWriter writer, IHtmlExportContext context)
  at Telerik.Windows.Documents.Flow.FormatProviders.Html.HtmlFormatProvider.ExportOverride(RadFlowDocument document, Stream output)
  at Telerik.Windows.Documents.Common.FormatProviders.FormatProviderBase`1.Export(T document, Stream output)
  at Telerik.Windows.Documents.Common.FormatProviders.TextBasedFormatProviderBase`1.Export(T document)
++++++++++++++++++++++++ END ERROR TRACE ++++++++++++++++++++++++

Thx
Mihail
Telerik team
 answered on 01 Nov 2016
1 answer
1.1K+ views

I would like to fire a RadComboBox's SelectedIndexChanged event from another function in JS.  For a standard dropdown list I would use "onchange()" but for the RadComboBox I get TypeError: RadComboBox1.onclick is not a function.  Is there a way to fire a selectedindexchanged event from javascript on a radcombobox?

 

Example:

function fireSelectedIndexChanged() {
    var comboBox = $find("<%=RadComboBox1.ClientID%>");
    comboBox.onchange(); <---- fire selectedindexchanged event
}


Anton
Telerik team
 answered on 01 Nov 2016
1 answer
183 views

Hi, 

I would like to know if the gantt web control for ASP.NET, have a feature to export the content to Ms project

Rumen
Telerik team
 answered on 01 Nov 2016
3 answers
279 views

When my MVC razor Kendo Grid is in:

GridEditMode.InCell

and I click on "cancel changes"
or in:

GridEditMode.InLine

and click on "cancel" Changes,

The lines are dropped from the grid..

Apparently this has to do with the fact that I load my grid on the client ajax call (generated by a treeview). It seems as if the grid is treating the lines as new because they were loaded at a later time then when the grid was created.

What can I do to avoid this problematic behaivior? I have read many users have similar issues but no straightforward solution.

Here is my JavaScript:

01.function onSelect(e) {
02.                    var node = e.node;
03.                    var nodedata = $("#tvPH").data('kendoTreeView').dataItem(node);
04.                    //Fill the Proc Equip Grid
05.                    if (nodedata.nodeType == "pls") {
06.                        $.ajax({
07.                            //url: "/PlantHierArchy/GetProcEquip?plsID=" + nodedata.id,
08.                            url: "/PlantHierArchy/ForeignKeyColumn_Read?plsID=" + nodedata.id,
09.                            dataType: "json",
10.                            cache: false,
11.                            type: 'GET',
12.                            success:
13.                            function (result) {
14.                                $("#lblPSU").text('Proc. Equipment Managment for Plant Sub-Unit: ' + node.textContent);
15.                                var procGrid = $("#ProcEqGrid").data("kendoGrid");
16.                                procGrid.dataSource.data(result.Data);
17. 
18.                            },
19.                            error: function (jqXHR, textStatus) {
20.                                alert("Request failed: " + textStatus);
21.                            }
22.                        });
23.                    }
24.                }

and here is my Grid:

01.@(Html.Kendo().Grid<PMTWebReconcile.Models.ProcEquipViewModel>()
02.               .Name("ProcEqGrid")
03.                     //.HtmlAttributes(new { style = "height: 480px; margin-left: 260px" })
04.                        .Columns(columns =>
05.                        {
06.                            columns.Bound(P => P.peqID).Width(20);
07.                            columns.Bound(P => P.peqName).Width(120);
08.                            columns.Bound(P => P.peqTag).Width(120);
09.                            columns.Bound(P => P.peqDescription).Width(200);
10.                            //columns.Bound(P => P.eqtID).Width(30);
11.                            columns.ForeignKey(p => p.eqtID, (System.Collections.IEnumerable)ViewData["EqptTypes"], "TypeID", "Type").Title("Eqpt Type").Width(120);
12. 
13.                            columns.Bound(P => P.eqsID1).Width(30);
14.                            columns.Bound(P => P.eqsID2).Width(30);
15.                            columns.Bound(P => P.eqsID3).Width(30);
16.                            columns.Bound(P => P.peqActive).Width(30);
17.                            //columns.Command(commands =>
18.                            //{
19.                            //    commands.Edit();
20.                            //    //commands.Delete().ButtonType(GridButtonType.Image);
21. 
22.                            //}).Width(100);
23.                            
24.                        })
25.                                .ToolBar(toolbar => { toolbar.Create(); toolbar.Save(); })
26.                                .HtmlAttributes(new { style = "veritcal-align:top" })
27.                        //.Editable(editable => editable.Mode(GridEditMode.InLine)) // Use inline editing mode.
28.                        .Editable(editable => editable.Mode(GridEditMode.InCell))
29.                        .DataSource(dataSource =>
30.                           dataSource
31.                           .Ajax()
32.                           .Batch(true)
33.                            .Model(model =>
34.                             {
35.                                 model.Id(P => P.peqID); // Specify the property which is the unique identifier of the model.
36.                                 model.Field(P => P.peqID).Editable(false); // Make the ProductID property not editable.
37.                                 model.Field(P => P.Type).DefaultValue(new PMTWebReconcile.Models.EquipTypeViewModel());
38.                             })
39.                                 .Create(create => create.Action("ForeignKeyColumn_Create", "PlantHierArchy")) // Action invoked when the user saves a new data item.
40.                               // .Read(read => read.Action("ForeignKeyColumn_Read", "PlantHierArchy", new { plsID = (subUnitID) }))
41.                                 .Update(update => update.Action("ForeignKeyColumn_Update", "PlantHierArchy"))  // Action invoked when the user saves an updated data item.
42.                   )
43.                   .Pageable()
44.                   .Sortable()
45.                     //.ClientDetailTemplateId
46.                   )

*

Dan
Top achievements
Rank 1
 answered on 31 Oct 2016
3 answers
219 views

How do I get around this problem?
The ParentNodeId is NULL for 1-4

This constraint cannot be enabled as not all values have corresponding parent values.

<telerik:RadNavigation ID="RadNavigation1" DataSourceID="sdsMenu" OnNodeDataBound="RadNavigation1_NodeDataBound" DataFieldID="NodeId" DataFieldParentID="ParentNodeId" DataNavigateUrlField="NavigateUrl" DataTextField="sidnamn" Skin="Bootstrap" runat="server" />
 
<asp:SqlDataSource ID="sdsMenu" SelectCommand="SELECT NodeId, ParentNodeId, sidnamn, NavigateUrl, target FROM sv_sidor where NodeId NOT BETWEEN @start AND @end Order By SortId ASC, NodeId ASC" ConnectionString="<%$ ConnectionStrings:sdsSleddogConn %>" runat="server">
    <SelectParameters>
        <asp:Parameter DefaultValue="1" Name="start" DbType="Int32" />
        <asp:Parameter DefaultValue="4" Name="end" DbType="Int32" />
    </SelectParameters>
</asp:SqlDataSource>
Peter Milchev
Telerik team
 answered on 31 Oct 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?