Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
265 views
I want to create a masked number input format like "#####:##"
The first ##### part present the number of hours, and the later "##" part represent the number of mins

The database stores the field in turns of minutes. What I am doing is to calculate the number of hours and place it in the first part, and so as the mins. 

I found the masked text box will always place the hour strin on the left of "#####", i.e. Say I have 230 hours and 14 mins, the textbox display it like this:      "230__:14". 

What I am expecting is : "__230:14", could you suggest what setting is missing?

Thanks,
Michael


Radoslav
Telerik team
 answered on 16 Jun 2010
3 answers
280 views
hello,

I need to disable AJAX on RadGrid's one command for file download purpose and so I, first, made use of client settings and there used onCommand client side where I make AJAX disabled which works fine at its part
So the flow goes first at client side and first enables/disables AJAX and then goes server side on ItemCommand event where I can not access e.Item's values and even data key value

Please refer to my code snippet for server side event-ItemCommand:

GridEditableItem editedItem = e.Item as GridEditableItem; 
Hashtable newValues = new Hashtable(); 
editedItem.ExtractValues(newValues); 
Yavor
Telerik team
 answered on 16 Jun 2010
0 answers
59 views
Hey all,

I have a table in my db with some null values, when I execute a function on this table like for example insert values to it I leave the null value column with no value ( I don't insert anything in it) , it places value 0 in it but i want it to be null. what to do?
hamda
Top achievements
Rank 1
 asked on 16 Jun 2010
1 answer
156 views
Hi,

   We have a bunch of splitters inside a form on a page. The height of the form is initially set to 100%. We have some JScript that changes the height of the form to 89% but when this executes, nothing happens until you resize the browser window and the Telerik magic kicks in and resizes all the panes.

   Want I think I need to do is manually call the functions that do this resizing after I set the new height of 89%. Can someone tell me how to do this i.e. what the function/functions are called?

Kind Regards
ADe
Svetlina Anati
Telerik team
 answered on 16 Jun 2010
1 answer
189 views
Hello,

Much like most SharePoint admins out there, we'll be upgrading out SharePoint environment to 2010 in the near future.  We have widely used the RAD Editor Lite webpart in our 2007 farm and from what I can see, there is no version for 2010.  So depending on the possible answers to this question, if there is no 2010 version, what are my other options?  If removal is necessary, how can I remove RAD Editor Lite from my 2010 test farm so I don't see this error all over the place...

Could not load file or assembly 'RadEditorSharePoint, Version=4.5.6.0, Culture=neutral, PublicKeyToken=1f131a624888eeed' or one of its dependencies. The system cannot find the file specified.

Thanks

Stanimir
Telerik team
 answered on 16 Jun 2010
1 answer
105 views
Let me show a simple code below.


.aspx

<telerik:RadChart ID="RadChart3" runat="server" Width="1000" />


.aspx.cs

protected void Page_Load(object sender, EventArgs e)
    {

        DataTable chartdata = new DataTable();
        chartdata.Columns.Add("date", typeof(DateTime));
        chartdata.Columns.Add("value", typeof(double));

        
        List<string> dates = new List<string>();
        dates.Add("2010-06-01 02:44:35.753");
        dates.Add("2010-06-01 02:45:54.753");
        dates.Add("2010-06-01 02:47:13.543");
        dates.Add("2010-06-01 02:48:32.600");
        dates.Add("2010-06-01 02:49:51.730");
        dates.Add("2010-06-01 02:51:10.640");

        List<double> values = new List<double>();
        values.Add(120);
        values.Add(130);
        values.Add(140);
        values.Add(150);
        values.Add(160);
        values.Add(170);

        int k = 0;

        foreach (string strdate in dates)
        {
            DataRow cdr = chartdata.NewRow();
            cdr[0] = DateTime.Parse(strdate);
            cdr[1] = values[k];

            chartdata.Rows.Add(cdr);

            k++;           
        }

        ChartSeries series = RadChart3.CreateSeries("value", Color.DarkBlue, Color.Empty, ChartSeriesType.Bar);
            
        foreach (DataRowView drv in chartdata.DefaultView)
        {
            ChartSeriesItem item = new ChartSeriesItem();
            item.XValue = DateTime.Parse(drv["date"].ToString()).ToOADate();
            item.YValue = Math.Round(double.Parse(drv["value"].ToString()), 1);

            series.Items.Add(item);
        }

        RadChart3.AutoLayout = true;

        RadChart3.Series.Add(series);
        RadChart3.Appearance.BarWidthPercent = 1;

        RadChart3.PlotArea.XAxis.AutoScale = false;
        RadChart3.PlotArea.XAxis.Appearance.ValueFormat = Telerik.Charting.Styles.ChartValueFormat.ShortTime;
        RadChart3.PlotArea.XAxis.AddRange(DateTime.Parse("2010-06-01 02:42:00").ToOADate(), DateTime.Parse("2010-06-01 02:52:00").ToOADate(), (double)1 / 1440);

        RadChart3.PlotArea.YAxis.AutoScale = true;

}





And the chart is expected to show six bars.

Actually, however, the chart shows only 2 bars, because they are overlapped.

How can I solve this problem?


Thank you.

-Alex.



Ves
Telerik team
 answered on 16 Jun 2010
1 answer
110 views
Hi,
I am using RadGrid which contains Nested View Tamplate, inside the template I have a user control.
My problem is that I can't figure out how pass parameters from the template to the user control.

I tried this:
<NestedViewSettings DataSourceID="SqlDataSource2"> 
                    <ParentTableRelation> 
                       <telerik:GridRelationFields DetailKeyField="ID" MasterKeyField="ID" /> 
                    </ParentTableRelation> 
                </NestedViewSettings> 
                <NestedViewTemplate> 
                    <asp:Label ID="Label3" runat="server" Text='<%#Bind("ID") %>' ></asp:Label> 
                    <asp:Label ID="Label1" runat="server" Text='<%#Bind("source") %>' ></asp:Label> 
                    <ap:activityPanel source='<%#Bind("source") %>' jobId="123" ID="activityPanel" runat="server" Visible="true" /> 
</NestedViewTemplate> 

Both Labels holds the correct text, but the public variable "source" inside the "activityPanel" user control remains null.

How can I resolve this?
Thanks


Avi
Top achievements
Rank 1
 answered on 16 Jun 2010
4 answers
154 views
I've got Q1 2010 installed on my machine and have noticed that the VS Extensions aren't there.

I'm pretty sure they're supposed to install with the main product. That's right isn't it? 

How do I get them to install now?

-- 
Stuart

Stuart Hemming
Top achievements
Rank 2
 answered on 16 Jun 2010
1 answer
83 views
I have a radmenu, with multi column switched on.

If one of the items in the left hand column has children, then they render UNDER the items in the right hand column.

This has only been observed in IE, all other browsers (including on the mac) have rendered just fine.

you can download an AVI of the problem at:

https://www.yousendit.com/download/YWhOSXR4ZEtubVh2Wmc9PQ

Thanks!


Kamen Bundev
Telerik team
 answered on 16 Jun 2010
1 answer
174 views
i am working on a example based on "Card View" demo http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/cardview/defaultcs.aspx i am able to have it work just how i want it to, however i am having  strange problems with the sorting functionality, not sure what i am missing
i have attached code and screenshot, i have listed the problem in 2 points belows

(1) The sort is not working altogether, i am able to click on the heading, its seems to refresh and adds a downward arrow (sort desc), but i don't see the records rearranged, i click on it again, it seems to refresh, but the downward arrow stays (does'nt change to upward arrow)

