Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
1.0K+ views
I am getting the error "Selection out of range Parameter name: value". I have a radcombobox inside a FormTemplate in the radgrid.
Find the code for reference.

<telerik:RadGrid AutoGenerateColumns="False" ID="rgModel" Skin="WebBlue"  
        AllowPaging="True" runat="server" OnItemDataBound="rgModel_ItemDataBound">
        <PagerStyle Mode="NextPrevAndNumeric" />                            
        <MasterTableView DataKeyNames="ModelId" CommandItemDisplay="Top" CommandItemSettings-ShowRefreshButton="false">
            <Columns>      
                    <telerik:GridEditCommandColumn  UniqueName="EditCommandColumn1" ButtonType="ImageButton" >
                    <HeaderStyle Width="20px" />                                                                                                                                               
                    <ItemStyle CssClass="MyImageButton" />
                </telerik:GridEditCommandColumn>                                                       
                <telerik:GridBoundColumn HeaderText="Manufacturer" DataField="Manufacturer"
                    UniqueName="Manufacturer" HeaderStyle-HorizontalAlign="left" />
                <telerik:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName="DeleteColumn" ConfirmText="Do You want to delete the Manufacturer?">
                </telerik:GridButtonColumn>                          
            </Columns>
            <EditFormSettings EditFormType="Template">
                <FormTemplate>                   
                    <table id="Table3" cellspacing="1" cellpadding="1" width="500" border="0" class="module">                                                                                                                                                                                                                  
                        <tr>
                            <td>Manufacturer:</td>
                            <td>
                                <telerik:RadComboBox ID="ddlManufacturer" AppendDataBoundItems="true" runat="server" Skin="WebBlue"                                                          
                                    SelectedValue='<%# Bind("ManufacturerId")%>'>                                                           
                                </telerik:RadComboBox
                            </td>
                        </tr>                                                                                                  
                        <tr>
                            <td> </td>
                            <td>
                                    <asp:Button ID="btnUpdate" Text='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "Insert", "Update") %>'
                                    runat="server" CommandName='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "PerformInsert", "Update")%>'>
                                </asp:Button
                                <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"
                                CommandName="Cancel"></asp:Button>
                            </td>
                        </tr>
                    </table>                                      
                </FormTemplate>
            </EditFormSettings>                    
        </MasterTableView>
    </telerik:RadGrid>           
  
Protected Sub rgModel_ItemDataBound(ByVal source As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs)
        Dim blnReturn As Boolean
        Dim strErrMsg As String = String.Empty
        Dim interrno As Integer
        Dim dtbManufacturer As New DataTable
        
  
        If (TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode) Then
  
            Dim ddlManufacturer As Telerik.Web.UI.RadComboBox = e.Item.FindControl("ddlManufacturer")
            
            blnReturn = _objW.GetManufacturers(dtbManufacturer)
  
            If Equals(blnReturn, True) Then
    ddlManufacturer.Items.Clear()
    ddlManufacturer.SelectedValue = Nothing
                ddlManufacturer.DataSource = dtbManufacturer
                ddlManufacturer.DataTextField = dtbManufacturer.Columns(1).ColumnName
                ddlManufacturer.DataValueField = dtbManufacturer.Columns(0).ColumnName
                ddlManufacturer.DataBind()
            End If
        End If
    End Sub
Leidi
Top achievements
Rank 1
 answered on 15 Jan 2018
3 answers
1.3K+ views

Hi I have a button that I want to disable on click and then run the code behind on the button.  The following is the code I have but the code behind click event never fires.  The button gets disabled but OnClick event never fires.

Thank you for you assistance.

Tracy

 

<script  type="text/javascript" >
     function AddJob(sender, args) {
         sender.set_enabled(false);
         sender.click();
     }
  
 </script><body>
  <form id="form1" runat="server">
      <act:ToolkitScriptManager ID="tsmManager"  runat="server"  EnablePartialRendering="true" AsyncPostBackTimeOut="600" ScriptMode="Release" EnablePageMethods="true"/>
  <div>
      <telerik:RadButton ID="rbtAddJob"           runat="server" AutoPostBack="true" ButtonType="StandardButton"      Text="Add This Job To My Jobs"      OnClientClicked ="AddJob"       OnClick="rbtAddJob_Click" Width="150px"/>
  </div>
