Add confirm to GridButtonColumn

4 posts, 0 answers
  1. Richard
    Richard avatar
    4 posts
    Member since:
    Nov 2016

    Posted 01 Nov Link to this post

    I've read several threads on this, but still cannot seem to get this to work.

    I have a LogIn button on a RadGrid that I only want to have a confirmation on in a specific situation. I've tried several different ways, this seems to get the closest, but I am still not seeing the popup confirmation dialog. Any help is greatly appreciated.

    Relevant code below.

     

        Protected Sub grdAccounts_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles grdAccounts.ItemDataBound

          If TypeOf e.Item Is Telerik.Web.UI.GridDataItem Then
                Dim item As Telerik.Web.UI.GridDataItem = DirectCast(e.Item, Telerik.Web.UI.GridDataItem)

                If ddlSiteType.SelectedValue.StartsWith("LIVE") Or ddlSiteType.SelectedValue.StartsWith("DR") Then
                    Dim btnLogin As Button = CType(item("LogIn").Controls(0), Button)
                    If btnLogin IsNot Nothing Then
                        btnLogin.Attributes.Add("ConfirmTitle", "Continue?")
                        btnLogin.Attributes.Add("ConfirmText", "You are entering a LIVE production site. Continue?")
                        btnLogin.Attributes.Add("ConfirmDialogType", "Classic")
                    End If
                End If

    ...

    End If

    End Sub

     

  2. Richard
    Richard avatar
    4 posts
    Member since:
    Nov 2016

    Posted 02 Nov Link to this post

    Anybody?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Richard
    Richard avatar
    4 posts
    Member since:
    Nov 2016

    Posted 02 Nov Link to this post

    This doesn't workl either.

        Protected Sub grdAccounts_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles grdAccounts.ItemDataBound
            If TypeOf e.Item Is Telerik.Web.UI.GridDataItem Then
                Dim item As Telerik.Web.UI.GridDataItem = DirectCast(e.Item, Telerik.Web.UI.GridDataItem)

                If ddlSiteType.SelectedValue.StartsWith("LIVE") Or ddlSiteType.SelectedValue.StartsWith("DR") Then
                    Dim button As LinkButton = CType(item("LogIn").Controls(0), LinkButton)
                    button.Attributes("onclick") = "return confirm('You are entering a LIVE Production Site. Do you want to continue?')"
                End If

  5. Richard
    Richard avatar
    4 posts
    Member since:
    Nov 2016

    Posted 02 Nov Link to this post

    I figured it out, thanks though.
Back to Top