Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7687695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:45:38+00:00 2026-05-31T19:45:38+00:00

I have a telerik radgrid, like shown underneath | Username | Password | ————————-

  • 0

I have a telerik radgrid, like shown underneath

| Username | Password   |
-------------------------
| A_user   | *****      |
| A_user2  | *****      |
| A_user3  | *****      |

When I click one of the rows, it will display the password of the clicked row, like so:

| Username | Password   |
-------------------------
| A_user   | *****      |
| A_user2  | A password |
| A_user3  | *****      |

That works fine. I am proceeding this way because the decryption of the password is a rather complicated and long process, so decrypting one password at a time is less time consuming, especially when the user doesn’t need all the passwords.

When I have the password displayed, I’d like to be able to select the password in the grid to copy it. Unfortunately, the radgrid will fire the “RowClick” itemcommand once more, and the row gets de-selected. Therefore, I cannot copy the passwords.

My question is: Is there a way to cancel the itemcommand of a radgrid under certain circumstances?
I’d like to be able to disable the itemcommand event when the password is already decrypted.

Thanks in advance!

Edit:
I guess I should also be mentioning that I’m using a radajaxloadingpanel to display an animation over the grid when it’s loading. Even when the itemcommand method does nothing, the ajaxloadingpanel is displayed and the text I try to highlight is de-selected.

More edits:

Here is my radgrid code

<telerik:RadGrid id="radGridAccounts" runat="server" Width="99%" PageSize="20" AllowPaging="true" AllowSorting="true" 
                        AllowFilteringByColumn="True" ShowStatusBar="true" EnableLinqExpressions="False" GridLines="None"
                        AllowMultiRowSelection="false">

                        <ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="true" AllowKeyboardNavigation="false">
                            <Selecting AllowRowSelect="True" />
                            <KeyboardNavigationSettings EnableKeyboardShortcuts="false" />
                        </ClientSettings>
        <PagerStyle Mode="NextPrevAndNumeric" PagerTextFormat=""/>

        <MasterTableView AutoGenerateColumns="False" EditMode="InPlace" CommandItemDisplay="Top"
                            InsertItemDisplay="Top" AllowFilteringByColumn="True" NoMasterRecordsText="Aucun compte"
                            InsertItemPageIndexAction="ShowItemOnCurrentPage" DataKeyNames="USERN" >


        <Columns>
        <%--Username--%>
        <telerik:GridBoundColumn UniqueName="USERN" DataField="USERN" HeaderText="Username" 
                                    AllowFiltering="true" ColumnEditorID="radUsernameEditor"/>
        <%--Password--%>
        <telerik:GridBoundColumn UniqueName="PASWR" DataField="PASWR" HeaderText="Password"
                                    AllowFiltering="false" ColumnEditorID="radPasswordEditor" />
        <%--Edit--%>
        <telerik:GridEditCommandColumn ButtonType="ImageButton"
                                    InsertImageUrl=".\Images\ok.gif" UpdateImageUrl=".\Images\ok.gif" CancelImageUrl=".\Images\cancel.gif" />
        <%--Delete--%>
        <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" Text="Delete" 
                                ImageUrl=".\Images\delete.gif" />
        </Columns>
    <CommandItemSettings AddNewRecordText="" RefreshText="" />

    </MasterTableView>
</telerik:RadGrid>

And my ItemCommand code:

Protected Sub radGridAccounts_ItemCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles radGridAccounts.ItemCommand

Try

    If (e.CommandName = "RowClick" AndAlso TypeOf e.Item Is GridDataItem) Then
        e.Item.Selected = True

        For Each item As GridDataItem In radGridAccounts.Items

            If Not item.IsInEditMode Then
                If item.Selected Then
                    'Decrypt the password method
                Else 
                    item.Cells(4).Text = "*****"
                End If

            End If

        Next

    End If

Catch ex As Exception
    DisplayMessage("Error : " & ex.Message, MessageType.Err)
End Try

End Sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T19:45:40+00:00Added an answer on May 31, 2026 at 7:45 pm

    Switch to OnSelectedIndexChanged function on the radGrid and store the current selected row in a clientside variable, and handle the rowSelected client event and either cancel or allow the postback to happen, also add in the ClientDataKeyName that you want to use.

    <telerik:RadGrid id="radGridAccounts" runat="server" Width="99%" PageSize="20" AllowPaging="true" AllowSorting="true"  OnSelectedIndexChanged="RadGridAccounts_SelectedIndexChanged"
                            AllowFilteringByColumn="True" ShowStatusBar="true" EnableLinqExpressions="False" GridLines="None"
                            AllowMultiRowSelection="false">
    
                            <ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="true" EnableAllowKeyboardNavigation="false">
                                <Selecting AllowRowSelect="True" />
                                <KeyboardNavigationSettings EnableKeyboardShortcuts="false" />
         <ClientEvents OnRowSelected="rowSelected" />
        </ClientSettings>
            <PagerStyle Mode="NextPrevAndNumeric" PagerTextFormat=""/>
    
            <MasterTableView AutoGenerateColumns="False" EditMode="InPlace" CommandItemDisplay="Top"
                                InsertItemDisplay="Top" AllowFilteringByColumn="True" NoMasterRecordsText="Aucun compte"
                                InsertItemPageIndexAction="ShowItemOnCurrentPage" DataKeyNames="USERN" ClientDataKeyNames="USERN" >
    
    
            <Columns>
             ...
            </Columns>
        <CommandItemSettings AddNewRecordText="" RefreshText="" />
    
        </MasterTableView>
    </telerik:RadGrid>
    
    
    
     <script type="text/javascript">
     var selectedUserName;//global js var 
      function rowSelected(senders, args) 
      {
            //get the ClientDataKeyName
            var rowUserName= args.getDataKeyValue("USERN");
            if(selectedUserName == rowUserName){
                  args.set_cancel(true);//cancel the postback
            }   
      }
     </script>
    

    Then on the server-side:

      protected void RadGridAccounts_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (RadGridAccounts.SelectedItems == null || RadGridAccounts.SelectedItems.Count == 0)
                return;
    
            var dataItem = RadGridAccounts.SelectedItems[0] as GridDataItem;
            if (dataItem != null)
            {
               //do the password look up 
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this Telerik radgrid | Encryption Key | Password to encode | Edit
I have some boiler-plate script required for a Telerik RadGrid on one of my
I have a Telerik's RadGrid which has 2 columns like this: <Columns> <telerik:GridBoundColumn HeaderText=AirlineCode
I have a telerik:RadGrid that is bound to a SQL Data Source. One of
I have a Telerik RadGrid which is composed of rows of checkboxes and text.
I have a Telerik RadGrid with a GridTemplateColumn that contains a checkbox, as follows:
I have problems binding both a telerik RadGrid and a plain vanilla ASP.NET GridView
I have grid in my ASP.NET page (actualy it's Telerik RadGrid). There is GridButtonColumn
I have a telerik radgrid that has an allows inserts. After clicking the Add
I have one class which contains two more classes like hierarchy. When I'm displaying

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.