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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:30:41+00:00 2026-06-05T21:30:41+00:00

I’m trying to get the KeyField value from the FocusedRow in devexpress aspxGridview. Following

  • 0

I’m trying to get the KeyField value from the FocusedRow in devexpress aspxGridview.

Following code i have so far

  • GridView

           <dx:ASPxGridView ID="ClientenSummary" runat="server" Width="700px" 
            OnSelectionChanged="ClientenSummary_SelectionChanged" EnableCallBacks="False">
    
            <ClientSideEvents FocusedRowChanged="function(s, e) 
    

    {
    OnGridFocusedRowChanged();
    }” />

            <SettingsBehavior AllowSelectByRowClick="True" AllowSelectSingleRowOnly="True" ProcessSelectionChangedOnServer="True" />
            <SettingsPager PageSize="50">
            </SettingsPager>
            <Settings ShowFilterRow="True" ShowFilterRowMenu="True" />
        </dx:ASPxGridView>
    
  • JavaScript function in asp page markup

     <script language="javascript" type="text/javascript">
     function OnGridFocusedRowChanged() {
         ClientenSummary.GetRowValues(ClientenSummary.GetFocusedRowIndex(), 'ClassNR', OnGetRowValues);
     }
    
     function OnGetRowValues(values) {
         window.location = "../main.aspx?FocusedRowKeyField=" + values[0];
     }
    </script>
    
  • Backend C# code to resolve the query string

       protected void Page_Load(object sender, EventArgs e)
       {
        if (!string.IsNullOrEmpty(Request.Params["FocusedRowKeyField"]))
        {
            GetClientDetails(Request.Params["FocusedRowKeyField"]);
        }
    

The thing i can’t to figure out is , why the QueryString isn’t resolved. After some investigation on the interwebs i can’t find a decent solution, so thats why I’m asking here. Hope someone can help

  • 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-06-05T21:30:43+00:00Added an answer on June 5, 2026 at 9:30 pm

    Ok first off you do not have AllowFocusedRow="true" in your SettingsBehavior for your grid. This is going to cause it to ignore any client side events for FocusRowChanged.

    Secondly you need to tell the control whether you want to process the focused row changed event on the server or the client. I would recommend client and will post some code below. (DevExpress Documentation: http://documentation.devexpress.com/#AspNet/DevExpressWebASPxGridViewASPxGridView_FocusedRowChangedtopic)

    Third you have ProcessSelectionChangedOnServer="True" which is going to fire the code for your ClientenSummary_SelectionChanged event. But you did not post this code and to be honest unless this is serving some specific function that you didn’t post you don’t need it for what you asked for.

    Lastly I would recommend setting the client instance name of your grid, and the Key Fieldname. In my java code example I use “grid” and “ClassNR”.

    Java:

    <script type="text/javascript">
    function OnGridFocusedRowChanged() {
        grid.GetRowValues(grid.GetFocusedRowIndex(), 'ClassNR', OnGetRowValues);
    }
    
    function OnGetRowValues(ClassNR) {
        window.location.href = "../main.aspx?FocusedRowKeyField=" + ClassNR;
    } 
    

    Grid:

    <dx:ASPxGridView ID="grid" ClientInstanceName="grid" runat="server" EnableCallBacks="false" KeyFieldName="ClassNR">
    

    Settings:

    <SettingsBehavior AllowSelectByRowClick="True" AllowSelectSingleRowOnly="True" ProcessFocusedRowChangedOnServer="false" AllowFocusedRow="true"  />
    

    Client Side Event:

    <ClientSideEvents FocusedRowChanged="function(s,e) { OnGridFocusedRowChanged(); }" /> 
    

    This next bit is just to test the value, change it however you like.
    C#:

        protected void Page_Load(object sender, EventArgs e)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "myScript", "<script language=JavaScript>alert(" + Request.Params["FocusedRowKeyField"] + ");</script>");  
        }
    

    This is from a test application I set up for your question. It will update the browser address window (tested in IE9 only) with the FocusedRowKeyField when the focus row changes. It will also call the script in code behind which will pop up an alert with the value as well. The Page_Load event will be fired with each focus row change, you may want to modify that based on what you need this for.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have a text area in my form which accepts all possible characters from
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to loop through a bunch of documents I have to put
I have a bunch of posts stored in text files formatted in yaml/textile (from
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have a view passing on information from a database: def serve_article(request, id): served_article
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example

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.