$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
How to Put up DataGrid of Chart Using C#
Home > How to > Chart Data Table
From some charts, you may see a table of data and this grid, called data grid, is what we are going to discuss in this article. In the data grid, you can view the values of one or more data series that are compared in the chart. To put it in another way, the data grid has offered all the information that you need to compare, like data series, data values and categories. But compared to the chart, it present the comparisons between data series in a less vivid way. And users have the ability to make the data grid visible or invisible in the chart. There may be the same count of columns in the data table according to the data series. And the same count of rows in the table according to the data categories.
And this article will put its focus on how to customize the settings of the data grid, like position, size, color and text style, using C# sample code.

Data Grid Settings

The settings for data grid table are conducted from following five aspects, which are boarder, size, fill style, position and text style. And here we will offer detailed asp.net coding guidance for each parts in following text.

Customize Data Grid Border

You are free to hide or display the border of chart data grid. If you want to display it, you can choose your desired penstyle, like solid. Besides, you are able to create it with your customized color and width.

KaxChart1.Diagram.DataGrid.Visible = true;
KaxChart1.Diagram.DataGrid.StyleSet.Border.Visible = true;
KaxChart1.Diagram.DataGrid.StyleSet.Border.PenStyle = System.Drawing.Drawing2D.DashStyle.Solid;
KaxChart1.Diagram.DataGrid.StyleSet.Border.Color = System.Drawing.Color.Red;
KaxChart1.Diagram.DataGrid.StyleSet.Border.Width = 1;

Define the Data Grid Size

The size of chart data grid can be either auto controlled or fully customized. In general, we will use the property autosize. If you turn this property on, the data grid will be automatically resized based on the data. Of course, if you want to resize the grid chart with fully tailored attribute values, like width, height, margin and padding, this ASP.NET AJAX can also meet your needs.

KaxChart1.Diagram.DataGrid.Visible = true;
KaxChart1.Diagram.DataGrid.StyleSet.Dimensions.IsAutoSize = true;

Set Data Grid Fill Style

The settings in this part cover two aspects. One is fill type and the other is color. And there are many templates in chart control, which can make web chart view special and beautiful.

KaxChart1.Diagram.DataGrid.Visible = true;
KaxChart1.Diagram.DataGrid.StyleSet.Fill.FillMode = ChartFillMode.Solid;
KaxChart1.Diagram.DataGrid.StyleSet.Fill.PrimaryColor = System.Drawing.Color.AliceBlue;

Define the Position of Data Grid

Using the property AlignedPosition, users can make the chart data grid be placed at specified position. If you want to position it at your desired place, you can use the application of X & Y axes. All orientation align modes are supported.

KaxChart1.Diagram.DataGrid.Visible = true;
KaxChart1.Diagram.DataGrid.StyleSet.Position.AlignedPosition = AlignedPositions.Bottom;

Set Text Style of Data Grid

The text style within the data grid can be also fully customized. We here offer rich text fonts and text color options for users to design the text style that they want.

KaxChart1.Diagram.DataGrid.Visible = true;
KaxChart1.Diagram.DataGrid.StyleSet.TextSurface.Color = System.Drawing.Color.Black;
KaxChart1.Diagram.DataGrid.StyleSet.TextSurface.Font = new System.Drawing.Font(FontFamily.GenericSerif, 12, FontStyle.Bold);
ASP.NET AJAX UI Controls