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.
Unfortunately, activation email could not send to your email. Please try again.

GridGroupingControl JS get cell value from selected row

Thread ID:

Created:

Updated:

Platform:

Replies:

104082 Jun 20,2012 06:07 AM Jun 22,2012 05:45 AM ASP.NET Web Forms (Classic) 2
loading
Tags: GridGroupingControl
Assaf Magen
Asked On June 20, 2012 06:07 AM

Hello,

I need to use the ClientSideOnSelectionChanged in order to get the value of a cell in the selected row.

oData.Row.tableRow is not working for me.

Here is what I have so far:

function OnShowData(oData) {

                var row = oData.Row.tableRow;
                if (row == null) {
                    alert('null');
                }
                else {
                    alert([get cell value from selected row]);
                }
               
            }


<syncfusion:GridGroupingControl ID="grdEvents" runat="server"   
             DataSourceCachingMode="viewstate" 
             EnableCallbacks="true"   ClientSideOnSelectionChanged="OnShowData(this)" >
        
        <TableDescriptor FormEditMode="UseDefaultForm" AllowNew="false" AllowFilter="true"  >
        
        <VisibleColumns>
                            <Syncfusion:GridVisibleColumnDescriptor Name="CompanyName"/>
                            <Syncfusion:GridVisibleColumnDescriptor Name="title"/>
                        </VisibleColumns>
                        <Columns>
                            <Syncfusion:GridColumnDescriptor MappingName="CompanyName"  HeaderText="Entity"/>
                            <Syncfusion:GridColumnDescriptor MappingName="title" HeaderText="Title"/>
                         
                        </Columns>
        
        </TableDescriptor>

        </syncfusion:GridGroupingControl>


Eswari S [Syncfusion]
Replied On June 22, 2012 05:40 AM

Hi Assaf,

Thank you for using Syncfusion products.

Your requirement of getting selected row value can be achieved from current row values instead of table row values. Please refer to the following code snippets:

                                                                                                                 

[JavaScript]

<script type="text/javascript">
        function SelectionChange(gridobj) {
            // Temp record conatins the object binded to current row.
            this.Temprecord = {};
            var visiblecolumns = gridobj.currentRow.gridTable.visibleColumns;   // get the selected record value from currentRow         
            for (var i = 1; i < visiblecolumns.length; i++) {
                this.Temprecord[visiblecolumns[i].name] = gridobj.currentRow.GetValue(visiblecolumns[i].name);
            }
            alert(this.Temprecord["Name"]);
        }
    </script>

 

 

[Aspx]

 

<syncfusion:GridGroupingControl ID="GridGroupingControl1" runat="server" ShowHeaderGroupingIndicators="false" ShowIndicator="false"
        AutoFormat="Office 2007 Blue" BorderCollapse="Separate" DataSourceCachingMode="ViewState" ClientSideOnSelectionChanged="SelectionChange(this)">
        . . . .
        </Syncfusion:GridGroupingControl>

 

For your convenience , we have prepared the sample and the same can be downloaded from the following link:    

 

http://www.syncfusion.com/downloads/Support/DirectTrac/95502/Sample1116395137.zip

 

Please try this and let us know if you have any other queries.

 

Regards,

Eswari.S                                                                                                                                                         

 

 

 


Eswari S [Syncfusion]
Replied On June 22, 2012 05:45 AM

Hi Assaf,

Sorry for the inconvenience caused.

Sample link modified in our previous update. Please find the updated sample link from the following link:

http://www.syncfusion.com/downloads/Support/DirectTrac/95502/Grid ClientSideSelectionChange-1267473154.zip

Please try this and let us know if you have any other queries.

Regards,

Eswari.S                                                                                                                                                         

 

 

 


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.

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.

;