
<YAxis AutoScale="True" IsZeroBased="false">Protected Sub RadChart1_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadChart1.PreRender Dim TheMinValue As Double Dim TheMaxValue As Double Dim TheValue As Double 'Loop through each Y value in series 0 and get it's value. We need to get the 'Min and Max values for the entire chart. 'For seriescount As Integer = 0 To RadChart1.Series.Count - 1 For itemcount As Integer = 0 To RadChart1.Series(0).Items.Count - 1 TheValue = RadChart1.Series(0).Item(itemcount).YValue 'assign default values in the 1st iteration of the loop If itemcount = 0 Then TheMinValue = TheValue TheMaxValue = TheValue End If If TheValue < TheMinValue Then TheMinValue = TheValue If TheValue > TheMaxValue Then TheMaxValue = TheValue Next If TheMinValue = TheMaxValue Then 'we have a problem because all Y values are equal. This is going to destroy the 'chart scaling along the left hand side. 'The below solution does not seem to work. RadChart1.Series(0).PlotArea.YAxis.AutoScale = False RadChart1.Series(0).PlotArea.YAxis.MinValue = TheMinValue * 0.95 RadChart1.Series(0).PlotArea.YAxis.MaxValue = TheMaxValue * 1.05 RadChart1.Series(0).PlotArea.YAxis.Step = 5 Else RadChart1.Series(0).PlotArea.YAxis.AutoScale = True End If End Sub<telerik:RadScriptManager ID="RadScriptManager1" runat="server"> </telerik:RadScriptManager> <telerik:RadRotator ID="AlertsRotator" runat="server" RotatorType="Buttons" Height="200px" ItemHeight="200px" ScrollDirection="Left" Width="500px" ItemWidth="500px"> <ItemTemplate > <div style="text-align: left"> <table width="480px"> <tr> <td align="Center"><strong><%# DataBinder.Eval(Container.DataItem," UserNotificationSubject") %></strong></td> </tr> <tr> <td align="left"><%# DataBinder.Eval(Container.DataItem,"UserNotificationMessage") %></td> </tr> <tr> <td> <input type="button" value="click me" onclick="alert('<%# DataBinder.Eval(Container.DataItem,"UserNotificationSeqNum") %>')" /></td> </tr> </table> </div> </ItemTemplate> </telerik:RadRotator>Public Partial Class Rotator Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim oData As New DataTable With oData .Columns.Add("UserNotificationSubject") .Columns.Add("UserNotificationMessage") .Columns.Add("UserNotificationSeqNum") End With Dim NewRow As DataRow = oData.NewRow NewRow("UserNotificationSeqNum") = "0" NewRow("UserNotificationSubject") = "Test User Notification Subject" NewRow("UserNotificationMessage") = "Test User Notifcation Message" oData.Rows.Add(NewRow) NewRow = oData.NewRow NewRow("UserNotificationSeqNum") = "1" NewRow("UserNotificationSubject") = "REMINDER" NewRow("UserNotificationMessage") = "Document T1 Reminder: I'm testing the reminders (To cancel this reminder use 20 on Document)" oData.Rows.Add(NewRow) NewRow = oData.NewRow NewRow("UserNotificationSeqNum") = "2" NewRow("UserNotificationSubject") = "REMINDER" NewRow("UserNotificationMessage") = "Document T1 Reminder: I'm testing the reminders adslfjkasd;lfja;ld jf;ladjf; lakjfd;askf jal;sdjf ;lasdjf;askjf;lka" oData.Rows.Add(NewRow) NewRow = oData.NewRow NewRow("UserNotificationSeqNum") = "3" NewRow("UserNotificationSubject") = "Web Entry Stuff" NewRow("UserNotificationMessage") = "The following document has been entered through the UI" oData.Rows.Add(NewRow) AlertsRotator.DataSource = oData AlertsRotator.DataBind() End SubEnd ClassCharts are bound to a class. 2 doubles and 1 date. The doubles are the y-axis series and the date is the x-axis
See the attached file for how it looks. LayoutMode is set to inside which moves the points but not the label.
Here is the code for the 1st chart:
<div class="chartleft"> <telerik:RadChart ID="RadChart1" runat="server" DefaultType="Line" ChartTitle-TextBlock-Text="Last 10 Updates" Width="525"> <PlotArea> <Appearance Dimensions-Margins="18%, 30%, 25%, 10%"> </Appearance> <EmptySeriesMessage Visible="True"> <Appearance Visible="True"> </Appearance> </EmptySeriesMessage> <YAxis IsZeroBased="false"> </YAxis> <XAxis LayoutMode="Inside" AutoScale="false" LabelStep="1" DataLabelsColumn="date" > <Appearance ValueFormat="ShortDate" MajorGridLines-Visible="false" > <LabelAppearance RotationAngle="45" Position-AlignedPosition="Top"> </LabelAppearance> </Appearance> </XAxis> </PlotArea> <Series> <telerik:ChartSeries DataYColumn="realvalues" Name="Real Values" Type="Line"> </telerik:ChartSeries> <telerik:ChartSeries DataYColumn="othervalues" Name="Trending Values" Type="Line"> </telerik:ChartSeries> </Series> </telerik:RadChart> </div>here is the class it is bound to:
public class chartdata { public double realvalues { get; set; } public double othervalues { get; set; } public double date { get; set; } public chartdata(double r, double o, DateTime dt) { date = dt.ToOADate(); realvalues = r; othervalues = o; } }
| protected void XmlHttpPanel_ServiceRequest(object sender, RadXmlHttpPanelEventArgs e) |
| { |
| string val = e.Value; |
| DataSet ds = db.dbRead("Select * from Doctors where Id=" + val + ""); |
| TextBox1.Attributes.Add("Value", ds.Tables[0].Rows[0]["Header"].ToString()); |
| TextBox1.Text = ds.Tables[0].Rows[0]["Header"].ToString(); |
| TextBox2.Text = ds.Tables[0].Rows[0]["ShortDescription"].ToString(); |
| TextBox3.Text = val; |
| } |
| protected void XmlHttpPanel_ServiceRequest2(object sender, RadXmlHttpPanelEventArgs e) |
| { |
| //Random numbers = new Random(); |
| //int index = numbers.Next(1, 10); |
| int i = db.dbWrite("update doctors set Header='" + TextBox1.Text + "',ShortDescription='" + TextBox1.Text + "' where Id=" + TextBox1.Text + ""); |
| RadGrid1.DataSource = LoadData(); |
| RadGrid1.CurrentPageIndex = 0; |
| RadGrid1.DataBind(); |
| } |
JS COde function rowSelected(sender, args) { |
| var key = args.getDataKeyValue("Id"); |
| var panel = $find("<%=RadXmlHttpPanel1.ClientID %>"); |
| panel.set_value(key); |
| } |
| function UpdateGrid() { |
| var panel = $find("<%=RadXmlHttpPanel2.ClientID %>"); |
| panel.set_value("any value"); |
| } |
| HTML CODE <telerik:RadXmlHttpPanel ID="RadXmlHttpPanel1" runat="server" OnServiceRequest="XmlHttpPanel_ServiceRequest" |
| RenderMode="Block"> |
| <asp:Button ID="Button1" runat="server" Text="Update Record and Grid " OnClientClick="UpdateGrid();return false;" /> |
| <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> |
| <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox> |
| <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox> |
| </telerik:RadXmlHttpPanel> |
| <telerik:RadXmlHttpPanel ID="RadXmlHttpPanel2" runat="server" EnableClientScriptEvaluation="true" OnServiceRequest="XmlHttpPanel_ServiceRequest2" |
| RenderMode="Block"> |
| <telerik:RadGrid ID="RadGrid1" Skin="Hay" OnNeedDataSource="RadGrid1_NeedDataSource" |
| Width="370px" AllowSorting="True" PageSize="10" AllowPaging="True" runat="server" |
| AutoGenerateColumns="false" GridLines="None"> |
| <MasterTableView ClientDataKeyNames="Id" Width="100%" > |
| <Columns> |
| <telerik:GridBoundColumn DataField="Id" Visible="false"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn HeaderText="Name" DataField="Header" UniqueName="Header" > |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn HeaderText="Address" DataField="ShortDescription" UniqueName="ShortDescription"> |
| </telerik:GridBoundColumn> |
| </Columns> |
| </MasterTableView> |
| <PagerStyle Mode="NumericPages" PageButtonCount="5" /> |
| <ClientSettings EnableRowHoverStyle="true" Selecting-AllowRowSelect="true" ClientEvents-OnRowSelected="rowSelected"> |
| </ClientSettings> |
| </telerik:RadGrid> |
| </telerik:RadXmlHttpPanel> |
<telerik:RadGrid ID="ColumnRadGrid" runat="server"
AllowAutomaticUpdates="True"
AllowFilteringByColumn="false"
AllowMultiRowSelection="true"
AllowSorting="false"
AutoGenerateColumns="false"
ClientSettings-AllowColumnsReorder="false"
Height="100%"
OnItemCreated="ColumnRadGrid_ItemCreated"
OnItemDataBound="ColumnRadGrid_ItemDataBound"
OnItemUpdated="ColumnRadGrid_ItemUpdated"
OnNeedDataSource="ColumnRadGrid_NeedDataSource"
ShowHeader="true"
TabIndex="6"
Visible="True"
Width="100%">
<ClientSettings AllowKeyboardNavigation="true" EnableRowHoverStyle="false" >
<Selecting AllowRowSelect="True" />
<ClientEvents OnRowDblClick="ColumnRowDblClick" OnRowClick="ColumnRowClick"
OnGridCreated="GridCreated" OnCommand="GridCommand" />
<Scrolling AllowScroll="True" UseStaticHeaders="True" />
</ClientSettings>
<MasterTableView BorderWidth="1" EditMode="InPlace" GridLines="Vertical" TableLayout="Fixed" Height="100%" Width="100%">
<Columns>
<telerik:GridTemplateColumn
HeaderText="Data Field"
ItemStyle-Wrap="False"
UniqueName="columnName" >
<ItemTemplate>
<asp:Label ID="ColumnRadGridNameLabel" runat="server" Text='<%#Eval("ColumnName") %>' ClientIDMode="Static">
</asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn
HeaderText="Column Alias"
ItemStyle-Wrap="False"
UniqueName="columnAlias" >
<ItemTemplate>
<asp:Label ID="ColumnRadGridAliasLabel" runat="server" Text='<%#Eval("Alias") %>' ClientIDMode="Static">
</asp:Label>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadTextBox ID="ColumnRadGridAliasTextBox" runat="server"
ClientIDMode="Static"
Text='<%#Bind("Alias") %>'
Width="140px" >
</telerik:RadTextBox>
</EditItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn
HeaderStyle-Width="100px"
HeaderText="Show Option"
ItemStyle-Width="100px"
ItemStyle-Wrap="False"
UniqueName="showOption" >
<ItemTemplate>
<asp:Label ID="ColumnRadGridShowLabel" runat="server" Text='<%#Eval("ShowText") %>' ClientIDMode="Static">
</asp:Label>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadComboBox ID="ColumnRadGridShowComboBox" runat="server" ClientIDMode="Static" Width="90px">
</telerik:RadComboBox>
</EditItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn
HeaderStyle-Width="130px"
HeaderText="Sort Option"
ItemStyle-Width="130px"
ItemStyle-Wrap="False"
UniqueName="sortOption" >
<ItemTemplate>
<asp:Label ID="ColumnRadGridSortLabel" runat="server" Text='<%#Eval("SortText") %>' ClientIDMode="Static">
</asp:Label>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadComboBox ID="ColumnRadGridSortComboBox" runat="server" ClientIDMode="Static" Width="120px">
</telerik:RadComboBox>
</EditItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn
HeaderStyle-Width="135px"
HeaderText="Sort Order"
ItemStyle-Width="135px"
ItemStyle-Wrap="False"
UniqueName="sortOrder" >
<ItemTemplate>
<asp:Label ID="ColumnRadGridSortOrderLabel" runat="server" Text='<%#Eval("SortOrderText") %>' ClientIDMode="Static">
</asp:Label>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadNumericTextBox ID="ColumnRadGridSortOrderNumericTextBox" runat="server"
ClientIDMode="Static" Width="100px" MinValue="1" MaxValue="1" ShowSpinButtons="True" NumberFormat-DecimalDigits="0" Value="1">
</telerik:RadNumericTextBox>
</EditItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
I have both
ColumnRowDblClick AND ColumnRowClick functions
defined in a js file, but now ONLY the ColumnRowClick event gets fired
when I double-click a row. I can tell this because I have set breaks in both functions
and only one break-point is getting hit.
I have confirmed that MY code still behaves as I had hoped on another developer's machine.
He HASN'T upgraded yet.
Help!!!!!