(2) if i am clicking on column 1, its highlighting(i have added sorted back color property to test this) and trying to sort column 2 with a desc arrow, this seems to be the norm for other columns too, ie if i click on column 5, its trying to sort column 6, when i click on column 1 for the second time it seems to be trying to sort column 1(but, point (1) above happens)

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ClassWorkShopGrid.ascx.cs" Inherits="CMSWebParts_Grafica_ClassWorkShopGrid" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<!-- content start --> 
<style type="text/css">  
    .RadGrid .rgRow TD  
    {  
        padding:0px !important;  
    }  
    .RadGrid .rgAltRow TD  
    {  
        padding:0px !important;  
        background-color:White;   
    }      
    .GridHeader  
    {  
        font-weight:bold;  
        color:#426594 !important;  
        text-transform:uppercase;  
        font-size:11px !important;   
    }  
    .BlueHeadings  
    {  
        color:#426594 !important;  
        text-transform:uppercase;    
        font-size:11px !important;        
        font-weight:bold;  
    }  
    .GridHeader a  
    {  
        font-weight:bold;  
        color:#426594 !important;  
        text-transform:uppercase;  
        font-size:11px !important;          
    }  
</style>     
<br/> 
<br/> 
<telerik:RadCodeBlock runat="server" ID="radCodeBlock">  
    <script type="text/javascript">  
        function showFilterItem() {  
            $find('<%=RadGrid1.ClientID %>').get_masterTableView().showFilterItem();  
        }  
        function hideFilterItem() {  
            $find('<%=RadGrid1.ClientID %>').get_masterTableView().hideFilterItem();  
        }   
    </script> 
