Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
181 views

The following code disables the combobox, but I cannot enable it by unchecking the checkbox again...howcome?

 

   <telerik:RadComboBox Width="100%"  ID="rcb_zorgverzekeraar" runat="server"></telerik:RadComboBox>
                                           
                  <asp:CheckBox ID="chk_verzekeraar" CausesValidation="false" AutoPostBack="true" OnCheckedChanged="chk_verzekeraar_CheckedChanged" Text="Ik weet het niet" runat="server" />

 

 

with:

 

        Protected Sub chk_verzekeraar_CheckedChanged(sender As Object, e As EventArgs)
            rcb_zorgverzekeraar.Enabled = Not chk_verzekeraar.Checked
        End Sub

 

 

Marc

Fit2Page
Top achievements
Rank 2
Bronze
Iron
Iron
 answered on 25 Oct 2023
0 answers
81 views

Hi, we found a problem after updating our project to our last available version witch is "Complimentary R1 2020 Version", we are on 2016.2.607.40, and after find a problem in radgrid and keyboard interaction we look at out download page and have the complimentary version, we try it and that problem solves, but in a recently added radfilter we discover that stop working as spectated.

 

We use RadFilterDropDown with radcomboboxes, which load on demand.

First, we see that load settings displays the saved info of combos in blank.

Second, we discover also that selecting a item from combo, not saving on settings and not showing on preview also

 

With 2016.2.607.40

With Trial version of 2023.3.1010 (we try it to see if problem solved on last version)

 

Attached isolated sample for reproduction
Maximiliano
Top achievements
Rank 1
 asked on 24 Oct 2023
1 answer
88 views

Hi,
I have a Radgrid in Batch edito mode for data entry purposes.

I need that when I press the Enter key, the focus goes to the cell below (same column next row).
How can I do?

Thank you

 

 

Attila Antal
Telerik team
 answered on 24 Oct 2023
1 answer
130 views

Hello.  I have a modal popup RadWindow being used as an edit form. This RadWindow is launched from a row in a RadGrid. Everything works great, except when the user finishes with the RadWindow and it closes, the calling RadGrid successfully does a rebind, but it doesn't visually update on the screen. The auto-refreshing the RadGrid works great for other uses such as deleting a record, or updating a record, but not when the rebind code runs upon returning from the modal RadWindow.  When the radwindow closes, it triggers the RadAjaxManager1_AjaxRequest which does the rebind operation. That runs just fine. The only thing not happening is the rendering of the screen so the user sees the updated data in the radgrid.  

Anyone have any ideas why this would be happening or way to force the re-rendering of the screen/radgrid?

This is the script on the source page:

        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">
                function refreshGrid(arg) {
                    if (!arg) {
                        $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
                    }
                    else {
                        $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindAndNavigate");
                    }
                }
            </script>
        </telerik:RadCodeBlock>

This gets calls when the popup closes:

    Protected Sub RadAjaxManager1_AjaxRequest(ByVal sender As Object, ByVal e As AjaxRequestEventArgs) Handles RadAjaxManager1.AjaxRequest
        If e.Argument = "Rebind" Then
            rgVehicleConfig.DataSource = Nothing
            rgVehicleConfig.Rebind()
        End If
    End Sub

This is the script on the popup aspx page:

    <script type="text/javascript">
        function CloseAndRebind(args)
        {
            GetRadWindow().BrowserWindow.refreshGrid(args);
            GetRadWindow().close();
            document.getElementById("frmSequencingAreas").submit();
        }

        function Close(args)
        {
            GetRadWindow().close();
        }

        function GetRadWindow()
        {
            var oWindow = null;
            if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well)

            return oWindow;
        }
    </script>

Finally, this is the code for the final import of the data that closes the RadWindow and returns to the calling page:

    Private Sub rgVehicleConfiguration_ItemCommand(sender As Object, e As GridCommandEventArgs) Handles rgVehicleConfiguration.ItemCommand
        If e.CommandName = "Export" Then
            If ErrorsFound Then
                lblMessage.Text = "Highlighted values are invalid. Please correct and try importing file again.</br>Data cannot be imported until all errors are corrected."
            Else
                ExportData()
                ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "CloseAndRebind();", True)
                ShowPopup = False
            End If
        End If
    End Sub

