Telerik Forums
UI for ASP.NET AJAX Forum
8 answers
633 views
Hello team Telerik,

I am using your trial version and planning to renew my licence but i am facing some compatibility issues after using the trial version.
My Previous Version of Telerik.Web.UI.dll = 2008 3.1314.20
Version of trial Telerik.Web.UI.dll = 2014.2.724.40


Now the problem is that in my previous dll i am using skins like 'default2006' , 'skyblue' etc etc for my controls and those were working fine but as i updated the trial version dll in my project i am getting the error regarding these skins because these are not in the new version. Are your components not backward compatible?
if not then how can i fix the error that i am getting (by changing the previous skins with the new one on every screen?)

Secondly, I have used some custom skins while i was using the previous version of dll but as i updated the trail version the custom skins are not working also?
my second question is that does newer version supports custom control skins? if yes the Give me an example where a custom skin is used on a control.

My third question is that What EnableEmbeddedskins do? and keeping in mind the above two scenarios how can i use it?
(i have seen a post where u people have suggested to disable it in web.config and then enabled it for only specific screen where control is using SKIN.is it the only way to use it? going on every screen with skin attribute in it and EnableEmbededSkins= true for that control? ) Please give me an early response so that i can buy the licence as soon as possible...



Rumen
Telerik team
 answered on 19 Apr 2018
0 answers
141 views

I have a RadGrid setup like this

<div id="Grid">
                    <telerik:RadGrid RenderMode="Lightweight" runat="server" ID="RadGrid1" AutoGenerateColumns="false" AllowPaging="true"
                        OnNeedDataSource="UserGrid_NeedDataSource" OnUpdateCommand="RadGrid1_UpdateCommand"
                        OnItemCreated="RadGrid1_ItemCreated" OnDeleteCommand="RadGrid1_DeleteCommand"
                        OnInsertCommand="RadGrid1_InsertCommand">
                        <MasterTableView DataKeyNames="UserID" CommandItemDisplay="Top" EditMode="EditForms">
                            <Columns>
                                <telerik:GridEditCommandColumn />
                                <telerik:GridBoundColumn DataField="UserID" HeaderText="User ID" ReadOnly="true"
                                    ForceExtractValue="Always" ConvertEmptyStringToNull="true" />
                                <telerik:GridCheckBoxColumn DataField="Active" HeaderText="Active" SortExpression="Active" UniqueName="chkActive"></telerik:GridCheckBoxColumn>
                                <telerik:GridTemplateColumn HeaderText="Role">
                                    <ItemTemplate>
                                        <%#DataBinder.Eval(Container.DataItem, "Role")%>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                  <asp:DropDownList runat="server" ID="ddlRoles">
                                      <asp:ListItem Text ="Admin" Value ="Administrator"></asp:ListItem>
                                      <asp:ListItem Text ="User" Value ="User"></asp:ListItem>
                                  </asp:DropDownList>
                              </EditItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name" UniqueName="FirstName" />
                                <telerik:GridBoundColumn DataField="LastName" HeaderText="Last Name"  UniqueName ="LastName"/>
                                <telerik:GridBoundColumn DataField="UserName" HeaderText="User Name" UniqueName="UserName" />
                                <telerik:GridBoundColumn DataField="EmailAddress" HeaderText="Email Address" UniqueName="Email" />
                                <telerik:GridButtonColumn ConfirmText="Delete this User?" ConfirmDialogType="RadWindow"
                                    ConfirmTitle="Delete" ButtonType="FontIconButton" CommandName="Delete" />
                            </Columns>
                            <EditFormSettings InsertCaption="Add new item" CaptionFormatString="Edit User: {0}" CaptionDataField="FirstName">
                                 <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
                            </EditFormSettings>
                        </MasterTableView>
                        <PagerStyle Mode="NextPrevAndNumeric" />
                    </telerik:RadGrid>
                </div>

 

I want to udpade or add new records using C# code behind. However I cannot get access to any of the controls.  When thew code attemps to read the value of the value of the control, in this case a textbox, I get an error message stating {"Object reference not set to an instance of an object."}  here is the code