</telerik:RadCodeBlock> 
<div> 
    <div style="float:left;" class="BlueHeadings">  
        Sort Classes by:  
    </div> 
    <div style="float:right;padding-right:15px;"  class="BlueHeadings">  
        Show filtering item <input id="Radio1" type="radio" runat="server" name="showHideGroup" checked="true" onclick="showFilterItem()" /><label for="Radio1">Yes</label>   
        <input id="Radio2" type="radio" runat="server" name="showHideGroup" onclick="hideFilterItem()"/><label for="Radio2" >No</label> 
    </div> 
    <div style="clear:both;"></div> 
</div> 
<telerik:RadGrid ID="RadGrid1"  AllowPaging="True" runat="server" AllowSorting="True" Skin="WebBlue" OnNeedDataSource="RadGrid1_NeedDataSource" 
    AllowFilteringByColumn="true" AutoGenerateColumns="false" ShowStatusBar="True">  
    <PagerStyle Mode="NextPrevAndNumeric" Wrap="True" AlwaysVisible="true"></PagerStyle> 
    <MasterTableView AllowMultiColumnSorting="false" TableLayout="Fixed" AllowNaturalSort="false" > 
        <Columns> 
            <telerik:GridBoundColumn UniqueName="CourseTitle" HeaderText="Course Title" DataField="CourseTitle"  SortExpression="CourseTitle" AllowFiltering="false" HeaderStyle-CssClass="GridHeader"   
                HeaderStyle-Width="60px" ItemStyle-Width="60px"/>  
            <telerik:GridBoundColumn UniqueName="CategoryName" HeaderText="Category" DataField="CategoryName"  SortExpression="CategoryName" AllowFiltering="true" HeaderStyle-CssClass="GridHeader"   
                HeaderStyle-Width="80px" ItemStyle-Width="80px" > 
                 <FilterTemplate> 
                        <telerik:RadComboBox ID="RadComboBoxCategoryName" DataSourceID="SqlDataSource2" DataTextField="CategoryName" Skin="WebBlue"   
                            DataValueField="CategoryName" AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("CategoryName").CurrentFilterValue %>' 
                            runat="server" OnClientSelectedIndexChanged="CategoryIndexChanged" Width="95px">  
                            <Items> 
                                <telerik:RadComboBoxItem Text="All" /> 
                            </Items> 
                        </telerik:RadComboBox> 
                        <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">  
                            <script type="text/javascript">  
                                function CategoryIndexChanged(sender, args) {  
                                    var tableView=$find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");  
                                    tableView.filter("CategoryName", args.get_item().get_value(), "EqualTo");  
                                }  
                            </script> 
 
                        </telerik:RadScriptBlock> 
                 </FilterTemplate> 
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn UniqueName="ClassLevel" HeaderText="Course Level" DataField="ClassLevel"  SortExpression="ClassLevel" AllowFiltering="True" HeaderStyle-CssClass="GridHeader"   
                HeaderStyle-Width="60px" ItemStyle-Width="60px" > 
                 <FilterTemplate> 
                        <telerik:RadComboBox ID="RadComboBoxClassLevel" DataSourceID="SqlDataSource3" DataTextField="ClassLevel" Skin="WebBlue" 
                            DataValueField="ClassLevel" AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("ClassLevel").CurrentFilterValue %>' 
                            runat="server" OnClientSelectedIndexChanged="ClassLevelIndexChanged" Width="70px">  
                            <Items> 
                                <telerik:RadComboBoxItem Text="All" /> 
                            </Items> 
                        </telerik:RadComboBox> 
                        <telerik:RadScriptBlock ID="RadScriptBlock2" runat="server">  
                            <script type="text/javascript">  
                                function ClassLevelIndexChanged(sender, args) {  
                                    var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");  
                                    tableView.filter("ClassLevel", args.get_item().get_value(), "EqualTo");  
                                }  
                            </script> 
                        </telerik:RadScriptBlock> 
                 </FilterTemplate>              
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn UniqueName="FacultyName" HeaderText="Instructor" DataField="FacultyName"  SortExpression="FacultyName" AllowFiltering="true" HeaderStyle-CssClass="GridHeader"   
                  HeaderStyle-Width="70px" ItemStyle-Width="70px">  
                 <FilterTemplate> 
                        <telerik:RadComboBox ID="RadComboBoxFacultyName" DataSourceID="SqlDataSource4" DataTextField="FacultyName" Skin="WebBlue" 
                            DataValueField="FacultyName" AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("FacultyName").CurrentFilterValue %>' 
                            runat="server" OnClientSelectedIndexChanged="FacultyNameIndexChanged" Width="90px">  
                            <Items> 
                                <telerik:RadComboBoxItem Text="All" /> 
                            </Items> 
                        </telerik:RadComboBox> 
                        <telerik:RadScriptBlock ID="RadScriptBlock3" runat="server">  
                            <script type="text/javascript">  
                                function FacultyNameIndexChanged(sender, args) {  
                                    var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");  
                                    tableView.filter("FacultyName", args.get_item().get_value(), "EqualTo");  
                                }  
                            </script> 
                        </telerik:RadScriptBlock> 
                 </FilterTemplate>              
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn UniqueName="StudioSchoolType" HeaderText="Class / Workshop" DataField="StudioSchoolType"  SortExpression="StudioSchoolType" AllowFiltering="true" HeaderStyle-CssClass="GridHeader"   
                HeaderStyle-Width="60px" ItemStyle-Width="60px">  
                 <FilterTemplate> 
                        <telerik:RadComboBox ID="RadComboBoxStudioSchoolType" Skin="WebBlue" 
                            SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("StudioSchoolType").CurrentFilterValue %>' 
                            runat="server" OnClientSelectedIndexChanged="StudioSchoolTypeIndexChanged" Width="70px">  
                            <Items> 
                                <telerik:RadComboBoxItem Text="All" Value="All"  /> 
                                <telerik:RadComboBoxItem Text="Class" Value="Class" /> 
                                <telerik:RadComboBoxItem Text="Workshop" Value="Workshop" /> 
                            </Items> 
                        </telerik:RadComboBox> 
                        <telerik:RadScriptBlock ID="RadScriptBlock4" runat="server">  
                            <script type="text/javascript">  
                                function StudioSchoolTypeIndexChanged(sender, args) {  
                                    var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");  
                                    tableView.filter("StudioSchoolType", args.get_item().get_value(), "EqualTo");  
                                }  
                            </script> 
                        </telerik:RadScriptBlock> 
                 </FilterTemplate>              
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn UniqueName="ScheduleDays" HeaderText="Day(s)" DataField="ScheduleDays"  SortExpression="ScheduleDays" AllowFiltering="true" HeaderStyle-Width="80px" HeaderStyle-CssClass="GridHeader"   
             ItemStyle-Width="80px" FilterControlWidth="95px" CurrentFilterFunction="Contains" FilterListOptions="VaryByDataType" ShowFilterIcon="false" AutoPostBackOnFilter="true" />                 
            <telerik:GridTemplateColumn UniqueName="Price" HeaderText="Price" DataField="Price"  SortExpression="Price" AllowFiltering="false" HeaderStyle-Width="60px" ItemStyle-Width="80px" HeaderStyle-CssClass="GridHeader" > 
                <ItemTemplate> 
                    <span>$<%# Eval("Price").ToString()%></span>  
                </ItemTemplate>              
            </telerik:GridTemplateColumn> 
            <telerik:GridTemplateColumn UniqueName="Add" HeaderText="Add" AllowFiltering="false" HeaderStyle-Width="35px" ItemStyle-Width="35px" HeaderStyle-CssClass="GridHeader" SortExpression="Price" > 
                <ItemTemplate> 
                </ItemTemplate>              
            </telerik:GridTemplateColumn>                 
        </Columns> 
        <ItemTemplate> 
            <div style="width:100%;padding:0px;margin:0px;padding-top:5px;" > 
                <span style="font-weight: bold; font-family: Arial Black;padding-left:5px;"><%# Eval("CourseTitle").ToString()%></span>  
                <hr style="width:100%;" /> 
                <div> 
                    <div style="float:left;width:90px;padding-left:5px;">Course #:<%# Eval("CourseCode").ToString()%></div>  
                    <div style="float:left;width:110px;"><%# Eval("CategoryName").ToString()%></div>  
                    <div style="float:left;width:90px;"><%# Eval("ClassLevel").ToString()%></div>  
                    <div style="float:left;width:110px;"><%# Eval("FacultyName").ToString()%></div>  
                    <div style="float:left;width:80px;"><%# Eval("StudioSchoolType").ToString()%></div>  
                    <div style="float:left;width:120px;"><%# Eval("ScheduleDays").ToString().Replace("|",", ")%></div>  
                    <div style="float:left;width:75px;">  
                        <span style="color:#e76d18;font-weight:bold;">Member:</span><br/>  
                        <span>$<%# (Convert.ToInt32(Eval("Price").ToString())-30).ToString()%></span><br/><br/>  
                        <span style="color:#e76d18;font-weight:bold;">Non Member:</span><br/>  
                        <span>$<%# Eval("Price").ToString()%></span><br/>                          
                    </div> 
                    <div style="float:left;width:40px">  
                        <a href="~/SpecialPages/Shoppingcart.aspx"><img src="~/app_themes/njvac/images/cart.gif" border="0" title="add to cart" /></a><br/><br/><br/> 
                        <a href="~/SpecialPages/Shoppingcart.aspx"><img src="~/app_themes/njvac/images/cart.gif" border="0" title="add to cart" /></a>  
                    </div> 
                    <div style="clear:both;"></div>    
                </div> 
                <div> 
                    <span style="font-weight: bold;background-color:#bdc3ce;padding:5px;color:White;">Course Information</span><br/>  
                </div> 
                <div style="background-color:#f7f3f7;padding:15px;">  
                    <span style="font-weight:bold;"><%# Eval("Duration").ToString()%> week(s) course</span>&nbsp;&nbsp;  
                    <span style="font-weight:bold;">Class Held:&nbsp;</span><%# Convert.ToDateTime(Eval("StartDate").ToString()).ToShortDateString()%> - <%# Convert.ToDateTime(Eval("EndDate").ToString()).ToShortDateString()%> 
                    <span style="font-weight:bold;">Season:&nbsp;</span><%# Eval("SeasonName").ToString()%> - <%# Eval("Year").ToString()%>&nbsp;&nbsp;  
                    <span style="font-weight:bold;">No class on:&nbsp;</span><%# Eval("NoClassOn").ToString()%>&nbsp;&nbsp;<br/> 
                    <%# Eval("Description").ToString()%><br/>  
                    <span style="color:red"><%# Eval("ClassFullMessage").ToString()%></span>  
                </div> 
            </div> 
        </ItemTemplate> 
    </MasterTableView> 
    <ClientSettings> 
        <Scrolling UseStaticHeaders="true" /> 
    </ClientSettings> 