Most of this code was lifted from Telerik's own demo and that seems to work just fine here on the Telerik demo site.

Any help would be wonderful.

Thank you.

 

Sean
Top achievements
Rank 1
 updated question on 24 Oct 2023
3 answers
450 views
Hey guys,

I'm finishing setting up some validation controls on a page for a client. I'm having some trouble with getting RadComboBox to jump up when validating. I'm using SetFocusOnError="true" and all other element's on the page are functioning correctly including other telerik controls. 

I did find an old forum post with an employee saying that there was an error on telerik's end but, it's from 2007 so it may not be valid anymore.
http://www.telerik.com/community/forums/aspnet/combobox/validation-focus-not-setting-on-combobox.aspx
 

<telerik:RadComboBox ID="FrmReferredBy" runat="server" AllowCustomText="false" CausesValidation="false" /><asp:RequiredFieldValidator ID="FrmReferredByValidator" runat="server" Text="*"  ControlToValidate="FrmReferredBy" Display="Dynamic" SetFocusOnError="true" />

If you have other questions or need more code just let me know. Thanks!

Peace,
Spencer
Fit2Page
Top achievements
Rank 2
Bronze
Iron
Iron
 answered on 24 Oct 2023
0 answers
106 views

We have a serious issue when using this feature, following code generates attached error. It occurs when scrolling or clicking the "Show more results"

 

                                      <asp:SqlDataSource ID="sds_geneesmiddel" ConnectionString="<%$ connectionstrings:lef %>" SelectCommand="select Left(Naam, 70) as Naam, id from geneesmiddel order by Naam" runat="server"></asp:SqlDataSource>

                                                    <telerik:RadComboBox DataSourceID="sds_geneesmiddel" DataTextField="Naam" DataValueField="id"
                EnableAutomaticLoadOnDemand="true" ShowMoreResultsBox="true" EnableVirtualScrolling="true"
                ItemsPerRequest="10" Width="100%" Height="150px" Filter="Contains" EmptyMessage="Typ de naam" DropDownAutoWidth="Enabled" ID="rcb_geneesmiddel" runat="server">
                                                  
                                                    </telerik:RadComboBox>

 

This is something I have to solve today, please react urgently.

 

Marc

Fit2Page
Top achievements
Rank 2
Bronze
Iron
Iron
 asked on 24 Oct 2023
0 answers
157 views

I can't seem to get RadTabStrip to do validation the way I want it to...

I have a RadTabStrip with a RadMultiPage and several RadPageViews

Inside each RadPageView id a FormView

I also have a Validator on a field outside of the RadTabStrip.

Whenever I click on a Tab for the RadTabStrip the validation ErrorMessage for the validator outside of the TabStrip disappears.

What I would like to have happen when selecting a Tab in the Tab strip

1)  CustomValidator Messages outside of the tabstrip continue to show their ErrorMessage

2) Any controls within the newly selected tab have their CustomValidators server side methods called.

 

I have tried setting the RadTabStrip ValidationGroup to be the same as all the CustomValidators, ValidationRequestMode to Enabled... but that did not do anything.

I also tried calling Page.Validate() in the TabClick event.  However, that has the unpleasant effect of allways putting me on the first tab and not the tab I clicked on.

What can I do in order to get the functionality described in items #1 and #2 ?

 

Scott
Top achievements
Rank 1
Iron
Iron
 asked on 23 Oct 2023
2 answers
380 views

 

I am using below code and want to restrict input so user can only Allow numeric value to 3-digits right of decimal point.

for ex:

123.00

123

12.45

1

 <telerik:RadNumericTextBox ID="txtFactor" runat="server" MaxLength="5"
                                                MinValue="0.00" NumberFormat-DecimalDigits="<%$ Resources:Common,decimalDigitsTwo%>"
                                                Width="60px">
                                                 <ClientEvents OnBlur="CurrentYear" />
                                            </telerik:RadNumericTextBox>

Vasko
Telerik team
 answered on 23 Oct 2023