protected void RadGrid1_UpdateCommand(object sender, GridCommandEventArgs e)
        {
            GridEditableItem editedItem = e.Item as GridEditableItem;
            UserControl userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);
            string strUserID = editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["UserID"].ToString();
            int intUserId = Convert.ToUInt16(strUserID);
 
            using (ExpungeEntities db = new ExpungeEntities())
            {
                 
                var Results = db.USERS_T_DATA.SingleOrDefault(i => i.UserID == intUserId);
                if (Results == null)
                {
                    RadGrid1.Controls.Add(new LiteralControl("Unable to locate that user for updating"));
                    e.Canceled = true;
                    return;
                }
                Results.FirstName = (userControl.FindControl("FirstName") as TextBox).Text;
 
            }
        }

Can you please tell me what the problem is?

 

Perry
Top achievements
Rank 1
 asked on 19 Apr 2018
2 answers
326 views
I'm now being told by my users that it's imperative to be able to navigate the batch edit using the up and down arrows.  Essentially they are looking for the functionality of Excel in a webpage. Up and Down should go to the next or previous row, and left and right should be the same as tab / shift + tab.

Does this functionality exist?  And if so how would I activate it?  

Thank you.
Smit
Top achievements
Rank 1
 answered on 19 Apr 2018
3 answers
1.0K+ views

Hello Guys,

I am new to Telerik Controls and my question is 

 

How do i embed dropdownlist ( Or radcombobox ) and editable text box indise a radgrid ?

Please refer to attachment 

( Dropdownlist or radgrid should populate from datasource)

I have already written the logic for edit delete save commands but to display them inside the grid is my doubt

 

 

Eyup
Telerik team
 answered on 19 Apr 2018
2 answers
190 views

I have a page on which a user enters a few search criteria via drop down lists, and then searches for org chart results based on those criteria.  I am having a strange issue in which the first time the search button is clicked, the org chart is displayed, but the formatting is wrong, and it's flowing off the screen.

 

See included screen shots of the first time the search button is clicked, and the second time.  Second (and subsequent) search executions all render correctly.

 

  <telerik:RadOrgChart RenderMode="Lightweight" runat="server" ID="RadOrgChart1" OnDataBound="radOrgChartDataBound" Orientation="Vertical" EnableCollapsing="true" EnableDrillDown="false" EnableDragAndDrop="false" EnableGroupCollapsing="true">
 
 
<ItemTemplate>
      <asp:Label runat="server" ID="lblEmployee" Text='<%# DataBinder.Eval(Container.DataItem, "Employee") %>' />
      <asp:Label runat="server" ID="lblAlternate" Text='<%# DataBinder.Eval(Container.DataItem, "ALternate") %>' />
      <asp:HiddenField runat="server" id="hfLead" Value='<%# DataBinder.Eval(Container.DataItem, "TeamLead") %>' />
      <strong><%# DataBinder.Eval(Container.DataItem, "Payroll") %></strong>
</ItemTemplate>
 
  <GroupEnabledBinding>
       <NodeBindingSettings DataFieldID="ID" DataFieldParentID="ParentID" />
       <GroupItemBindingSettings DataFieldID="ID" DataFieldNodeID="NodeID" DataTextField="Employee" />
</GroupEnabledBinding>
 
                                             
<RenderedFields>
     <NodeFields>
          <telerik:OrgChartRenderedField DataField="Text" Label="" />
     </NodeFields>
</RenderedFields>
 
 
</telerik:RadOrgChart>

 