</telerik:RadGrid> 
<asp:SqlDataSource ID="SqlDataSource2" ConnectionString="<%$ ConnectionStrings:CMSConnectionString %>" 
    ProviderName="System.Data.SqlClient" SelectCommand="select CategoryName from customtable_class_categories" 
    runat="server"></asp:SqlDataSource> 
<asp:SqlDataSource ID="SqlDataSource3" ConnectionString="<%$ ConnectionStrings:CMSConnectionString %>" 
    ProviderName="System.Data.SqlClient" SelectCommand="select ClassLevel from customtable_class_level" 
    runat="server"></asp:SqlDataSource> 
<asp:SqlDataSource ID="SqlDataSource4" ConnectionString="<%$ ConnectionStrings:CMSConnectionString %>" 
    ProviderName="System.Data.SqlClient" SelectCommand="select fullname as 'FacultyName' from customtable_faculty" 
    runat="server"></asp:SqlDataSource> 
 
using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Web;  
using System.Web.UI;  
using System.Web.UI.WebControls;  
using CMS.PortalControls;  
using Telerik.Web.UI;  
using Grafica.Helper;  
 
public partial class CMSWebParts_Grafica_ClassWorkShopGrid : CMSAbstractWebPart  
{  
    protected void Page_Load(object sender, EventArgs e)  
    {  
    }  
    protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)  
    {  
        this.RadGrid1.DataSource = Course.GetAllCourses();  
    }  
} 


Veli
Telerik team
 answered on 16 Jun 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?