Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
704 views
Hi,
how we can use the telerik components to upload multiple files selecting a directori o select it with a file explorer?

Thanks
Ivan Danchev
Telerik team
 answered on 14 Jul 2016
4 answers
133 views

Hi

I think that I found a bug.

Take a radnumeric, set decimaldigits zero.

use client event valuechanging like this:

                function valueChanging(sender, args) {
                    alert(args.get_newValue());
                }

If I digit "0,4" I'm expecting in the args.get_newValue() just 0 and not 0.4!

I think that the "." or "," (depends on cultureinfo, ok) not even should be arrived to the input, just like any alphanumeric character that is not a number!

Why you allow decimal digit in that event if I set decimaldigits zero? I don't want to use valueChanged.

Just.. I think that the radnumeric settings should be considered before any event.

All of this is on last ui for ajax version 2016.2.607.45

Thank you.

Regards

Fabio

Fabio
Top achievements
Rank 1
 answered on 14 Jul 2016
1 answer
132 views

I have an application for training attendance where a column in the database is a varchar but when editing the record they want a dropdown with Yes|No values. That is fine however, when updating the the records the UpdateCommand does not the dropdown values in the Hashtable.

BTW - the edimode for the grid is "InPlace".

Any help would greatly be appreciated. Thanks

 

ASPX

<telerik:GridTemplateColumn DataField="Attended" HeaderText="Attended" AllowFiltering="false">
                    <ItemTemplate>
                        <asp:Label ID="AttendedLabel" runat="server" Text='<%# Eval("Attended") %>'></asp:Label>
                    </ItemTemplate>
                <EditItemTemplate>
                    <telerik:RadDropDownList ID="ddAttended" runat="server" Width="55px">
                        <Items>
                            <telerik:DropDownListItem Text="" />
                            <telerik:DropDownListItem Text="Yes" />
                            <telerik:DropDownListItem Text="No" />
                        </Items>
                    </telerik:RadDropDownList>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>

VB

 

Protected Sub rgCourse_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs)
        If (e.CommandName = "UpdateAll") Then
            For Each editedItem As GridEditableItem In rgCourse.EditItems
                Dim newValues As Hashtable = New Hashtable
                'The GridTableView will fill the values from all editable columns in the hash
                e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem)
                dsCourses.UpdateCommand = String.Format("Update vwCurrentCourse SET Attended='{0}' WHERE Registration_ID='{1}'", newValues("Attended").ToString(), editedItem.GetDataKeyValue("Registration_ID").ToString())
                dsCourses.Update()
 
                editedItem.Edit = Falsetable
            Next
        End If
        rgCourse.Rebind()
    End Sub

Eyup
Telerik team
 answered on 14 Jul 2016
1 answer
89 views
I'm having an issue where the RadGrid ExportToExcel() method is generating output that includes a header item "<meta http-equiv="Content-Type" content="text/html; charset=utf-8">" in addition to the the header also showing a content-Type of "application/vnd.ms-excel (found via chrome dev tools or fiddler).  Our security scanning software is returning an error saying Multiple content types are specified.  Is there a way to get rid of the <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> content that is output in the response?
Kostadin
Telerik team
 answered on 14 Jul 2016
1 answer
158 views

Hi,

From my TileClicked method in javascript I would like to check whether the Ctrl/Shift key is hold during the click so I can implement different behavior in that cases. 

In Chrome I can use window.event to check this, but in Firefox the event is not accessible this way. I need the original click event of the dom element for that. Could this be provided through the TileClicked event as a parameter?

Marin Bratanov
Telerik team
 answered on 14 Jul 2016
1 answer
171 views

this is my code in javascript, by using asp.net gridview .Now i am trying to convert it to the Radgrid code using javascript but i cant find the suitable  value.