protected void loadOrgChart()
   {
       try
       {
           DataTable dtNodes = new DataTable();
           DataTable dtItems = new DataTable();
 
           if (cnn.State == ConnectionState.Closed) { cnn.Open(); }
           sqlStr = " *** long sql query string here ***  ";
           SqlCommand cmd = new SqlCommand(sqlStr, cnn);
           dtNodes.Load(cmd.ExecuteReader());
           cnn.Close();
 
           if (cnn.State == ConnectionState.Closed) { cnn.Open(); }
           sqlStr = " *** long sql query string here ***  ";
           cmd = new SqlCommand(sqlStr, cnn);
           dtItems.Load(cmd.ExecuteReader());
           cnn.Close();
 
           RadOrgChart1.GroupEnabledBinding.NodeBindingSettings.DataSource = dtNodes;
           RadOrgChart1.GroupEnabledBinding.GroupItemBindingSettings.DataSource = dtItems;
           RadOrgChart1.GroupColumnCount = 1;
 
           for (int i = 0; i < dtNodes.Rows.Count; i++)
           {
               bool hasParent = false;
               string parentID = dtNodes.Rows[i]["ParentID"].ToString();
               for (int j = 0; j < dtNodes.Rows.Count; j++)
               {
                   if (dtNodes.Rows[j]["ID"].ToString() == parentID)
                   {
                       hasParent = true;
                   }
               }
               if (!hasParent)
               {
                   dtNodes.Rows[i]["ParentID"] = DBNull.Value;
               }
           }
 
 
           RadOrgChart1.DataBind();
 
 
       }
       catch (Exception ex)
       {
           lblError.Text = ex.ToString();
       }
 
 
       editSection.Visible = true;
 
       upEditarea.Update();
   }
 
 
 
   protected void radOrgChartDataBound(object sender, EventArgs e)
   {
       RadOrgChart orgChart = RadOrgChart1;
 
 
       foreach (OrgChartNode node in orgChart.GetAllNodes())
       {
 
 
           foreach (OrgChartGroupItem item in node.GroupItems)
           {
               Label lblEmployee = (Label)item.FindControl("lblEmployee");
               Label lblAlternate = (Label)item.FindControl("lblAlternate");
               HiddenField hfLead = (HiddenField)item.FindControl("hfLead");
               if (lblEmployee.Text == "Vacant Position")
               {
                   lblEmployee.ForeColor = System.Drawing.Color.Red;
               }
 
 
               if (hfLead.Value == "True")
               {
                   lblAlternate.Visible = true;
                   if (lblAlternate.Text == "No Alternate")
                   {
                       lblAlternate.ForeColor = System.Drawing.Color.Red;
                   }
               }
               else
               {
                   lblAlternate.Visible = false;
               }
 
 
           }
 
           int nodeLevel = node.Level;
           if (nodeLevel > 0)
           {
               node.Collapsed = true;
 
           }
 
       }
 
   }

 

I'm new to the radorgchart function and using telerik tools in general, so any advice on where I should be looking for the source of this issue is greatly appriciated.

David
Top achievements
Rank 1
 answered on 19 Apr 2018
2 answers
157 views

Hi telerik team:

I'm having one issue not being able to find a solution on internet and forum.

I have two grids, the first one is loaded on server side, and the second one I want it to be loaded on client-side. 

 

I use this code, fired on "Edit" of the first grid:
 function editPTOP(PTOPlanId) {
            $("#dialogPTOP").dialog({
                autoOpen: true,
                title: "New PTO Plan",
                width: "600px",
                //position: [350,0],
                modal: true
            });
            updateGrid();
        }

    function updateGrid() {
            var data = [{ "ID": "1", "Rate": "1", "StartYear": "1998", "EndYear": "1999" }, { "ID": "2", "Rate": "2", "StartYear": "2005", "EndYear": "20018" }];
            var masterTable = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
        masterTable.set_dataSource(data);
        masterTable.dataBind();
    }

After I click on "Edit", appears a strange error when the debbuger wants to get_masterTableView():

 

ScriptResource.axd?d=ZIWSWn7AfUG8H7B191NUVuhgr7Xdz_smdgrZb9SKzD12EnEoJyUju6SX4JZ76NMPNQnLq61DdmGW9saKWN8tyqr7W0klndxIZ4odb1TwK30RJlLRQOeRyKNmtEfetDV-C1YTrbIXaDJtI5D7mUsEqir_Ifu50e5_zNkLMil_FmOCnsAWWY052_vxtv0cMCik0&t=72fc8ae3:237 Uncaught Error: Sys.ArgumentNullException: El valor no puede ser nulo. (value can not be null)
Nombre del parámetro: id

I'm using AjaxControlToolkit. dll version: 3.0.930.0

 

How can I attach files here? (not a picture, code files)

 

Thanks a lot,

Diego

Saju Samuel
Top achievements
Rank 1
 answered on 18 Apr 2018
0 answers
171 views

Hi;

I would always like to show Column Head even there is not data. I am using RadGridView.

I tried with ShowColumnHeaders but it doesn't work.

Thanks for help.

Muheto
Top achievements
Rank 1
 asked on 18 Apr 2018
0 answers
290 views

Hi.

In your page 'https://demos.telerik.com/aspnet-ajax/spreadsheet/examples/import-export/defaultvb.aspx',

I can't import a xls file.

