Hello,
i'm trying to programmatically create a chart in VB. (this is my first time working with RadCharts)
My issue is:
When i assign a data source to the chart, it seems that its assumed that all data columns need to be made into their own Series.
I'm using a SQL stored procedure that produces 16 different columns & I only need to use 5 of them...the other 11 can be left alone.
How do I best go about doing that?
When i tried defining just the Series's that i needed, it just added them to the other 16 Series that were created automaticly.
I've included the relevant code below. Thanks.
| Protected Sub Loader(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load |
| Dim sqlDataSource As New SqlDataSource() |
| sqlDataSource.ID = "myDataSource" |
| sqlDataSource.ConnectionString = "xxxxxxxxxxxxxxxxxxxxxxx" |
| sqlDataSource.SelectCommandType = SqlDataSourceCommandType.StoredProcedure |
| sqlDataSource.SelectCommand = "Analyze_SLA" |
| Me.Page.Controls.Add(sqlDataSource) |
| RadChart1.DataSourceID = "myDataSource" |
| RadChart1.Skin = "Colorful" |
| RadChart1.ChartTitle.TextBlock.Text = "Test Chart" |
| RadChart1.DefaultType = Telerik.Charting.ChartSeriesType.Area |
| RadChart1.AutoLayout = True |
| Dim chartSeries1 As New ChartSeries() |
| chartSeries1.Name = "Total Count" |
| chartSeries1.Type = ChartSeriesType.Area |
| chartSeries1.DataYColumn = "The_Count" |
| RadChart1.Series.Add(chartSeries1) |
| Dim chartSeries2 As New ChartSeries() |
| chartSeries2.Name = "Two" |
| chartSeries2.Type = ChartSeriesType.Area |
| chartSeries1.DataYColumn = "Issue2" |
| RadChart1.Series.Add(chartSeries2) |
| Dim chartSeries3 As New ChartSeries() |
| chartSeries3.Name = "Three" |
| chartSeries3.Type = ChartSeriesType.Area |
| RadChart1.Series.Add(chartSeries3) |
| RadChart1.DataBind() |
| Me.Page.Controls.Add(RadChart1) |
| End Sub |
|
Requirements |
|
| RadControls version |
2009_2_1028 |
| .NET version |
3.5 |
| Visual Studio version |
2008 |
| programming language |
VB |
| browser support |
all browsers supported by RadControls |
I have a RadGrid on a website where selecting a row triggers a database look-up and a post-back. When the page refreshes, the row does not appear selected, although the data is retrieved. We can see the row being selected before the post-back completes. I've looked at the Grid "Accessing Cells and Rows" demo and I think this may work for my situation, but I have not been able to set the row background from this example. Anyone have ideas on this? Any help would be appreciated. More details appear below:
(ASPX)
| <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" |
| AllowPaging="True" DataSourceID="LoggerDS" GridLines="None" > |
| <HeaderContextMenu> |
| <CollapseAnimation Type="OutQuint" Duration="200"> |
| </CollapseAnimation> |
| </HeaderContextMenu> |
| <PagerStyle Mode="NextPrevAndNumeric" /> |
| <MasterTableView autogeneratecolumns="False" datasourceid="LoggerDS" CommandItemDisplay="Top" HorizontalAlign="Center"> |
| <RowIndicatorColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </RowIndicatorColumn> |
| <ExpandCollapseColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </ExpandCollapseColumn> |
| <Columns> |
| <telerik:GridBoundColumn DataField="MDate" DataType="System.DateTime" ItemStyle-HorizontalAlign="Center" |
| HeaderText="Date" SortExpression="MDate" UniqueName="MDate"> |
| <ItemStyle HorizontalAlign="Center"></ItemStyle> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="CallID" DataType="System.Int32" ItemStyle-HorizontalAlign="Center" |
| HeaderText="Call ID" SortExpression="CallID" UniqueName="CallID" Display="False"> |
| <ItemStyle HorizontalAlign="Center"></ItemStyle> |
| </telerik:GridBoundColumn> |
| ... |
| </Columns> |
| <PagerStyle Mode="NextPrevAndNumeric" /> |
| <HeaderStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" |
| Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center" |
| Wrap="True" /> |
| <CommandItemTemplate> |
| <asp:Button ID="SelectButton" runat="server" Text="Review Selected Call" OnClientClick="return LoadReviewForm();" /> |
| </CommandItemTemplate> |
| </MasterTableView> |
| <FilterMenu> |
| <CollapseAnimation Type="OutQuint" Duration="200"> |
| </CollapseAnimation> |
| </FilterMenu> |
| <ClientSettings EnablePostBackOnRowClick="true"> |
| <Selecting AllowRowSelect="True"></Selecting> |
| </ClientSettings> |
| </telerik:RadGrid> |
| Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As GridCommandEventArgs) Handles RadGrid1.ItemCommand |
| If (e.CommandName = "RowClick" AndAlso TypeOf e.Item Is GridDataItem) Then |
| e.Item.Selected = True |
| e.Item.BackColor = Drawing.Color.DarkGray |
| ... |
|
Requirements |
|
| RadControls version | 2008 + |
| .NET version | |
| Visual Studio version | |
| programming language | c# |
| browser support |
all browsers supported by RadControls |
| <script type="text/javascript"> |
| function RowSelected(sender, eventArgs) { |
| var grid = sender; |
| var MasterTable = grid.get_masterTableView(); |
| var row = MasterTable.get_dataItems()[eventArgs.get_itemIndexHierarchical()]; |
| var cell = MasterTable.getCellByColumnUniqueName(row, "procreq_id"); |
| //var oWnd = radopen("pws_files.aspx?pws_id=" + cell.innerHTML, "Window1"); |
| var oWnd = radopen("../proc_chg_files.aspx?proc_chg_id=" + "2", "Window1"); |
| } |
| </script> |
| RadTreeView.FindNodeByValue("NODEVALUE").ExpandParentNodes(); |