We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Not able to get Row Value when row is selected

Thread ID:

Created:

Updated:

Platform:

Replies:

127633 Nov 29,2016 12:54 PM UTC Nov 30,2016 12:32 PM UTC ASP.NET Web Forms 2
loading
Tags: Grid
ChongEC
Asked On November 29, 2016 12:54 PM UTC

I have a set of data show in the Grid and I would like to get the row value when I click on the row (in my attachment, row value is the PO number value) .

My idea is to get the row value and pass back to sub function to do some checking and updating in sql server.

I have followed exactly the thread 124596 but still now able to get the row value prompted.

I'm using VS2010, vb.net, Syncfusion version: 14.3400.0.49. I have attach my sample project in the thread.

Any help is very much appreciated.

Attachment: TEST_APP_dd2bc104.zip

ChongEC
Replied On November 30, 2016 03:15 AM UTC

Hi, I'm able to get the row value now. I put the wrong object name in js.

I tried to have ContentPlaceHolderID + Grid name as below and it works.


<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <script type="text/javascript">
        
        function rowSelect() {
            var obj = $("#MainContent_Grid1").ejGrid("instance");
            //getSelectedRecords method will display the selected row in a grid    
            window.alert(obj.getSelectedRecords()[0].PONbr);
        }  

    </script>

    <div><h2>PO Approval</h2></div>
    <div>
    </div>

    <div>&nbsp;</div>
    <div>

        <ej:Grid ID="Grid1" runat="server" CssClass="Grid1" 
            AllowFiltering="True" AllowSorting="True" AllowResizeToFit="True" AllowReordering="True" 
            AllowSelection="True" EnableLoadOnDemand="False">

            <ClientSideEvents RowSelected ="rowSelect" />
            <Columns>
                <ej:Column DataType="string" Field="Comp" Width="60px" />
                <ej:Column DataType="date" Field="PODate" Format="{0:dd/MM/yyyy}" />
                <ej:Column DataType="string" Field="PONbr" />
                <ej:Column DataType="string" Field="Currency" HeaderText="Cury" Width="60px" />
                <ej:Column DataType="string" Field="SuppName" Width="200px" />
                <ej:Column DataType="number" Field="Amt" TextAlign="Right" Format="{0:C2}" />
                <ej:Column DataType="number" Field="GST" TextAlign="Right" Format="{0:C2}" />
                <ej:Column DataType="number" Field="TotAmt" TextAlign="Right" Format="{0:C2}" />
                <ej:Column DataType="string" Field="Status" Width="60px" />
            </Columns>
           <FilterSettings FilterType="Excel" />

        </ej:Grid>
        
    </div>
    <div>&nbsp;</div>
</asp:Content>

Mani Sankar Durai [Syncfusion]
Replied On November 30, 2016 12:32 PM UTC

Hi ChongEC, 

Thanks for contacting Syncfusion support. 

Yes we can get the selected value by using RowSelected event and we are happy that your problem has been solved. 

Please let us know if you need further assistance. 

Regards, 
Manisankar Durai. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;