I export yours example from the page with name 'Workbook.xlsx'. Then I convert this file to 'Workbook.xls'. In this new file I had removed all formats to avoid problems with compatibility. Finally I import file in your page and I export it. I can open this file in excel.

¿Your spreadsheet runs with xls files?

My goal is to export xls files to PDF, either directly or by converting them previously to xlsx files.

 

Thanks in advance

 

Víctor
Top achievements
Rank 1
 asked on 18 Apr 2018
3 answers
825 views

Hello!

Installed products are Telerik UI for ASP.NET + Kendo UI for jQuery. Version R1 2018 (Version number: 2018.1.117)

I'm trying to use embedded Export to Excel function and... possible I'm wrong but it looks like this function does not support columns filtering in the right way.

I have not so simple grid, ny grid has dynamic columns, as we can see below 'columns' - is incoming parameter for grid creation.

You can see my examplebelow (with most important functions)

function createGrid(columns) {
    $("#contactsGrid").empty();
 
    var gridElement = $("#contactsGrid");
    var pagingIncrement = 20;
    var scrollbarWidth = kendo.support.scrollbar();
 
    SetFieldTypesForDefaultColumns(columns); 
    var gridModel = generateModel(columns);
    var gridColumns = generateGridColumns(columns);
     
    gridElement.kendoGrid({
        dataSource: {
            type: (function () {
                if (kendo.data.transports['aspnetmvc-ajax']) {
                    return 'aspnetmvc-ajax';
                } else {
                    throw new Error('The kendo.aspnetmvc.min.js script is not included.');
                }
            })(),
            transport: {
                read: {
                    url: "contacts/getcontacts",
                    data: additionalData,
                    prefix: ""
                }
            },
            requestEnd: function (e) {
                if (e.response) {
                    var rows = e.response.Data;
                    for (var rowIndex = 0; rowIndex < rows.length; rowIndex++) {
                        convertTimeColumnsToDate(rows[rowIndex]);
                    }
                    manageButtonsVisibility(gridColumns.length > 0 && rows && rows.length > 0);
                } else {
                    manageButtonsVisibility(false);
                }
            },
            pageSize: pagingIncrement,
            serverPaging: true,
            serverSorting: true,
            sort: ({ field: "UpdatedDate", dir: "desc" }),
            schema: {
                model: gridModel,
                data: "Data",
                total: "Total",
                errors: "Errors"
            }
        },
        resizable: true,
        pageable: {
            refresh: false,
            pageSizes: [10, 20, 50, 100],
            buttonCount: 20
        },
        sortable: {
            mode: "single",
            allowUnsort: false
        },
        dataBound: function () {
             
        },
        columns: gridColumns,
        columnMenu: {
            sortable: false,
            filterable: true,
            columns: false,
            messages: {
                settings: "Filter",
                filter: "Apply Filter",
            }
        },
        filterable: {
            mode: "menu"
        },
        reorderable: true,
        excel: {
            allPages: true,
            filterable: true
        },
        excelExport: function (e) {
            e.workbook.fileName = getExcelFileName();
        },
        messages: {
            commands: {
                excel: "Export All"
            }
        },
        toolbar: ["excel",
            { template: kendo.template($("#gridColumnsTemplate").html()) }
        ],
    });
 
    createGridTooltips(gridElement.data("kendoGrid"));     // standard 'grid.thead.kendoTooltip'
    columnMenuManage(gridColumns.length > 0);     // just visibility of 'kendoColumnMenu' which hides/shows columns
    clearFiltersManage(false);     // just visibility of template button which clean all applied columns filters
    gridFilterEventHandler();     // the same but when filter is applied
    gridColumnFilterInit();     // some additions for my fields of types date/time/dateTime
}

 

function generateModel(columns) {
    var model = {};
    model.id = "ContactID";
    var fields = {};
    for (var index in columns) {
        if (columns[index].Visible) {
            var columnName = columns[index].Name;
            var typeName = columns[index].FieldTypeName;
 
            if (typeName == "Currency" || typeName == "Number") {
                fields[columnName] = { type: "number" };
            } else if (typeName == "Boolean") {
                fields[columnName] = { type: "boolean" };
            } else if (typeName == "Date" || typeName == "Time" || typeName == "Date and Time") {
                    fields[columnName] = { type: "date" };
            } else {
                fields[columnName] = { type: "string" };
            }
        }
    }
    model.fields = fields;
    return model;
}

 

