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 7626701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:21:39+00:00 2026-05-31T05:21:39+00:00

I am using RadGrid And I have LinkButton in its ItemTemplate. Onclick of this

  • 0

I am using RadGrid And I have LinkButton in its ItemTemplate. Onclick of this linkbutton want to select the row.Now My Problem is when I click on link button its get previous selected index instesd of the row which I have selected.Here is my code:

aspx

     <telerik:RadGrid ID="RadGridLeadHistory" runat="server" GridLines="None"
                AutoGenerateColumns="False" Width="1090px" Height="200px" HeaderStyle-Width="120px"
                onitemdatabound="RadGridLeadHistory_ItemDataBound"   >
                <MasterTableView ShowHeader="true">
                    <Columns>
                         <telerik:GridBoundColumn DataField="Note"  UniqueName="Note" HeaderText="Note">
                        </telerik:GridBoundColumn>
                    </Columns>
                    <ItemTemplate>
                    <table>
                    <tr>
                    <td width="120px"><asp:Label ID="LabelHistoryNote" runat="server" Text='<%# Bind("Note") %>' Visible="false"></asp:Label>
                     <asp:LinkButton ID="ButtonHistoryNote" runat="server" CommandName="Select"  Text="Note" OnCommand="ButtonHistoryNote_Click" CssClass="buttonsmall" ForeColor="Red" /></td></tr></table>
                        </ItemTemplate>
                </MasterTableView>
                <ClientSettings>
                    <Scrolling AllowScroll="true"  />
                    <Selecting AllowRowSelect="true" />
                </ClientSettings>
            </telerik:RadGrid>

aspx.cs

     protected void ButtonHistoryNote_Click(object sender, EventArgs e)
    {
        string str = "";
      foreach (GridDataItem item in RadGridLeadHistory.SelectedItems)
      {
         
              Label lb  =(Label)item.FindControl("LabelHistoryNote");
              str = lb.Text;
          
      }
      string str2 = str;
      TextBoxShowNote.Text = str;
     
    }

Now My Problem is When I click on LinkButton It Selects the last row I have selected not the current one.How Can I solve this?

UPDATE

I get answer ,I use CommandName property in Button and use select command,I change my code from button click event to SelectedIndex_Change event of RadGrid and Problem Solved…

  • 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-31T05:21:40+00:00Added an answer on May 31, 2026 at 5:21 am

    Try this in place of your For-loop:

    foreach (GridDataItem item in RadGridLeadHistory.MasterTableView.Items)
    {
        Label lb = item["LabelHistoryNote"].Controls[1] as Label;
        str = lbl.Text;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using RadGrid . In its Insert Mode.I have RadTextBox and Label .
I have a problem with animations using jQuery on nested tables. I want to
Using VS2008, and Telerik radGrid version 2010.1.519.35 I have a about 50 DNN modules
Iam using a telerik RadGrid and I want to check if GridDataItem is in
I have a telerik radgrid that is doing an insert using an objectdatasource. The
I am using a Telerik RadGrid and have custom filters set up on some
I have a class that defines a Hierarchical RadGrid that I will be using
I have radGrid in .ascx page in which I want to find the control
I'm using a Telerik RadGrid with custom paging. My problem is that when I
Here's the problem folks I'm using a Telerik RadGrid. Within is a FormTemplate with

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.