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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:08:15+00:00 2026-05-25T10:08:15+00:00

I am using devexpress 9.1. I have devexpress gridview binded to datasource. have set

  • 0

I am using devexpress 9.1.

I have devexpress gridview binded to datasource. have set a page size=”20″.
Enabled Settings ShowFilterRow=”true”;

I have column with asp image button setting its command arguments to a value.

Below is the code

 <dxwgv:ASPxGridView ID="ASPxGridView2" runat="server" DataSourceID="sds_addingredients" 
        AutoGenerateColumns="False" KeyFieldName="Ingredients_Id"   ClientInstanceName="grid2">
        <Settings ShowFilterRow="true" />
        <SettingsPager PageSize="20"></SettingsPager>
        <Columns>
        <dxwgv:GridViewDataTextColumn Caption="S.No" VisibleIndex="0" >
        <DataItemTemplate>
        <%#Container.ItemIndex +1 %> 
         </DataItemTemplate>
        </dxwgv:GridViewDataTextColumn>
          <dxwgv:GridViewDataTextColumn VisibleIndex="1" Caption=" ">
         <DataItemTemplate>
          <asp:ImageButton ID="btn_edit" runat="server" CommandArgument='<%# Eval("Ingredients_Id") %>' Height="15px" 
                        ImageUrl="~/images/document_edit.png"  ToolTip="Edit" 
                        Width="15px" />
                </DataItemTemplate>
            </dxwgv:GridViewDataTextColumn>
            <dxwgv:GridViewDataTextColumn VisibleIndex="1" FieldName="Ingredients_Id" 
              ReadOnly="True" Visible="False">
                <EditFormSettings Visible="False" />
            </dxwgv:GridViewDataTextColumn>
            <dxwgv:GridViewDataTextColumn Caption="Ingredient" FieldName="Ingredients_Name" VisibleIndex="2"  Settings-ShowFilterRowMenu="True" > 
              </dxwgv:GridViewDataTextColumn>

        </Columns>

Below show server side code

  protected void ASPxGridView2_RowCommand(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewRowCommandEventArgs e)
    { string id = e.CommandArgs.CommandArgument.ToString();//perform certain opertation based on the id}

The above method works properly but when i filter the result and click certain row, the Id received in the server end seems to be different not corresponding to what i clicked . i feel it gets the wrong row index…
this happens only when i try filtering and perform row command click.
Other wise it works properly. why is this.

  • 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-25T10:08:16+00:00Added an answer on May 25, 2026 at 10:08 am

    Have you tried using they KeyValue property?

     protected void ASPxGridView2_RowCommand(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewRowCommandEventArgs e)
        { 
          int id = Convert.ToInt32(e.KeyValue);
          //perform certain opertation based on the id
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using DevExpress in my winform application, I have a gridview, data entry
i am using devexpress gridview 9.2. i have 2 gridview having 2 colum -->
I have a page using ASPxGridView and to fill the GridView I use a
I am currently developing a C# based asp.net page. I am using the Devexpress
I am using a Devexpress 9 gridview which is bound to a datasource. I
I am using devexpress asp:GridView in asp.net with two columns: status and percentage The
I have a DevExpress gridView within an asp updatePanel. <asp:ScriptManager ID=ScriptManager1 runat=server /> <asp:UpdatePanel
I have D2006 and I am using DevExpress QuantumGrid 6 in a project. I
I have a base class, defined as below (I'm also using DevExpress components): public
I have a DevExpress GridView whose cells are painted with a random color based

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.