Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
100 views

Hi.

     I have a grid and i want to create a inline drop down. I cannot add drop down editor to the field in the grid. Can you please let me know where i am incorrect in this.

                     <div id="partnerGrid"></div>

   function mpnDropDownEditor(container, options) {
        $('<input required name="' + options.field + '"/>')
            .appendTo(container)
            .kendoDropDownList({
                autoBind: false,
                dataTextField: "MPN_ID",
                dataValueField: "MPN_ID",
                dataSource: {
                    type: "odata",
                    transport: {
                        read: dsMPNID
                    }
                }
            });
    }

 

    var dsMPNID = new kendo.data.DataSource({
        transport: {
            read: {
                // the remote service url
                url: $.appConfig.ServiceUri + "/GetMPNIDs",

                // the request type
                type: "odata",

                // the data type of the returned result
                dataType: "jsonp",

            }
        },
        // describe the result format
        schema: {
            // the data, which the data source will be bound to is in the "list" field of the response
            data: "MPN_ID"
        }
    });


    dsPartnerGrid = new kendo.data.DataSource({
        serverFiltering: true,
        serverPaging: true,
        serverSorting: true,
        autoBind: false,
        batch: false,
        autoSync: true,
        pageSize: 30,
        schema: {
            model: {
                id: "MPN_ID",
                fields: {
                    "MPN_ID": { type: "string", editable: true, validation: { required: true } },

                }
            }
        },
        type: "odata",
        transport: {

            read: {
                url: $.appConfig.ServiceUri + "/GPLs",
                dataType: "jsonp"
            }

        },
        requestEnd: function (e) {

            if (typeof (e.response) == 'undefined')
                return;
            if (e.response == null)
                return;
            if (typeof (e.response.d) == 'undefined')
                return;
            if (e.response.d.length == 0)
                return;
        }

    })




    $("#partnerGrid").kendoGrid({
        dataSource: dsPartnerGrid,
        pageable: true,
        height: 550,
        //filterable: {
        //    mode: "row"
        //},
        toolbar: ["create"],
        columns: [
            { command: ["edit", "destroy"], title: "&nbsp;", width: "150px" },
            { field: "MPN_ID", title: "MPN_ID", width: "150px", editor: mpnDropDownEditor, template: "#=Mpn.MPN_ID#"},

        ],

        editable: "inline"
    });

Karteek
Top achievements
Rank 1
 asked on 30 Nov 2017
2 answers
168 views

We're wanting to use RadEditor as a robust TextArea replacement, and we want the user to have access to the full array of tools, but only if they ask for them by clicking on an icon.

We're doing this now, by hiding all of the EditorTool buttons when the Editor is loaded, but this is leaving behind a bunch of empty EditorToolGroups.  Is there a way to show/hide an EditorToolGroup instead?

            var oTool;             oTool = editor.getToolByName("Undo"); if (oTool) oTool.get_element().style.display = "none";

I've attached screenshots of what it looks like when the toolbars are closed and opened.

Mike
Top achievements
Rank 1
 answered on 30 Nov 2017
0 answers
161 views

I Have Two RadComboboxes (One Country Dropdown and State Dropdown)

1)Grid is binded on the Client side
2)Need to Bind the Country Dropdown using JqueryAjax Call
3)Need to Bind the State Dropdown based on the country selected Using JQuery Ajax Call
4)I dont want to use PageMethods

sunil
Top achievements
Rank 1
 asked on 30 Nov 2017
1 answer
96 views

Hi All,

 

I'm using a RADGRID and the detail table is not expanding when i put this code below in. if i remove this code the detail grid expands without any issues with the correct data.

 

    Protected Sub RadGrid1_ItemDataBound(sender As Object, e As GridItemEventArgs)
          If TypeOf e.Item Is GridDataItem Then
               Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)
              If item("Status").Text = "Unknown" Then

                   item("Test").Text = ""
           End If
           End If
    End Sub

 

 

 

Vessy
Telerik team
 answered on 30 Nov 2017