Protected Sub rbtAddJob_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles rbtAddJob.Click
       MsgBox("test")
   End Sub

 

 I also tried this code

<script  type="text/javascript" >
     function AddJob(sender, args) {
         var btn = $find("rbtAddJob");
         btn.set_enabled(false);
         btn.click();
      }
   
  </script>
Vessy
Telerik team
 answered on 15 Jan 2018
0 answers
96 views

We currently have a grid configured to use cell-level selection, specifically, our grid uses: 

selectable: "multiple, cell" 

 

With multi-cell selection, users are able to choose cells by either clicking and dragging or holding the Ctrl key and clicking. I would like to alter the way that users use the mouse to select cells from the grid. Specifically, I would like users to be able to:

  1. Select multiple cells with individual clicks without requiring that a user hold down the Ctrl key. 
  2. Click on a cell a second time to deselect the cell. 
  3. Keep the click and drag functionality if possible. 

Is there a recommended or supported to go about achieving this functionality?

Currently, I have tried removing selectable from my grid configuration and implementing my own click listener that applies k-state-selected when the user clicks on a cell, but I don't know how to go about hooking into the back end grid logic to add or remove items from the grid's selected list (or if this is even the right approach). 

 

 

 

Matt
Top achievements
Rank 1
 asked on 15 Jan 2018
4 answers
302 views

I need to Show/Hide the RadDock objects with client side script.  Docking for ASP.NET has this functionality but I don't see it in the Prometheus Dock control.  Is there another way to affect this?

Thanks

Krishna
Top achievements
Rank 1
 answered on 15 Jan 2018
0 answers
53 views

Hi,

I have a problem with the radsplitter on the same page as the grid. Below is a sample page. This works. If I take the script and put it in a js file, the page looses the 100% height and width. If I take out the line "<ClientEvents OnRowSelected="RowSelected" />" it works. So the only way I have been able to get the 100% working is to put the scripting in the page, I can't put it in a js file and link the script file . The 100% is needed to have the radsplitter fill the whole page. Note how I set teh style for HTML, Body and Form to try and force the 100%, but that is ignored when the OnRowSelected is put in. 

Please help, this is driving me crazy. I need to put a ton of scripting on the OnRowSelected event, so I would prefer it to be in a separate file. 

 

<html xmlns="http://www.w3.org/1999/xhtml" style="height: 100%; margin: 0px; padding: 0px; width: 100%">

<head runat="server">
    <title></title>
    <script>
        function RowSelected(sender, eventArgs) {
            alert("The active row is: " + eventArgs.get_gridDataItem());
        }
    </script>
</head>
<body style="height: 100%; margin: 0px; padding: 0px; width: 100%">
    <form id="form1" runat="server" style="height: 100%; margin: 0px; padding: 0px; width: 100%">
        <telerik:RadScriptManager ID="scriptManager1" runat="server" EnableTheming="True">
            <Scripts>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js"></asp:ScriptReference>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js"></asp:ScriptReference>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js"></asp:ScriptReference>
            </Scripts>
        </telerik:RadScriptManager>
        <telerik:RadSplitter ID="splitterMain" runat="server" Height="100%" Width="100%" Orientation="Horizontal">
            <telerik:RadPane ID="paneTop" runat="server">
                 <table>
                    <tr>
                        <td style="vertical-align: top;">
                            <telerik:RadGrid ID="gridDocuments" AllowSorting="True" AllowPaging="True" PageSize="20" runat="server" GridLines="None"
                                AllowMultiRowSelection="true">
                                <ClientSettings>
                                    <Selecting AllowRowSelect="True" />
                                    <ClientEvents OnRowSelected="RowSelected" />
                                </ClientSettings>
                                <PagerStyle Mode="NumericPages" Position="Bottom"></PagerStyle>
                                <MasterTableView DataKeyNames="DocumentID" ClientDataKeyNames="DocumentID" HierarchyLoadMode="Client">
                                    <Columns>
                                        <telerik:GridBoundColumn DataField="DocumentID" Visible="false" ItemStyle-Width="0px"></telerik:GridBoundColumn>
                                    </Columns>
                                </MasterTableView>
                            </telerik:RadGrid>
                        </td>
                    </tr>
                </table>
            </telerik:RadPane>
            <telerik:RadSplitBar ID="panebar" runat="server" CollapseMode="Forward">
            </telerik:RadSplitBar>
            <telerik:RadPane ID="paneBottom" runat="server">
                <div id="divLayout">
                    <asp:Panel ID="panelContent" runat="server" Style="position: relative">
                    </asp:Panel>
                </div>

            </telerik:RadPane>
        </telerik:RadSplitter>
    </form>
