Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
106 views
Dear Telerik Team,

How I can define default colors for lineseries??


Thanks,
Aewin.
Peshito
Telerik team
 answered on 10 Oct 2011
5 answers
152 views
Hi,

I have a very basic chart with Dates on the X axis and percentages on the Y axis. I have the scale set to Auto like this:

 

 

 

 

<YAxis AutoScale="True" IsZeroBased="false">

The chart renders with % values of -5000% to +5000%. Ok, so I understand there is no delta between the min and max so the autoscale doesn't have anything to work with. So I attempted to manually set the scale IF all the values are equal. I did this in the PreRender event. But now, the chart does indeed have the proper manually set min scale %, but the max scale % is not visible. Ideas ?

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
Thank you !
Paul

Evgenia
Telerik team
 answered on 10 Oct 2011
1 answer
137 views
I apologize in advance if maybe I'm just missing something obvious, but can't figure this out.  I have a rotator which I want to display only one item at a time, but it seems that when it slides to the next item, it is not lined up correctly and sometimes displays the content of two items at once.  I've attached an image as an example, and the code is below.  How can I make sure it only displays one item, similar to the rotator under the Twitter demo of the Notification control?  Thank you in advance.

<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 Sub
 
End Class
Slav
Telerik team
 answered on 10 Oct 2011
1 answer
186 views
how can i load radtreeview in radcombobox with lazyload data binding???
and just end node clickable in treeview.
please help me
Shinu
Top achievements
Rank 2
 answered on 10 Oct 2011
7 answers
107 views
Greetings,

i use a RadGrid with insert/edit/delete functionalities.
I would like to be sure the user fills all the fields when he tries to insert a new row / update a row

how can i manage to do this ?
thank you in advance!
Adigard
Top achievements
Rank 1
 answered on 10 Oct 2011
3 answers
142 views

Charts 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;
      }
   }


 

 

 

 



Evgenia
Telerik team
 answered on 10 Oct 2011
1 answer
120 views
hi
 this is satya  the following is my requirement please help me
i  have  radgrid in my page
in that  radgrid one column is editable column for this i use  radgrid item templet
under the radgrid  one  button
 first i edit some rows in the  grid and click the  button 
then the changes  are saved in  database
Shinu
Top achievements
Rank 2
 answered on 10 Oct 2011
2 answers
94 views
Hi guys

I am working on slider ,
can you please let me know whether we can have two or more color in the slider
for example


|-----------|-----------------|--------------|          (Slider)
<--red--><--green----><--yellow-->
Slav
Telerik team
 answered on 10 Oct 2011
2 answers
165 views
I couldnt get TextBox value Which is placed inside of the XmlHttpPanel.Why I lost value?
There are no TextBox values XmlHttpPanel_ServiceRequest2 event,Values also set  XmlHttpPanel_ServiceRequest
event.Just I can take values with js and panel.set_value but When I have a many TextBoxes this is problem.

C Sharp Code




   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> 
piotre6
Top achievements
Rank 1
 answered on 10 Oct 2011
1 answer
139 views
Hi

We have just upgraded to the latest, licensed copy of your product and some previously working client side code  is no longer getting executed.

Here is my RadGrid definition:

 

 

<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!!!!!

 

Mira
Telerik team
 answered on 10 Oct 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?