0

I am using Syncfusion tools to generate a graph dynamically from the data grid. The grid consists of multiple rows and each row has a checkbox for selection. The purpose of the checkbox is to select the entire row data and include that on the graph and grid in the word report. Upon the checkbox selection of a particular row in a grid, the data in that grid needs to be on the graph. Currently, all the data points in the grid are displayed and I am trying to change the logic by adding a condition to pull the data on the graph conditionally. Can someone please help me figure out the logic to get the data on the graph on checkbox selection only. I have researched a lot with no luck yet.

The X-axis: Emphasis area Y-axis: Incidents Here’s the code:

private void HandleRecordTypeQ3(int r)
        {
            PerformanceMeasureDataItem dataItem = reportData.PerformanceMeasureDataList[rCount + q3Count];
            q3Count++;
            var emphArea = data.Rows[r][RespnseColumnIndex].ToString();
            var abbr = data.Rows[r][AbbrColumnIndex].ToString();
            var targetCrash = data.Rows[r][TargetCrashtypeColumnIndex].ToString();
            var isExluded = data.Rows[r][IsExcludedColumnIndex].ToString();
            isExluded = String.IsNullOrEmpty(isExluded) ? "N" : isExluded;
            var isGraph = data.Rows[r][IsGraphColumnIndex].ToString();
            isGraph = String.IsNullOrEmpty(isGraph) ? "N" : isGraph;

            dataItem.Criteria = emphArea;
            dataItem.Abbr = abbr;
            dataItem.TargetCrashType = targetCrash;
            dataItem.IsIncludedinReport=isInluded.Equals("False", StringComparison.OrdinalIgnoreCase) ? false : true;
            dataItem.IsGraphData = isGraph.Equals("N", StringComparison.OrdinalIgnoreCase) ? false : true;


            for (int i = 0; i < dataItem.Incidents.Count; i++)
                { 
                    var rateOfseriousInjuries = data.Rows[r][NumOfFatalitesColumnIndex + i] != null ? data.Rows[r][NumOfFatalitesColumnIndex + i].ToString() : "0";
                    IncidentInformation currentIncident = dataItem.Incidents[i];
                    currentIncident.RateOfSeriousInjury = ConvertToDouble(rateOfseriousInjuries);
                    }

Thanks,

Dimpy

user3147594
  • 61
  • 1
  • 2
  • 14

1 Answers1

1

I think you are struggling with passing current record values to server-side.

Since there is an OnServerRowSelected Events which helps to display the selected records on the server side. The below table explains how to display the selected records from the grid to server side.

Default.aspx

<ej:grid id="FlatGrid" runat="server" allowpaging="True" AllowSelection="True" OnServerRowSelected="FlatGrid_ServerRowSelected" Selectiontype="Multiple">

     <ClientSideEvents Create="create" ActionComplete="complete" RecordClick="recordClick" />    

      <Columns>
           <ej:Column HeaderTemplateID="#headerTemplate" Template="True" TemplateID="#checkboxTemplate" TextAlign="Center" Width="90" />          
           <ej:Column Field="EmployeeID" HeaderText="Employee ID" Width="110"></ej:Column>
           <ej:Column Field="ShipCity" HeaderText="ShipCity" Width="90" />
     </Columns>

</ej:grid>

Default.aspx.cs

     protected void FlatGrid_ServerRowSelected(object sender, GridEventArgs e)
    {
    }

From the Server side, the selected particular record can be displayed as a graph dynamically. I hope this will be helpful to you to get the data on the graph dynamically from the server side.

BSMP
  • 4,596
  • 8
  • 33
  • 44
  • Thank you for your response. We have figured out that this cannot be accomplished in our application because of the way data is set up. But, thanks again for your time. – user3147594 Apr 11 '16 at 19:10