function generateGridColumns(columns) {
    var result = []
 
    if (columns.length == 0) return result;
 
    var i = 0;
    for (var index in columns) {
        if (columns[index].Visible) {
            var columnTitle = columns[index].DisplayName;
            var columnName = columns[index].Name;
            var columnType = columns[index].Type;
 
            var column = {};
            column.title = columnTitle;
            column.field = columnName;
            column.encoded = true;
            column.headerAttributes = {
                "data-field": columnName,
                "data-title": columnTitle
            };
 
            if (columns[index].FieldTypeName === "Date")
            {
                column.format = "{0:dd/MM/yyyy}";
                column.filterable = {
                    ui: function (element) {
                        element.kendoDatePicker({
                            format: "dd/MM/yyyy",
                            parseFormats: [ "dd/MM/yyyy", "ddMMyyyy", "dd MM yyyy" ]
                        });
                    }
                };
            }
 
            if (columns[index].FieldTypeName === "Date and Time") {
                column.format = "{0:dd/MM/yyyy HH:mm}";
                column.filterable = {
                    ui: function (element) {
                        element.kendoDateTimePicker({
                            format: "dd/MM/yyyy HH:mm",
                            parseFormats: [ "dd/MM/yyyy", "ddMMyyyy", "dd MM yyyy" ]
                        });
                    }
                };
            }
 
            if (columns[index].FieldTypeName === "Time")
            {
                column.format = "{0:HH:mm}";
                column.filterable = {
                    ui: function (element) {
                        element.kendoTimePicker({
                            format: "HH:mm",
                            parseFormats: [ "HH:mm", "HHmm", "HH mm" ]
                        });
                    }
                };
            }
 
            if (columns[index].FieldTypeName === "Currency") {
                column.format = "{0:n2}";
            }
 
            if (columns[index].FieldTypeName === "Number") {
                column.format = "{0:n0}";
            }
 
            if (columns[index].FieldTypeName === "Boolean") {
                var boolTmpl = function (dataItem) {
                    var val = dataItem[this.column];
                    var isEmpty = val === undefined || val === null || val === "";
                    return isEmpty ? "" : dataItem[this.column] ? "True" : "False";
                }.bind({ column: columns[index].Name });
 
                column.template = boolTmpl;
            }
 
            column.width = 125;
            result[i++] = column;
        }
    }
 
    var column = {};
    column.title = "";
 
    // 'actions' column there on the last position
 
    result[i] = column
 
    return result;
}

 

And when I have grid data and trying to apply just some simple filter, for example - by simple text field 'Surname', grid filters my records and this is absolutly Ok.

But when I press 'Export All' button - generated file is not correct. It generates either just only header or quite 'random' result, but not the correct one ... which is presented on UI.

Can you suggest something?

 

ps I've attached 2 images to do my question more clear.

1st: if I play with columns visibility and try to export -> all is ok

2nd: if I play with column filter and try to export -> unexpected result

Vladimir
Top achievements
Rank 1
 answered on 18 Apr 2018
6 answers
415 views
Hi,

am using telerik notification for client-side validation. i have a rad button in my aspx page like this:
<telerik:RadButton ID="testButton" runat="server" Text="Click Me!" OnClientClicking="ValidateJScript();"></telerik:RadButton>
and a telerik notification like this:
<telerik:radnotification id="notification" runat="server"> </telerik:radnotification>

i'm trying to validate my fields one by one in a JScript file. but for simplicity let's say i just want to display "Hello World" in the telerik notification using the "ValidateJScript()" Java Script function like this:
function ValidateJScript() {
var notification = $find( '<%=RadNotification.ClientID %>');
var message = 'Hello World';
notification.text = message;
alert(notification.text);
notification.show();
first problem i encountered was that "set_text" method didn't work, and so i used ".text =" and that worked. Same goes for "set_title".
i made sure that ".text =" worked using the "alert(notification.text); statement. However,"notification.show();" never got executed at all, and i was never able to show the notification at all. moreover, if i add some test alert message after the "notification.show();" statement it never gets executed either. so can anyone help me and tell me how to get the notification to show using javascript in my scenario, and why did the "set_text" and "set_title" methods never worked here? thanks!


TechSystem
Top achievements
Rank 1
 answered on 18 Apr 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?