7 answers
1.0K+ views
Hi

    I have a Genric list of data returned from WCF in client side. I need to bind this  to RadCombobox in clientside itself using javascript, We have a direct method to  RadGrid to bind the data but there is no direct way to bind it with RadCombobox. I'm looping each item and add to the Radcombobox now. Is there any method to bind the Genric list(JSON object) to the RadCombobox.

Please help me.

(Please dont give examples like using page method or any server side method, my requirement is to use everything using javascript. In my page, i didnt use any single line of server side code except the WCF)

Thanks in advance
sunil
Top achievements
Rank 1
 answered on 30 Nov 2017
3 answers
507 views
hello,

in our RadGrid we use in-row editing. however, i need to make certain editable elements read-only (or disabled), depending on the value in another bound column. for example, if the value of the "Status" read-only GridBoundColumn is "Rejected", then i need to disable editing for the other editable GridCheckBoxColumn and GridDropDownColumn columns we have. 

i think this may be done in the OnEditCommand handler...but I'm not sure what the syntax is. have checked the docs but didn't see it. 

i determined i can use the item.Cells collection to get the Status column's string value, like so:

protected void gridItems_EditCommand(object source, GridCommandEventArgs e)
{
    GridEditableItem editableItem = e.Item as GridEditableItem;
 
    string status = e.Item.Cells[6].Text; //i mapped this out, 6 is the Status column value.
 
    switch (status.ToLower())
    {
        case "rejected":
            //TODO: disable the UI for editing my particular columns here:
 
            // GridCheckBoxColumn
            // GridDropDownColumn
            // GridTemplateColumn
 
            break;
    }
}


...or do i intercept this on the OnCreateColumnEditor="gridItems_CreateColumnEditor" or OnItemDataBound="gridItems_ItemDataBound" events/handlers?

thanks,
matt
Marin Bratanov
Telerik team
 answered on 30 Nov 2017
0 answers
141 views

I would like to use RadGrid in Batch Edit mode.

Here is my code:

<telerik:RadGrid RenderMode="Lightweight" runat="server" ID="gvOpSetting" AutoGenerateColumns="false" AllowPaging="true" MasterTableView-TableLayout="Fixed"
    OnNeedDataSource="gvOpSetting_NeedDataSource" AllowMultiRowSelection="true" OnItemDataBound="gvOpSetting_ItemDataBound" OnItemCommand="gvOpSetting_ItemCommand">
    <MasterTableView NoMasterRecordsText="No Data!!" DataKeyNames="WStationID,CtrlOrder" CommandItemDisplay="Top" EditMode="Batch" AutoGenerateColumns="false" Width="500px">
        <BatchEditingSettings EditType="Cell" OpenEditingEvent="Click"/>
        <Columns>
            <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" Visible="false">
            </telerik:GridEditCommandColumn>
            <telerik:GridBoundColumn DataField="WStationID" Visible="false" HeaderStyle-Width="250px" />
            <telerik:GridBoundColumn DataField="CtrlOrder" Visible="false" />
            <telerik:GridBoundColumn DataField="CtrlItem" HeaderText="CtrlItem" />
            <telerik:GridNumericColumn DataField="StandardValue" HeaderText="StandardValue"
                SortExpression="StandardValue" UniqueName="StandardValue">
            </telerik:GridNumericColumn>
            <telerik:GridNumericColumn DataField="TolerancePlus" HeaderText="TolerancePlus"
                SortExpression="TolerancePlus" UniqueName="TolerancePlus">
            </telerik:GridNumericColumn>
            <telerik:GridNumericColumn DataField="ToleranceMinus" HeaderText="ToleranceMinus"
                SortExpression="ToleranceMinus" UniqueName="ToleranceMinus">
            </telerik:GridNumericColumn>
        </Columns>
        <NoRecordsTemplate>
            <table width="300px" border="0" cellpadding="20" cellspacing="20">
                <tr>
                    <td align="center">
                        <h2 style="color: black; font-size: xx-large; font-weight: bold;">No Data!!</h2>
                    </td>
                </tr>
            </table>
        </NoRecordsTemplate>
    </MasterTableView>
    <PagerStyle Mode="NextPrevAndNumeric" />
    <ClientSettings EnableRowHoverStyle="false" EnablePostBackOnRowClick="true" AllowKeyboardNavigation="true">
        <ClientEvents OnRowDblClick="rowDblClick" OnPopUpShowing="onPopUpShowing"/>
    </ClientSettings>