plz look below asp.net gridview  javascript code.

  var varRow1 = 0;
        var varcol = 0;
        var varIndex = 0;
        function fApplyToAllMenu(e, varLoop, varcell, varObj) {
            if (document.getElementById('<%=gvDetails.ClientID %>') != null) {
                var SelectAllObj = new Object();
                SelectAllObj = document.getElementById("<%=divApplyToAll.ClientID %>");
        
                var xPosition = getPosition(e).x + 15;
                var yPosition = getPosition(e).y + 5;
                SelectAllObj.style.position = "absolute";
                SelectAllObj.style.top = String(yPosition) + "px";
                SelectAllObj.style.left = String(xPosition) + "px";
                SelectAllObj.style.display = "inline";
                varIndex = varObj.parentNode.parentNode.rowIndex ;
        
                //varRow1 = varLoop;
                varRow1 = varObj.parentNode.parentNode.rowIndex ;
                if (varRow1 == 0)
                    varRow1 = 1;
                varcol = varcell;
            }
            return false;
        }
        
        function fApplyToAll() {
            if (document.getElementById('<%=gvDetails.ClientID %>').rows[varRow1].cells[varcol].getElementsByTagName('INPUT')[0] != null) {
                if (document.getElementById('<%=gvDetails.ClientID %>').rows[varRow1].cells[varcol].getElementsByTagName('INPUT')[0].readOnly == false) {
                    if (document.getElementById('<%=gvDetails.ClientID %>') != null)
                        if (document.getElementById('<%=gvDetails.ClientID %>').rows.length > 0)
                            for (var i = Number(varRow1); i < document.getElementById('<%=gvDetails.ClientID %>').rows.length - 1; i++) {
                                if (document.getElementById('<%=gvDetails.ClientID %>').rows[i + 1].cells[varcol].getElementsByTagName('INPUT')[0] != null)
                                    document.getElementById('<%=gvDetails.ClientID %>').rows[i + 1].cells[varcol].getElementsByTagName('INPUT')[0].value = document.getElementById('<%=gvDetails.ClientID %>').rows[varRow1].cells[varcol].getElementsByTagName('INPUT')[0].value;
                            }
                }
            }
            if (document.getElementById('<%=gvDetails.ClientID %>').rows[varRow1].cells[varcol].getElementsByTagName('SELECT')[0] != null) {
                if (document.getElementById('<%=gvDetails.ClientID %>').rows[varRow1].cells[varcol].getElementsByTagName('SELECT')[0].disabled == false) {
                    if (document.getElementById('<%=gvDetails.ClientID %>') != null)
                        if (document.getElementById('<%=gvDetails.ClientID %>').rows.length > 0)
                            for (var i = Number(varRow1); i < document.getElementById('<%=gvDetails.ClientID %>').rows.length - 1; i++) {
                                if (document.getElementById('<%=gvDetails.ClientID %>').rows[i + 1].cells[varcol].getElementsByTagName('SELECT')[0] != null) {
                                    document.getElementById('<%=gvDetails.ClientID %>').rows[i + 1].cells[varcol].getElementsByTagName('SELECT')[0].value = document.getElementById('<%=gvDetails.ClientID %>').rows[varRow1].cells[varcol].getElementsByTagName('SELECT')[0].value;
                                   
                                }   
                            }
                }
            }

}

 

And this is my code. for Radgrid which i am using.

 

 var varRow1 = 0;
        var varcol = 0;
        var varIndex = 0;
        
        function fApplyToAllMenu(e, varLoop, varcell, varObj) {
            debugger;
            var grid = $find("<%= griddetails.ClientID %>");
            if (grid != null) {
                var SelectAllObj = new Object();
                SelectAllObj = document.getElementById("<%=divApplyToAll.ClientID %>");
                
                var xPosition = getPosition(e).x + 15;
                var yPosition = getPosition(e).y + 5;
                SelectAllObj.style.position = "absolute";
                SelectAllObj.style.top = String(yPosition) + "px";
                SelectAllObj.style.left = String(xPosition) + "px";
                SelectAllObj.style.display = "inline";
                varIndex = varObj.parentNode.parentNode.rowIndex;

                varRow1 = varObj.parentNode.parentNode.rowIndex;
                if (varRow1 == 0)
                    varRow1 = 2;
                varcol = varcell + 2;
            }
           
            return false;
        }
        
        function fApplyToAll() {
            debugger;
            var grid = $find("<%= griddetails.ClientID %>");
            var MasterTable = grid.get_masterTableView();
            var Rows = MasterTable.get_dataItems();
     
            var elements = grid.getElementsByTagName("*");
            for (var i = 0; i < elements.length; i++) {
                var element = elements[i];
                if (element.id.indexOf(serverID) >= 0)
                    return element;
            }

            if (MasterTable.getCellByColumnUniqueName(Rows[varRow1].cells[varcol]).getElementsByTagName('INPUT')[0] != null) {
                if (Rows[varRow1].cells[varcol].getElementsByTagName('INPUT')[0].readOnly == false) {
                    if (grid != null) {
                        if (Rows.length > 0) {
                            for (var i = Number(varRow1) ; i < Rows.length; i++) {
                                if (Rows[i + 1].cells[varcol].getElementsByTagName('INPUT')[0] != null) {
                                    Rows[i + 1].cells[varcol].getElementsByTagName('INPUT')[0] = Rows[varRow1].cells[varcol].getElementsByTagName('INPUT')[0].value;
                                }
                            }
                        }
                    }
                }
            }
        
            if (Rows[varRow1].cells[varcol].getElementsByTagName('SELECT')[0] != null) {
                if (Rows[varRow1].cells[varcol].getElementsByTagName('SELECT')[0].disabled == false) {
                    if (grid != null) {
                        if (Rows.length > 0) {
                            for (var i = Number(varRow1) ; i < Rows.length; i++) {
                                if (Rows[i + 1].cells[varcol].getElementsByTagName('SELECT')[0] != null) {
                                    Rows[i + 1].cells[varcol].getElementsByTagName('SELECT')[0] = Rows[varRow1].cells[varcol].getElementsByTagName('SELECT')[0].value;
                                }
                            }
                        }
                    }
                }
            }

}

 

 

