Example #1
0
        private void RenderGridContent(HtmlTextWriter writer)
        {
            DataTable yAxisItems = DataTableHelper.SelectDistinct(_dataSource, _yAxisValueField);
            DataTable xAxisItems = DataTableHelper.SelectDistinct(_dataSource, _xAxisValueField);

            foreach (DataRow yAxisRow in yAxisItems.Rows)
            {
                RenderRowBegin(writer);

                string yAxisValue = yAxisRow[_yAxisValueField].ToString();

                PivotGridAxisCellEventArgs axisArgs = new PivotGridAxisCellEventArgs();
                axisArgs.Text = yAxisValue;
                RenderAxisCell(writer, axisArgs);

                foreach (DataRow xAxisRow in xAxisItems.Rows)
                {
                    string xAxisValue = xAxisRow[_xAxisValueField].ToString();

                    string expression = string.Format("{0}='{1}' and {2}='{3}'",
                        _yAxisValueField, yAxisValue,
                        _xAxisValueField, xAxisValue
                        );
                    DataRow[] founded = _dataSource.Select(expression);

                    string value = "";
                    if (founded.Length > 0)
                    {
                        value = founded[0][_factValueField].ToString();
                    }
                    PivotGridDataCellEventArgs dataArgs = new PivotGridDataCellEventArgs();
                    dataArgs.Text = value;
                    RenderDataCell(writer, dataArgs);
                }
                RenderRowEnd(writer);
            }
        }
Example #2
0
 protected override void RenderDataCell(HtmlTextWriter writer, PivotGridDataCellEventArgs args)
 {
     writer.WriteLine("<td>");
     writer.WriteLine(args.Text);
     writer.WriteLine("</td>");
 }
Example #3
0
 protected virtual void RenderDataCell(HtmlTextWriter writer, PivotGridDataCellEventArgs args)
 {
 }