</body>
</html>

 

 

Robert
Top achievements
Rank 1
 asked on 15 Jan 2018
6 answers
2.0K+ views
Greetings,

 
We are working on a project with a page that contains many of your controls:

3 RadTreeViews, 4 RadGrids, 2 RadMenus and many Telerik controls.

Lately, we have to examine our project’s performance in real time, over the Internet.

We were surprised to see that between the user’s click on a button at client-side until the arrival of the command on the server side – the duration is ABOUT TWENTY SECONDS!!!

THIS IS NOT ACCEPTABLE AND NO CLIENT WILL NOT AGREE TO SUCH A TURNAROUND!!!

We would like to get a solution for this critical issue asap.
 

Thanks,
Daniel.
UI Project Leader.
.NET Technology
ISR Corp.
AIRE360
Top achievements
Rank 1
 answered on 15 Jan 2018
8 answers
596 views

Hi,

I have programmatically binding the RadSpreadsheet control with the values from my SQL Table. When the user modifies the cells value in RadSpreadsheet, i want only those modified cell values to be updated in my table.

I browsed the forum and I found CustomDatabaseProvider can be used or this operation. However, the example that I had was truncating the entire data from table instead of updating only the modified row.

public override void SaveWorkbook(Workbook workbook)
        {
            using (SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["SpreadsheetSampleConnectionString"].ConnectionString))
            {
                conn.Open();
                string query = "DELETE FROM [Products]";
                SqlCommand clearCmd = new SqlCommand(query, conn);
                clearCmd.ExecuteNonQuery();
 
                string insertQuery = "INSERT INTO Products(ProductName,Description) VALUES(@param1,@param2)";
                foreach (var row in workbook.Sheets[0].Rows)
                {
                    SqlCommand insertCmd = new SqlCommand(insertQuery, conn);
 
                    insertCmd.Parameters.Add("@param1", SqlDbType.NVarChar, 50).Value = row.Cells[0].Value;
                    insertCmd.Parameters.Add("@param2", SqlDbType.NVarChar, 50).Value = row.Cells[1].Value;
 
                    insertCmd.CommandType = CommandType.Text;
                    insertCmd.ExecuteNonQuery();
                }
            }
        }

 

Can anyone let me know how to do this?

Norbert
Top achievements
Rank 1
 answered on 15 Jan 2018
0 answers
71 views

Hi 

Are drag and drop capabilities in HTML5 or Angular JS compatible with using Telerik .NET AJAX controls in our project?

Ron
Top achievements
Rank 1
 asked on 12 Jan 2018
4 answers
231 views
On the grid, columns are dragged and reordered.  When a user clicks one of the column headers to sort it after they have been reordered, they go back to the order they were orginally presented when the grid loaded for the first time.  On the first post back from the sort everything is in it's proper place however each subsequent time the order is lost.

Thanks
DogBizPro
Top achievements
Rank 1
 answered on 12 Jan 2018
1 answer
227 views

A user has the power to select their language and on save, updates every control on the screen. 

I am not seeing the text within a RadTabStrip is being updated. 

My code is simialr to below:

I locate the tab in question, and assign the text within Page_Load. 

            Dim myTab As RadTab = WindowTabs.Tabs.FindTabByValue("SomeTab")
            myTab.Text = GetLabelBasedOnSelectedLanguage(myTab) ' this returns the proper value 

I can see myTab.Text now holding the proper value BUT on the screen there is no change. 

Is there a way to update the text on the fly via server side?

thank you 

 

Vessy
Telerik team
 answered on 12 Jan 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
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
Bronze
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?