0 answers
82 views

I have RadGid using dynamic data binding to an SQL dataset. I'm also inserting items using a PostBack call from JavaScript.  The newly added items do not show on the grid after the rebind call. Paging and editing also no longer works without hiving refreshing the entire page.

Any help would be greatly appreciated. 

Grid Markup

 <telerik:RadAjaxLoadingPanel ID="rvpLoadingPanel" runat="server"></telerik:RadAjaxLoadingPanel>
                                    <telerik:RadAjaxPanel ID="rvpPanel" runat="server" LoadingPanelID="rvpLoadingPanel" ShowLoadingPanelForPostBackControls="true">
                                        <telerik:RadGrid ID="grdReviewPanel" runat="server" AutoGenerateColumns="false" CssClass="Gridheight4" Width="100%" AllowPaging="true" PagerStyle-AlwaysVisible="false" PageSize="4" Skin="Telerik">
                                            <ClientSettings>
                                                <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                                            </ClientSettings>
                                            <MasterTableView DataKeyNames="Panel_Member_ID" CommandItemDisplay="Top" EditMode="InPlace" AllowAutomaticUpdates="false" AllowAutomaticInserts="false" CommandItemSettings-ShowRefreshButton="true" HeaderStyle-Font-Size="8pt" HeaderStyle-Font-Bold="true" ItemStyle-Font-Size="8pt">
                                                <CommandItemTemplate>
                                                    <asp:LinkButton ID="btnNew" runat="server" CssClass="w3-btn w3-flat-midnight-blue w3-small w3-round" OnClientClick="btnNew_OnClick(); return false" ToolTip="Add new review panel members.."><i class="fa-solid fa-user-plus"></i> New</asp:LinkButton>
                                                    <asp:LinkButton ID="btnGridReFresh" runat="server" CssClass="w3-btn w3-flat-midnight-blue w3-small w3-round w3-right" OnClientClick="RfeshtlGrid(); return false"><i class="fa-solid fa-refresh"></i> Refresh</asp:LinkButton>
                                                </CommandItemTemplate>
                                                <Columns>
                                                     <telerik:GridEditCommandColumn HeaderText="Edit" HeaderStyle-Width="65px"></telerik:GridEditCommandColumn>
                                                    <telerik:GridBoundColumn DataField="Panel_Member_ID" UniqueName="Panel_Member_ID" Display="false" ForceExtractValue="Always" DataType="System.String"></telerik:GridBoundColumn>
                                                    <telerik:GridBinaryImageColumn DataField="Employee_Photo" UniqueName="Employee_Photo" ImageAlign="Middle" ImageHeight="30px" ImageWidth="30px" HeaderText="Panel Member" ReadOnly="true"></telerik:GridBinaryImageColumn>
                                                    <telerik:GridBoundColumn DataField="Reviewer_Name" UniqueName="Reviewer_Name" HeaderText="Name" DataType="System.String" ReadOnly="true" ItemStyle-Font-Size="7pt"></telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn DataField="Title" UniqueName="Title" HeaderText="Title" DataType="System.String" ItemStyle-Font-Size="7pt" ItemStyle-CssClass="maximize"></telerik:GridBoundColumn>
                                                    <telerik:GridCheckBoxColumn DataField="Minutes_Member" UniqueName="Minutes_Member" HeaderText="Minutes Member" DataType="System.Boolean" HeaderStyle-Width="65px"></telerik:GridCheckBoxColumn>
                                                    <telerik:GridNumericColumn DataField="List_Order" UniqueName="List_Order" HeaderText="Display Order" DataType="System.Int32" ItemStyle-Font-Size="7pt"></telerik:GridNumericColumn>
                                                    <telerik:GridClientDeleteColumn ButtonCssClass="w3-flat-midnight-blue" ButtonType="FontIconButton" CommandName="Delete" UniqueName="Delete" HeaderStyle-Width="60px" ConfirmDialogType="RadWindow" ConfirmText="Are you sure you want to delete this item?" ConfirmTitle="Delete"></telerik:GridClientDeleteColumn>
                                                </Columns>
                                            </MasterTableView>
                                        </telerik:RadGrid>
                                    </telerik:RadAjaxPanel>

