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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:01:43+00:00 2026-05-23T09:01:43+00:00

So my gridview has two columns BookID and BookName how can i retrieve the

  • 0

So my gridview has two columns BookID and BookName how can i retrieve the value of the BookID based on this event?

   protected void myGridView_RowCommand(object sender, GridViewCommandEventArgs e)

The Other question I had is, my application has thee Tabs (Using Telerik) when I am in the fourth tab which is where I have my gridview and I click on any button, it posts back and sends me to the first tab.. how can I control this?

Thank you very much 🙂

ASP CODE

<asp:GridView ID="myGridView" ShowFooter="true" ShowHeader="true" CaptionAlign="Left"
                                    runat="server" ForeColor="Black" CellPadding="4" AutoGenerateColumns="False"
                                    CssClass="Grid" Width="100%" GridLines="None" OnRowCommand="myGridView_RowCommand" 
                                    AllowPaging="True" AllowSorting="true" OnPageIndexChanging="myGridView_PageIndexChanging" PageSize="50" OnSorting="myGridView_Sorting" >
                                    <Columns>
                                        <asp:TemplateField HeaderText="ID">
                                            <ItemTemplate>
                                                <asp:Label runat="server" ID="lblBookID" Text='<%#DataBinder.Eval(Container.DataItem,"ID")%>' />
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="name" HeaderText="Book Name" SortExpression="Name" />
                                        <asp:TemplateField>
                                            <ItemTemplate>
                                                <asp:Button ID="Delete" Text="Remove" CommandArgument='<%# Eval("ID") %>'
                                                    CommandName="RemoveItem" CssClass="Button" runat="server" OnClientClick="javascript:return confirm('Sure you dont need this book.?');" />
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                    <EmptyDataTemplate>
                                        No Books found
                                    </EmptyDataTemplate>
                                    <RowStyle CssClass="RowStyle" />
                                    <HeaderStyle CssClass="HeaderStyle" ForeColor="White" HorizontalAlign="Center" />
                                    <AlternatingRowStyle CssClass="AlternatingRowStyle" />
                                    <FooterStyle CssClass="FooterStyle" />
                                </asp:GridView>     
  • 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-23T09:01:44+00:00Added an answer on May 23, 2026 at 9:01 am

    If you utilize the CommandArgument value and set it in a TemplateField to be the BookId value, then OnRowCommand you can use that value in your event handler.

    Something like this should do the trick.

    ASPX:

    <asp:GridView ID="myGridView" runat="server" onrowcommand="myGridView_RowCommand">
        <Columns>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:LinkButton ID="myLinkButton" runat="server" CommandArgument='<%#Eval("BookId") %>'>Do Stuff</asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField HeaderText="Id" DataField="BookId" />
            <asp:BoundField HeaderText="Name" DataField="BookName" />
        </Columns>
    </asp:GridView>
    

    C# code-behind:

    protected void myGridView_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        int bookID = Convert.ToInt32(e.CommandArgument);
        // Do Stuff
    }
    

    On selecting a specific Tab using the Telerik RadTabStrip

    check this post How to change progmatically active Tab in RadTabStrip/RadMultiPage? – TabStrip Forum – ASP.NET Controls

    looks to be a matter of setting the Selected property for the TabItem and if you’re using a MultiPage you’ll also need to set the SelectedIndex of that control

    radTabStrip1.Tabs.Item( 2 ).Selected = true;
    radMultiPage1.SelectedIndex = 2;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When one has a Gridview and two datatables and one wishes to get the
I have two update panels on my page. The first has a form that
I have a GridView that uses LinqDataSource. The GridView has default paging enable. I
Ok please excuse my references to the gridview. So I have this method in
I have two tables, one parent Point and one child PointValue, connected by a
I have a GridView using LinqDataSource to populate data from table Tickets . The
So I have a gridview within a gridview (I have a one to many
Backgroud: I'm using NHibernate for my model layer, and I have a HTTP module
I have a web application at work that is similar to a ticket working
how to make button cause validation for some controls and other not.. i have

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.