</telerik:RadGrid>

 

When I click cell into edit mode, a textbox show for a second, then it closed immediately.

I couldn't edit at all. 

Which setting did I miss?

 

 

Jalen
Top achievements
Rank 1
 asked on 30 Nov 2017
2 answers
155 views
Hi Telerik Team,

Please help me on the problem.
 
1) when i try to filter in the grid using '\' , then it cannot search.

2) Either i need to search with '\' or atleast part of the word before it or any other solution?

Your guidance will be really appreciated.

Regards
Sudhakar
Igor
Top achievements
Rank 1
 answered on 30 Nov 2017
0 answers
164 views

Hi,

I have been struggling with this a fair bit.

I have a Telerik Raddatepicker control in a custom usercontrol. When a user Enters a date of 31/02/2000 (Invalid, as there never is 31 days in February), I need to display an error or, show the yellow triangle or something, instead of the control changing the date to 28/02/2000. The control must NOT automatically change the date.
I cannot use one of the latest versions of Telerik.Web.UI.Dll that has the EnableSmartParsing property.

I am bound to use version: 2013.2.717.40.

Please assist me with a script to accomplish this.

What I currently have is :

<script type="text/javascript">
Telerik.Web.UI.RadDateInput.prototype.parseDate = function (value, baseDate) {
{
if (new Date(value) != "NaN")
return new Date(value);
this.set_textBoxValue(value);

}

</script>

Werner
Top achievements
Rank 1
 asked on 30 Nov 2017
0 answers
290 views

I am creating a RadGrid and within EditForm of RadGrid, I have taken an ASP.Net ListBox along with a TextBox and both of these controls are unbound controls. I created keyup event for the TextBox and after user enters a minimum of 3 characters in textbox, I am making a call to DB to search for items starting with the text given in textbox and want to add those items to the listbox.

My JavaScript code in keyup event function of textbox is as follows.

 

01.function KeyUpFunction(sender, args)
02.    {     
03.        var value = document.getElementById(sender).value;
04.        if (value.toString().length >= 3)
05.        {          
06.            $.ajax({
07.                type: "GET",
08.                url: "/Test/Test.asmx/GetTests",
09.                data: { searchTerm: "'%" + value + "%'" },
10.                contentType: "application/json; charset=UTF-8",
11.                dataType: "json",
12.                async: "true",
13.                success: function (result) {                      
14.                    if (result.d.length > 0) {
15.                        var grid = $find('<%= grdTest.ClientID %>');                      
16.                        var editItems = grid.get_editItems();                      
17.                        var editItem = editItems[0];                       
18.                        var listBox = $(editItem.get_editFormItem()).find("select[id*='lstImageSets']").get(0);
19.                        $(listBox).empty();
20.                        for (var item in result.d) {
21.                            var opt = document.createElement('OPTION');
22.                            opt.value = result.d[item].Id;                         
23.                            opt.innerHTML = result.d[item].Name;                          
24.                            listBox.add(option);                                               
25.                        }                          
26.                    }
27.                    else {
28.                        alert("No records found");
29.                    }
30.            },
31.            error: function (jqXHR, textStatus, errorThrown) {
32.                alert(textStatus + '  ' + errorThrown);
33.            }
34.            });
35.           
36.        }      
37.    }

 

This code is working fine and adding items to listbox. But items added to the listbox are not visible. when I inspected the listbox in developer tools, it is rendered as a <div> and next to the div a <select> element, where <div> is specified as _rfdecoratedid for the <select> and all items that are added by the above code are there in <select> but not visible. I am suspecting this is because of <div>. 

Please find attached screen shots that shows the developer tools elements screen before and after the above function is executed.

Please help me in solving this issue.

Rameshbabu
Top achievements
Rank 1
 asked on 30 Nov 2017
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?