This code working for if i select checkbox in radgrid, then press my right click of mouse, then context menu open on click on that  then all the below checkbox get also checked.
I am attaching the image file for this.

Viktor Tachev
Telerik team
 answered on 14 Jul 2016
2 answers
106 views

When i try to filter dynamically created column ii get "is neither a DataColumn nor a DataRelation for table .. "

Ideas?

David
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 14 Jul 2016
2 answers
187 views

In the OnItemDeleted event of RadDataForm there is a method for retrieving the deleted record (e.Item.ExtractValues()) and e.Item.SavedOldValues.  After successfully deleting a row I am finding that both the method and property listed above returns null.  This should not be the case -- in RadGrid and other controls these fields are populated.  What is the prescribed approach for accessing deleted data in an OnItemDeleted event?  (I also tried OnItemDeleting).  Any feedback is appreciated.

 

Thanks,

Shaun

Kostadin
Telerik team
 answered on 14 Jul 2016
1 answer
160 views

I've created a dynamic grid which allows me to load different sets of data.  I've now turned it into a widget so it can be placed and configured multiple times on a page.  The problem I have now is I'm receiving this error when I load more than one widget.  

There must be only one instance of RadStyleSheetManager per page. 

Same is true for the RadPersisgenceManager.  How might I overcome this issue so I can load multiple controls dynamically on a page?

Eyup
Telerik team
 answered on 14 Jul 2016
2 answers
578 views

I know this has come up multiple times and I have read multiple posts but have not been able to get it to work

On the parent page in the web browser, there is a button.  When a user clicks on the button, it opens a page with a RadGrid in a RadWindow.  We will call that WindowA.

In the RadGrid in WindowA, each record has a column with a HyperLink.  When clicking on the HyperLink, it opens a different page in another RadWindow for the user to edit and update the data for that record. We will call that WindowB.

When the user edits the data and clicks on the Update button in WindowB, it needs to do the following:

- Execute a SQL statement to update the record in the database table.

- Close WindowB.

- Refresh or Rebind the RadGrid in WindowA using the RadAjaxManager to call an ajaxRequest to show the changes in the data.

-----------------------------------------------------------------------

I was able to do something similiar between the browser window (parent) and a RadWindow where the parent has the RadGrid which gets updated after user clicks on Update button in RadWindow.  But I cannot get the scenario above to work.

-----------------------------------------------------------------------

I have read the article in http://docs.telerik.com/devtools/aspnet-ajax/controls/window/how-to/calling-functions-in-windows .

When I debug through the Javascript function, I get the error " Object doesn't support property or method 'get_ContentFrame' " on the following line of code:

oWnd.get_ContentFrame().contentWindow.MyTestViewTodayRelFn();

Below is my code.

Please help me to get this to work.  A working example would help alot.

Thanks!

------------------------------------------------------------------------

Update button click subroutine in code-behind for page in WindowB ( VB code)

Protected Sub rbtnUpdateOrder_Click(sender As Object, e As EventArgs) Handles rbtnUpdateOrder.Click

...

ScriptManager.RegisterStartupScript(Me, [GetType](), "mykey", "CloseAndRebind();", True)

...

End Sub

Javascript function CloseAndRebind in page in WindowB (put in <head> </head> section):

        function CloseAndRebind(args) {

            var oManager = GetRadWindow().BrowserWindow.GetRadWindowManager();
            var oWnd = oManager.getWindowByName("Release History");
            oWnd.get_ContentFrame().contentWindow.MyTestViewTodayRelFn();

            alert(oWnd);
            GetRadWindow().close();
        }

Javascript function MyTestViewTodayRelFn in page in WindowA (put in <head> </head> section):

        function MyTestViewTodayRelFn() {
            alert("Called MyTestViewTodayRelFn");
        }

Note: MyTestViewTodayRelFn is just a test function.  Here is an example of what the actual function would be in the page for WindowA:

            function refreshGridRYG(arg) {
                if (!arg) {
                    $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
                }
                else {
                    $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindAndNavigate");
                }
            }

Sincerely,

Keith Jackson

Keith
Top achievements
Rank 1
 answered on 14 Jul 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?