| <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %> |
| <%@ Register assembly="RadTreeView.Net2" namespace="Telerik.WebControls" tagprefix="rad" %> |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head runat="server"> |
| <title>Untitled Page</title> |
| </head> |
| <body dir="rtl"> |
| <form id="form1" runat="server"> |
| <div> |
| <rad:RadTreeView ID="RadTreeView1" runat="server" |
| > |
| </rad:RadTreeView> |
| </div> |
| <asp:Button ID="Button1" runat="server" Text="Button" /> |
| </form> |
| </body> |
| </html> |
| Imports Telerik.WebControls |
| Imports System.Data.OleDb |
| Imports System.Data |
| Partial Class _Default |
| Inherits System.Web.UI.Page |
| Protected Sub form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles form1.Load |
| If Not IsPostBack Then |
| RadTreeView1.DataFieldID = "ParameterID" |
| RadTreeView1.DataValueField = "ParameterID" |
| RadTreeView1.DataTextField = "ParameterName" |
| RadTreeView1.DataFieldParentID = "ParentID" |
| RadTreeView1.DataSource = GetDataSource() |
| RadTreeView1.DataBind() |
| BindingTree(RadTreeView1.Nodes) |
| End If |
| End Sub |
| Private Function GetDataSource() As DataTable |
| Dim Con As New OleDbConnection("MyConnectionString") |
| Dim Cmd As New OleDbCommand |
| Dim Adp As New OleDbDataAdapter(Cmd) |
| Dim Dataset As New DataSet |
| Cmd.Connection = Con |
| Con.Open() |
| Cmd.CommandText = "SELECT * FROM [TBL]" |
| Adp.Fill(Dataset) |
| Con.Close() |
| Return Dataset.Tables(0) |
| End Function |
| Private Sub BindingTree(ByVal MyNode As RadTreeNodeCollection) |
| For index As Integer = 0 To MyNode.Count - 1 |
| If MyNode(index).Nodes.Count > 0 Then |
| BindingTree(MyNode(index).Nodes) |
| Else |
| Dim mylit As New Literal |
| mylit.Text = "<input type=""radio"" value=""" & MyNode(index).Value & """ name=""" & GetMainParentID(MyNode(index)).ToString & """ />" & MyNode(index).Text |
| MyNode(index).Controls.Clear() |
| MyNode(index).Controls.Add(mylit) |
| End If |
| Next |
| End Sub |
| Private Function GetStep(ByVal MyNode As RadTreeNode) As Int32 |
| If Not MyNode.Parent Is Nothing Then |
| Return GetStep(MyNode.Parent) + 1 |
| Else |
| Return 0 |
| End If |
| End Function |
| Private Function GetMainParentID(ByVal MyNode As RadTreeNode) As Int32 |
| Dim ChildStep As Int32 = GetStep(MyNode) |
| Dim MainParentNode As RadTreeNode |
| MainParentNode = MyNode |
| For index As Integer = 1 To ChildStep |
| MainParentNode = MainParentNode.Parent |
| Next |
| Return MainParentNode.Value |
| End Function |
| Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click |
| |
| Dim Hshtbl As New Hashtable |
| Session("MyHsh") = Hshtbl |
| ExtractData(RadTreeView1.Nodes) |
| Hshtbl = Session("MyHsh") |
| For Each TempObj As Object In Hshtbl.Values |
| Response.Write(TempObj.ToString + "<BR>") |
| Next |
| End Sub |
| Private Sub ExtractData(ByVal MyNode As RadTreeNodeCollection) |
| For index As Integer = 0 To MyNode.Count - 1 |
| If MyNode(index).Nodes.Count > 0 Then |
| ExtractData(MyNode(index).Nodes) |
| Else |
| If Not Request.Form(GetMainParentID(MyNode(index)).ToString) = "" Then |
| CType(Session("MyHsh"), Hashtable).Item(GetMainParentID(MyNode(index)).ToString) = Request.Form(GetMainParentID(MyNode(index)).ToString) |
| Exit For |
| End If |
| End If |
| Next |
| End Sub |
| End Class |
If Not Page.IsPostBack Then
Dim s As ChartSeries = RadChart1.Series.GetSeries(0)
s.DefaultLabelValue =
"#Y{#,#}"
RadChart1.ChartTitle.TextBlock.Text =
"Top 10"
s.Items(0).ActiveRegion.Url = _
"javascript:ShowPopUpDialog('detailpage.aspx');"
End If
Now there are two problems with this,
1: s.DefaultLabelValue = "#Y{#,#}" is not being applied, it gets executed, but series numbers still appear without formatting.
2: s.Items(0).ActiveRegion.Url throws an error: "Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index "
So it seems that it can't find the series, but I don't see why.
I am binding the grid using an objectdatasource, here's the markup:
<asp:ObjectDataSource ID="chartObds" runat="server"
SelectMethod="GetNewsFeaturesClickStats"
TypeName="NewsFeaturesAdminBLL"
SortParameterName="sortExpression" MaximumRowsParameterName="maximumRows"
StartRowIndexParameterName="startRowIndex">
<SelectParameters>
<asp:Parameter Name="sortExpression" Type="String" />
<asp:Parameter Name="startRowIndex" Type="Int32" />
<asp:Parameter Name="maximumRows" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
<div id="chartInp">
<asp:Button runat="server" ID="FirstPage" Text="<< First" />
<asp:Button runat="server" ID="PrevPage" Text="< Prev" />
<asp:Button runat="server" ID="NextPage" Text="Next >" />
<asp:Button runat="server" ID="LastPage" Text="Last >>" />
</div>
<
div id="NFchart">
<Telerik:RadChart ID="RadChart" Width="830px" Height="580px" runat="server"
DataSourceID="chartObds" Skin="SkyBlue">
<Series>
<
telerik:ChartSeries Name="MostViewed" DefaultLabelValue="#Y{#,#}">
<appearance>
<fillstyle filltype="ComplexGradient">
<fillsettings>
<complexgradient>
<Telerik:GradientElement Color="213, 247, 255" />
<Telerik:GradientElement Color="193, 239, 252" Position="0.5" />
<Telerik:GradientElement Color="157, 217, 238" Position="1" />
</complexgradient>
</fillsettings>
</fillstyle>
<textappearance textproperties-color="51, 51, 51">
</textappearance>
</appearance>
</telerik:ChartSeries>
</
Series>
<PlotArea>
<EmptySeriesMessage>
<TextBlock Text="No data found">
</TextBlock>
</EmptySeriesMessage>
<XAxis DataLabelsColumn="Title">
<Appearance Color="180, 210, 236" MajorTick-Color="206, 222, 235">
<MajorGridLines Color="206, 222, 235" PenStyle="Solid" />
<LabelAppearance RotationAngle="-400">
</LabelAppearance>
<TextAppearance AutoTextWrap="True" MaxLength="25"
TextProperties-Color="51, 51, 51">
</TextAppearance>
</Appearance>
<AxisLabel Visible="True">
<Appearance Visible="True">
</Appearance>
<TextBlock Text="Feature Title">
<Appearance
TextProperties-Color="51, 51, 51"
TextProperties-Font="Verdana, 8.25pt, style=Bold">
</Appearance>
</TextBlock>
</AxisLabel>
<
Items>
<
telerik:ChartAxisItem>
<
Appearance Dimensions-Margins="1px, 5px, 1px, 10px"></Appearance>
<
TextBlock>
<
Appearance MaxLength="35" TextProperties-Font="Arial, 8.5pt"></Appearance>
</
TextBlock>
</
telerik:ChartAxisItem>
<
telerik:ChartAxisItem Value="1">
<
Appearance Dimensions-Margins="1px, 5px, 1px, 10px"></Appearance>
<
TextBlock>
<
Appearance MaxLength="35" TextProperties-Font="Arial, 8.5pt"></Appearance>
</
TextBlock>
</
telerik:ChartAxisItem>
<
telerik:ChartAxisItem Value="2">
<
Appearance Dimensions-Margins="1px, 5px, 1px, 10px"></Appearance>
<
TextBlock>
<
Appearance MaxLength="35" TextProperties-Font="Arial, 8.5pt"></Appearance>
</
TextBlock>
</
telerik:ChartAxisItem>
<
telerik:ChartAxisItem Value="3">
<
Appearance Dimensions-Margins="1px, 5px, 1px, 10px"></Appearance>
<
TextBlock>
<
Appearance MaxLength="35" TextProperties-Font="Arial, 8.5pt"></Appearance>
</
TextBlock>
</
telerik:ChartAxisItem>
<
telerik:ChartAxisItem Value="4">
<
Appearance Dimensions-Margins="1px, 5px, 1px, 10px"></Appearance>
<
TextBlock>
<
Appearance MaxLength="35" TextProperties-Font="Arial, 8.5pt"></Appearance>
</
TextBlock>
</
telerik:ChartAxisItem>
<
telerik:ChartAxisItem Value="5">
<
Appearance Dimensions-Margins="1px, 5px, 1px, 10px"></Appearance>
<
TextBlock>
<
Appearance MaxLength="35" TextProperties-Font="Arial, 8.5pt"></Appearance>
</
TextBlock>
</
telerik:ChartAxisItem>
<
telerik:ChartAxisItem Value="6">
<
Appearance Dimensions-Margins="1px, 5px, 1px, 10px"></Appearance>
<
TextBlock>
<
Appearance MaxLength="35" TextProperties-Font="Arial, 8.5pt"></Appearance>
</
TextBlock>
</
telerik:ChartAxisItem>
<
telerik:ChartAxisItem Value="7">
<
Appearance Dimensions-Margins="1px, 5px, 1px, 10px"></Appearance>
<
TextBlock>
<
Appearance MaxLength="35" TextProperties-Font="Arial, 8.5pt"></Appearance>
</
TextBlock>
</
telerik:ChartAxisItem>
</
Items>
</XAxis>
<YAxis>
<Appearance Color="180, 210, 236" MajorTick-Color="206, 222, 235"
MinorTick-Color="206, 222, 235" CustomFormat="#,#" EndCap="Round">
<MajorGridLines Color="206, 222, 235" />
<MinorGridLines Color="206, 222, 235" PenStyle="Dash" />
<TextAppearance TextProperties-Color="51, 51, 51">
</TextAppearance>
</Appearance>
<AxisLabel Visible="True">
<Appearance Visible="True" Dimensions-Margins="1px, 1px, 1px, 10px">
</Appearance>
<TextBlock Text="Click-count">
<Appearance TextProperties-Color="51, 51, 51"
TextProperties-Font="Verdana, 8.25pt, style=Bold">
</Appearance>
</TextBlock>
</AxisLabel>
</YAxis>
<Appearance
Dimensions-Margins="18%, 100px, 12%, 80px"
Corners="Round, Round, Round, Round, 5">
<FillStyle MainColor="White" FillType="Solid">
</FillStyle>
<Border Color="180, 210, 236" />
</Appearance>
</PlotArea>
<Appearance Corners="Round, Round, Round, Round, 5">
<FillStyle MainColor="226, 247, 255">
</FillStyle>
<Border Color="82, 160, 226" />
</Appearance>
<ChartTitle>
<Appearance Dimensions-Margins="3%, 10px, 14px, 6%">
<FillStyle MainColor="Transparent">
</FillStyle>
<Border Color="Transparent" />
</Appearance>
<TextBlock Text="Top 10">
<Appearance TextProperties-Color="19, 111, 182"
TextProperties-Font="Arial, 18pt">
</Appearance>
</TextBlock>
</ChartTitle>
<Legend Visible="False">
<Appearance Visible="False" Dimensions-Margins="15%, 2%, 1px, 1px"
Position-AlignedPosition="TopRight">
<ItemTextAppearance MaxLength="20" TextProperties-Font="Verdana, 8pt">
</ItemTextAppearance>
<FillStyle MainColor="Transparent">
</FillStyle>
<Border Color="Transparent" />
</Appearance>
</Legend>
</Telerik:RadChart>
| <tr> |
| <td align="left"><input type="submit" name="ctl00$ContentPlaceHolder1$RadGrid1$ctl00$ctl02$ctl00$AddNewRecordButton" value=" " id="ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl02_ctl00_AddNewRecordButton" title="Lägg till" class="rgAdd" /> |
| <a id="ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl02_ctl00_InitInsertButton" href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$RadGrid1$ctl00$ctl02$ctl00$InitInsertButton','')">Lägg till</a> |
| <a id="ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl02_ctl00_CustomButton" href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$RadGrid1$ctl00$ctl02$ctl00$CustomButton','')">My custom button</a> |
| </td> |
| <td align="right"><input type="submit" name="ctl00$ContentPlaceHolder1$RadGrid1$ctl00$ctl02$ctl00$RefreshButton" value=" " id="ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl02_ctl00_RefreshButton" title="Uppdatera" class="rgRefresh" /> |
| <a id="ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl02_ctl00_RebindGridButton" href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$RadGrid1$ctl00$ctl02$ctl00$RebindGridButton','')">Uppdatera</a> |
| </td> |
| </tr> |
<
telerik:GridClientSelectColumn >
in the aspx page.
<telerik:GridClientSelectColumn >
<HeaderStyle Width="22px"></HeaderStyle>
<ItemStyle Width="22px" />
</telerik:GridClientSelectColumn>
With _tmp_currentSeries_2
.Appearance.ShowLabels =
False
.Appearance.PointMark.Visible =
True
.Appearance.PointDimentions.AutoSize =
False
.Appearance.FillStyle.MainColor = Drawing.Color.Firebrick
.Appearance.FillStyle.FillType = Styles.FillType.Solid
.Appearance.PointDimentions.Height = 12
.Appearance.PointDimentions.Width = 12
End With
| <HEAD id="HEAD" runat=server> |
| <LINK href="site.css" type="text/css" rel="stylesheet"> |
| </HEAD> |
| HtmlLink link = new HtmlLink(); |
| link.Attributes["href"] = "rss.aspx"; |
| link.Attributes["type"] = "application/rss+xml"; |
| link.Attributes["rel"] = "alternate"; |
| link.Attributes["title"] = "name"; |
| HEAD.Controls.Add(link); |

| html { overflow: hidden; } |
| .RadComboBoxDropDown Default .rcbScroll{overflow-y:hidden!important;} |
| MaxHeight="999" |
<table>
<tr>
<td>Search Type</td>
<td><telerik:RadComboBox ID="cboSearchType" runat="server" Skin="Forest" Width="425px">
<Items>
<telerik:RadComboBoxItem runat="server" Selected="True" Text="-- Select Search Type --" Value="-1" />
<telerik:RadComboBoxItem runat="server" Text="Customer Name" Value="1" />
<telerik:RadComboBoxItem runat="server" Text="Account Number" Value="2" />
</Items>
</telerik:RadComboBox>
</td>
<td><asp:RequiredFieldValidator InitialValue="-1" ControlToValidate="cboSearchType"
ValidationGroup="search"
ID="RequiredFieldValidator8" runat="server" ErrorMessage="Required" /></td>
</tr>
<tr>
<td>Search Criteria</td>
<td><telerik:RadTextBox ID="txtCustomerSearch" runat="server" Skin="Forest" Width="422px" /></td>
<td><asp:RequiredFieldValidator ControlToValidate="txtCustomerSearch"
ValidationGroup="search"
ID="RequiredFieldValidator1" runat="server" ErrorMessage="Required"/></td>
</tr>
<tr>
<td colspan="2" align="right">
<asp:Button ID="btnSearch" runat="server" ValidationGroup="search" Text="Search" />
</td>
</tr>
</table>