Client Scripts

 <script type="text/javascript">
  //<![CDATA[

  function btnNew_OnClick() {
  //This function displays the dropdown container for selecting 
  // and listing dropdown selections to be added to the grid.
   var pmcontainer = document.querySelector("#newpm");
   pmcontainer.style.display = 'block';
   }
   function RefreshGrid() {
       __doPostBack("<%=rvpPanel.ClientID%>", " ");
    }
    function btnAdd_onClick() {
     //Calls the SQL insert statment.
       var dataList = $find("<%=lstReviewers.ClientID%>");
       var rowcount = dataList._virtualItemCount;
       if (rowcount > 0) {
       PageMethods.AddReviewMembers(itemsAdded, itemsFailed);
     }
     function itemsAdded(response) {
     	//Calls postback method add items and refresh the grid.
     	__doPostBack("<%=rvpPanel.ClientID%>", "Insert");
     	var pmcontainer = document.querySelector("#newpm");
     	pmcontainer.style.display = 'none';
     }
     function itemsFailed(error) {
     	var message = error.get_message();
      	swal.fire({
                  title: 'ERROR!',
                  text: message,
                  icon: 'error'
                });
            }
      }

    //]]>
  </script>

Code Behind


 Private Sub AppealSettings_Load(sender As Object, e As EventArgs) Handles Me.Load
	If Not IsPostBack Then
            ClearReviewerInfo()
            RefreshReviewerList()
        Else
            Dim ctrlName As String = Page.Request.Params.[Get]("__EVENTTARGET")
            If ctrlName.Contains("listRvPanel") Then
                'Listview Panel.. 
                Dim strparameter As String = Page.Request("__EVENTARGUMENT")
                If strparameter = "Delete" Then
                    ClearReviewerInfo()
                Else
                    GetPanelMemberInfo(strparameter)
                End If
            ElseIf ctrlName.Contains("rvpPanel") Then
                'Grid Panel
                Dim insertParam As String = Page.Request("__EVENTARGUMENT")
                If insertParam = "Insert" Then
                    AddNewPanelMembers()
                Else
                    grdReviewPanel.Rebind()
                End If

            End If
        End If

End Sub
    Private Sub grdReviewPanel_NeedDataSource(Sender As Object, e As GridNeedDataSourceEventArgs) Handles grdReviewPanel.NeedDataSource
        grdReviewPanel.DataSource = ReviewPanelData()
End Sub

 Private Function ReviewPanelData(Optional ByVal Command As String = "", Optional ByVal strPanelMemberID As String = "",
                   Optional ByVal strTitle As String = "", Optional ByVal blnMinutesMem As Boolean = False, Optional ByVal intOrder As Integer = Nothing) As DataTable

        Dim strConn As String = ConfigurationManager.ConnectionStrings("UMDB").ToString
        Dim strSQL As String = ""
        Dim dt As DataTable = Nothing

        Try
            Select Case Command
                Case PerformInsertCommandName
                    strSQL = "EXEC dbo.usp_ins_tbl_Review_Panel_Members @Panel_Member_ID = " & SQL_Prepare_String(strPanelMemberID)
                    strSQL &= ", @Title = " & SQL_Prepare_String(strTitle)
                    strSQL &= ", @Minites_Member = " & SQL_Prepare_Boolean(blnMinutesMem)
                    strSQL &= ", @List_Order = " & SQL_Prepare_Number(intOrder)
                    ExecuteSQL(strSQL, strConn)
                    Return dt
                Case UpdateCommandName
                    strSQL = "EXEC dbo.usp_upd_tbl_Review_Panel_Members @Panel_Member_ID = " & SQL_Prepare_String(strPanelMemberID)
                    strSQL &= ", @Title = " & SQL_Prepare_String(strTitle)
                    strSQL &= ", @Minites_Member = " & SQL_Prepare_Boolean(blnMinutesMem)
                    strSQL &= ", @List_Order = " & SQL_Prepare_Number(intOrder)
                    ExecuteSQL(strSQL, strConn)
                    Return dt
                Case DeleteCommandName
                    strSQL = "DELETE FROM dbo.tbl_Appeal_Panel_Review_Members WHERE Panel_Member_ID = " & SQL_Prepare_String(strPanelMemberID)
                    ExecuteSQL(strSQL, strConn)
                    Return dt
                Case Else
                    strSQL = "EXEC dbo.usp_get_tbl_Review_Panel_Members"
                    Dim ds As DataSet = GetDataSet(strSQL, 30, strConn)
                    dt = ds.Tables(0)
                    Return dt
            End Select
        Catch ex As Exception
            Dim strErrorText As String
            Dim strErrSource As String
            strErrSource = ex.Source
            strErrorText = "<P>" & Replace(Replace(Replace(Replace(Replace(ex.Message, vbCrLf, "<br/>"), "'", ""), "&", ""), "<", ""), ">", "") & "</p>"
            'Console.Write(ex.Source & vbCrLf & ex.Message & vbCrLf & ex.StackTrace)
            ShowError(strErrorText, strErrSource)
            Return Nothing
        End Try
 End Function

