| <asp:UpdatePanel runat="server" ID="UpdatePanel1"> |
| <ContentTemplate> |
| <rad:RadDockLayout runat="server" ID="RadDockLayout1" OnSaveDockLayout="RadDockLayout1_SaveDockLayout" OnLoadDockLayout="RadDockLayout1_LoadDockLayout" > |
| <rad:RadDockZone ID="RadDockZoneFelder" runat="server" /> |
| </rad:RadDockLayout> |
| </ContentTemplate> |
| </asp:UpdatePanel> |
| Private Property CurrentDockStates() As List(Of DockState) |
| Get |
| 'Store the info about the added docks in the session. For real life |
| ' applications we recommend using database or other storage medium |
| ' for persisting this information. |
| Dim _currentDockStates As List(Of DockState) = DirectCast(Session("CurrentDockStatesDynamicDocks"), List(Of DockState)) |
| If [Object].Equals(_currentDockStates, Nothing) Then |
| _currentDockStates = New List(Of DockState)() |
| Session("CurrentDockStatesDynamicDocks") = _currentDockStates |
| End If |
| Return _currentDockStates |
| End Get |
| Set(ByVal value As List(Of DockState)) |
| Session("CurrentDockStatesDynamicDocks") = value |
| End Set |
| End Property |
| Private Sub CreateSaveStateTrigger(ByVal dock As RadDock) |
| 'Ensure that the RadDock control will initiate postback |
| ' when its position changes on the client or any of the commands is clicked. |
| 'Using the trigger we will "ajaxify" that postback. |
| dock.AutoPostBack = True |
| dock.CommandsAutoPostBack = True |
| Dim saveStateTrigger As New AsyncPostBackTrigger() |
| saveStateTrigger.ControlID = dock.ID |
| saveStateTrigger.EventName = "DockPositionChanged" |
| UpdatePanel1.Triggers.Add(saveStateTrigger) |
| saveStateTrigger = New AsyncPostBackTrigger() |
| saveStateTrigger.ControlID = dock.ID |
| saveStateTrigger.EventName = "Command" |
| UpdatePanel1.Triggers.Add(saveStateTrigger) |
| End Sub |
| Private Function CreateRadDockFromState(ByVal state As DockState) As RadDock |
| Dim dock As New RadDock() |
| dock.DockMode = DockMode.Docked |
| dock.ID = String.Format("radDock{0}", state.UniqueName) |
| dock.Text = state.UniqueName |
| 'dock.Controls.Add(Me.erzeugeNeuenTabellenEintragFeld(state.UniqueName)) |
| dock.ApplyState(state) |
| dock.Commands.Add(New DockCloseCommand()) |
| dock.Commands.Add(New DockExpandCollapseCommand()) |
| Return dock |
| End Function |
| Protected Sub RadDockLayout1_LoadDockLayout(ByVal sender As Object, ByVal e As DockLayoutEventArgs) |
| 'Populate the event args with the state information. The RadDockLayout control |
| ' will automatically move the docks according that information. |
| For Each state As DockState In CurrentDockStates |
| e.Positions(state.UniqueName) = state.DockZoneID |
| e.Indices(state.UniqueName) = state.Index |
| Next |
| End Sub |
| Protected Sub RadDockLayout1_SaveDockLayout(ByVal sender As Object, ByVal e As DockLayoutEventArgs) |
| 'Save the dock state in the page Session. This will enable us |
| ' to recreate the dock in the next Page_Init. |
| CurrentDockStates = RadDockLayout1.GetRegisteredDocksState() |
| End Sub |
| Protected Sub RadDock1_DockPositionChanged(ByVal sender As Object, ByVal e As DockPositionChangedEventArgs) |
| Dim dock As RadDock = DirectCast(sender, RadDock) |
| If e.DockZoneID = [String].Empty Then |
| dock.Text = [String].Format("I used to be in {0} but now I am floating.", _ |
| dock.DockZoneID) |
| Else |
| If dock.DockZoneID = [String].Empty Then |
| dock.Text = "I used to be floating, but now I am docked in " + _ |
| e.DockZoneID |
| ElseIf dock.DockZoneID <> e.DockZoneID Then |
| dock.Text = [String].Format("I moved from {0} to {1}.", _ |
| dock.DockZoneID, e.DockZoneID) |
| Else |
| dock.Text = [String].Format("I moved from position {0} to position {1}.", _ |
| dock.Index.ToString(), e.Index.ToString()) |
| End If |
| End If |
| If Not Me.Session("liste_felder") Is Nothing Then |
| Dim tobjListeFelder As ArrayList |
| tobjListeFelder = Me.Session("liste_felder") |
| End If |
| End Sub |
| ''' <summary> |
| ''' Seite initialisieren |
| ''' </summary> |
| Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Init |
| Me._id_produkt = Me.globalContext.QueryString("id_produkt") |
| btnZurueck.url = Me.globalContext.URLContext.ermittleURL_AlleParameterAdmin(Me.globalContext.URLContext.id_seite, Me.globalContext.URLContext.id_seite, Me.globalContext.URLContext.id_vonmodul, -1, Me._id_produkt, -1, , , , , , , True, "id_produkt=") |
| If Not Me.IsPostBack() Then |
| Dim tAnzahl As Integer |
| Dim tobjKonditionendefinitionenListe As New class_banken_produktdb_konditionendefinitionen_liste() |
| ' Anzahl der schon definierten Felder ermitteln |
| tAnzahl = tobjKonditionendefinitionenListe.ermittleAnzahlBeiProduktvonTab_banken_konditionendefinitionen(Me._id_produkt) |
| ' Anzahl und Felder initialisieren |
| If tAnzahl = 0 Then |
| Me.Session.Add("anzahl_felder", 0) |
| Me.Session.Add("liste_felder", New ArrayList()) |
| Else |
| Me.Session.Add("anzahl_felder", tAnzahl) |
| Me.Session.Add("liste_felder", Me.setzeListeFelder()) |
| End If |
| ' Erzeugt die Controls |
| Me.erzeugeInhalte() |
| Else |
| ''Recreate the docks in order to ensure their proper operation |
| Dim i As Integer = 0 |
| While i < CurrentDockStates.Count |
| Dim dock As RadDock = CreateRadDockFromState(CurrentDockStates(i)) |
| 'We will just add the RadDock control to the RadDockLayout. |
| ' You could use any other control for that purpose, just ensure |
| ' that it is inside the RadDockLayout control. |
| ' The RadDockLayout control will automatically move the RadDock |
| ' controls to their corresponding zone in the LoadDockLayout |
| ' event (see below). |
| RadDockLayout1.Controls.Add(dock) |
| 'We want to save the dock state every time a dock is moved. |
| CreateSaveStateTrigger(dock) |
| System.Math.Max(System.Threading.Interlocked.Increment(i), i - 1) |
| End While |
| End If |
| End Sub |
| ''' <summary> |
| ''' Setzt die Liste mit den vorhanden Controls |
| ''' </summary> |
| Private Function setzeListeFelder() As ArrayList |
| Dim tobjListe As New ArrayList |
| Dim tobjKonditonendefinitionen As class_banken_produktdb_konditionendefinitionen |
| Dim tobjKonditionendefinitionenListe As New class_banken_produktdb_konditionendefinitionen_liste() |
| ' Alle vorhanden Definitionen ermitteln und die IDs als Liste zurückliefern, somit kann später ein |
| ' Abgleich gemacht werden ob die Definition schon in der DB ist oder nicht, d.h. neu geschrieben werden |
| ' muss oder nicht |
| tobjKonditionendefinitionenListe.ermittleListeBeiProduktvonTab_banken_konditionendefinitionen(Me._id_produkt) |
| For Each tobjKonditonendefinitionen In tobjKonditionendefinitionenListe |
| tobjListe.Add(tobjKonditonendefinitionen.getValue("id")) |
| Next |
| Return tobjListe |
| End Function |
| ''' <summary> |
| ''' Erzeugt den Inhalt für die dynamisch angelegten Felder |
| ''' </summary> |
| Private Sub erzeugeInhalte() |
| ' Erzeuge die Inhalte für die liste_felder |
| If Not Me.Session("liste_felder") Is Nothing Then |
| For Each tid_definition As Integer In Me.Session("liste_felder") |
| Dim tobjRadDock As New RadDock() |
| tobjRadDock.ID = "radDock" & tid_definition |
| tobjRadDock.DockMode = DockMode.Docked |
| tobjRadDock.UniqueName = tid_definition |
| tobjRadDock.Title = tid_definition |
| tobjRadDock.Text = tid_definition |
| 'tobjRadDock.AutoPostBack = True |
| 'AddHandler tobjRadDock.DockPositionChanged, AddressOf RadDock1_DockPositionChanged |
| tobjRadDock.Controls.Add(Me.erzeugeNeuenTabellenEintragFeld(tid_definition)) |
| Me.RadDockZoneFelder.Controls.Add(tobjRadDock) |
| CreateSaveStateTrigger(tobjRadDock) |
| 'Me.paInhaltKonditionDefinitionen.Controls.Add(Me.erzeugeNeuenTabellenEintragFeld(tid_definitiion)) |
| Next |
| End If |
| End Sub |
Hi,
Im using Promethus RAD chart. In my user control, I have three charts which are dynamically binding and im having different legend for different charts.
In my ascx, i have this much code and im doing all the things in code behind.
<telerik:radchart ID="RadChart1" SkinsOverrideStyles="false" runat="server" Width="600px" Height="430px" seriespalette="" visible="false" >
<PlotArea>
<Appearance dimensions-width="470" > </Appearance>
</PlotArea>
</telerik:radchart>
Legend Creation in code behind:
Dim lbl1 As New LabelItem
With RadChart1.Legend.Items(0)
.TextBlock.Text =
"81 to 100% - Appraisal criteria fully met"
.Marker.Appearance.FillStyle.MainColor = Drawing.Color.Green
.Marker.Appearance.FillStyle.SecondColor = Drawing.Color.GreenYellow
.TextBlock.Appearance.TextProperties.Color = Color.Black
End With
Dim lbl2 As New LabelItem
With RadChart1.Legend.Items(1)
.TextBlock.Text =
"41 to 80% - Appraisal criteria partially met"
.Marker.Appearance.FillStyle.MainColor = Drawing.Color.Yellow
.Marker.Appearance.FillStyle.SecondColor = Drawing.Color.Silver
End With
With RadChart1.Legend
.AddLabel(lbl1)
.AddLabel(lbl2)
.Appearance.Position.AlignedPosition = Styles.AlignedPositions.BottomLeft
.Appearance.Location = Styles.LabelLocation.OutsidePlotArea
RadChart1.Legend.Visible =
True
End With
IN the ascx control, i have combo box with the chart types... when the user changes the chart type and click refresh , then the next chart is loaded. but when the user just changes the chart type alone, then nothing should happen.
actual result : when the user changes the chart type, chart remains the same..but legend text and marker diasppears completely leaving blank white space. but when i click refresh, then legend comes properly.
Is there a way to keep the legend as it is when the user changes the chart type in combo box.
Could you pls.
Thanks
| functionschedule.rebind(); |
| functionschedule.set_selectedDate("2/3/2010"); //rs.get_selectedDate()); |
| alert('rebinded'); |
| billable | nonbillable | ||||||||||||
| Novartis | Binod | 32 | 8 | ||||||||||
| Jaswanth | 12 | 23 | |||||||||||
| Sudhanva | 34 | 6 | |||||||||||
| KOL | Binod | 22 | 18 | ||||||||||
| Harish | 39 | 1 | |||||||||||
| Sudhanva | 35 | 5 | |||||||||||
| and chart should be like attached picture here. please guide me how to achive chart like this using above type of datatset. | |||||||||||||
| /* hack for Telerik file explorer .rtbIconOnly css class to look like normal icon+text buttons: */ |
| .RadFileExplorer .RadToolBar .rtbIconOnly .rtbText { |
| font-size: 12px !important; |
| padding:0 2px 0 22px !important; |
| } |