Skip to content

Infragistics Community Forum / Web / Ultimate UI for ASP.NET Web Forms / Get the WebDataGrid cell value using JavaScript

Get the WebDataGrid cell value using JavaScript

New Discussion
Osama Gadour
Osama Gadour asked on Feb 7, 2020 8:32 AM

Dears,

Why I’m getting this error?

What I’m trying to do is that I have WebDataGrid with TemplateColumn with a button, when I click on the button it spouse to get the column “leaveref” value and assign it to a session and then transfer me to a new page using a JavaScript function.

I can’t get the value of the clicked row using JS! The Activation and Selection in the behaviors are activated.

Any help please? I am using Asp.net with Infragistics 2018 Vol.2

Sign In to post a reply

Replies

  • 0
    Martin Asenov
    Martin Asenov answered on Feb 4, 2020 3:53 PM

    Hello Osama,

    Thank you for posting in our community.

    I have created and attached a small sample trying to reproduce the behavior on your side. On my side, everything works as expected if Selection and Activation features are enabled. When the button is clicked, the cell value is retrieved from another column on the same row.

    Please test it on your side and let me know how it behaves.

    If this is not an accurate demonstration of what you are trying to achieve please feel free to modify it and send it back to me for further investigation.

    Looking forward to hearing from you.

    0880.Sample

    • 0
      Osama Gadour
      Osama Gadour answered on Feb 5, 2020 8:33 AM

      unfortunately didn’t work, see the screen below still getting the same error that they can’t read the get_behaviors property!!

      Please try your code with v 18.2.

    • 0
      Osama Gadour
      Osama Gadour answered on Feb 5, 2020 9:13 AM

      At the break-point in google chrome, I found that the var grid is returning null!! check this: I am not good with JS, what is wrong with it?

      • 0
        Martin Asenov
        Martin Asenov answered on Feb 5, 2020 2:50 PM

        Hello Osama,

        Usually, this exception is thrown when the find function can not find the WebDataGrid with the specified name.

        Please make sure that the ID property of WebDataGrid corresponds to the passed argument:

        
        

        I run the sample using 2018.2 service release and it works as expected.

        In case you are still experiencing after verifying that the id is correct, my suggestion is to modify the sample I have provided so that it replicates the behavior and send it back to me for further investigation.

      • 0
        Osama Gadour
        Osama Gadour answered on Feb 6, 2020 10:09 AM

        Thank you for your help and support, now I have created a new empty asp.net page for testing , and it's working fine as below code"

        <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="ff.aspx.vb" Inherits="Leave_Request.ff" %>
          
            
        
        
        
        
            
        
        
            

        NOW, I have create another page linked to a master pager, I copied the same code as below, but it didn't work!! it's very strange!! the code of the other page which is linked to a master page.

        <%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="test.aspx.vb" Inherits="Leave_Request.test" %>
        
             
            
            
               
                    
                
                    
                        
                            
                        
                        

        what do you this the problem is? working fine without the master page, not working with a master page!! which means inside the ContentPlaceHolder not working!

      • 0
        Martin Asenov
        Martin Asenov answered on Feb 6, 2020 11:56 AM

        Hello Osama,

        When master page is used then the child page control names will automatically change based the content place holder id. My suggestion is to use code render block to retrieve the actual ID:

        var grid = $find("<%= WebDataGridt.ClientID %>");
        

        Please let me know if you need any further assistance with this matter.

      • 0
        Osama Gadour
        Osama Gadour answered on Feb 6, 2020 2:22 PM

        Finaaaaaaaaallly, thank you so much for your support, I'm really thankful.

      • 0
        Martin Asenov
        Martin Asenov answered on Feb 7, 2020 8:32 AM

        Hello Osama,

        I am glad that you find my suggestion helpful.

        Thank you for using Infragistics components.

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Osama Gadour
Favorites
0
Replies
8
Created On
Feb 07, 2020
Last Post
6 years ago

Suggested Discussions

Created by

Created on

Feb 7, 2020 8:32 AM

Last activity on

Feb 23, 2026 1:40 PM