Private Sub AddNewPanelMembers()
        'Get the items selected from the dropdown container stored in temp SQL table
        ' and insert them into the grid's datasource table. 
        Dim strConn As String = ConfigurationManager.ConnectionStrings("UMDB").ToString
        Dim strSQL As String = "SELECT * FROM dbo.tmp_Reviewer_Staging"
        Dim ds As DataSet = GetDataSet(strSQL, 20, strConn)
        Dim dt As DataTable = ds.Tables(0)
        PanelMemID = ""
        PMtitle = ""
        PMListOrder = 0
        Dim rowCount As Integer = dt.Rows.Count
        If rowCount > 0 Then
            With dt
                For i As Integer = 0 To .Rows.Count - 1
                    Dim strPanelMemberID As String = .Rows(i).Item("Employee_ID")
                    Dim strTitle As String = .Rows(i).Item("Job_Title")
                    Dim intOrder As Integer = .Rows(i).Item("List_Order")
                    ReviewPanelData("PerformInsert", strPanelMemberID, strTitle, False, intOrder)
                    grdReviewPanel.MasterTableView.IsItemInserted = True
                    ReviewPanelData()
                Next
            End With
            grdReviewPanel.Rebind() 'Refresh grid after data insert.
            ClearReviewerInfo()
            RefreshReviewerList()
           
        End If

  End Sub
 

Fred
Top achievements
Rank 2
Iron
Iron
Iron
 asked on 23 Oct 2023
1 answer
134 views

I am attempting to put a radmenu inside of a radgrid gridTemplateColumn. The radmenu appears to have a vertical separator at the end that I have been unable to identify and remove which is underlined in red in the image below. 

Markup is as follows. CSS below.

<!--grid markup removed other than relevant column -->
<telerik:GridTemplateColumn UniqueName="ParentGridMenu" HeaderStyle-Width="24px">
    <ItemTemplate>
        <telerik:RadMenu ID="menuParentRow" runat="server" Width="24px" ClickToOpen="true">
            <Items>
                <telerik:RadMenuItem ImageUrl="~/images/vertical-ellipsis-24.png" runat="server" Height="24px" Width="24px">
                    <Items>
                        <!--items removed as not relevant -->
                    </Items>
                </telerik:RadMenuItem>
            </Items>
        </telerik:RadMenu>
    </ItemTemplate>
</telerik:GridTemplateColumn>

CSS lives in the page with the grid/menu markup.
    .rmRootGroup
   {
       border:none !important;
       background-color:transparent !important;
       background-image:none !important;
   },
.RadMenu_Default .rmVertical a.rmLink:hover,
.RadMenu_Default .rmVertical a.rmFocused,
.RadMenu_Default .rmVertical a.rmSelected,
.RadMenu_Default .rmVertical a.rmExpanded,
.RadMenu_Default .rmVertical a.rmExpanded:hover {
   border:0 !important;
   padding-bottom:1px !important;
   padding-top:1px !important;
   background-color:transparent !important;
   background-image:none !important;
}

Vessy
Telerik team
 answered on 20 Oct 2023
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?