Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
392 views
Hi,

I am trying to change the border and background DateInput control. I would like to change the border to red with yellow background, and the triangle with ! in middle if possible or something to that affect. I tried a Custom Validator but with no luck. I would settle for a red border around the Data Input text box.

I have tried every which way; but to no success..Can this be done? If so, any suggestions?

Thanks in advance,
Gary
telerik:RadDatePicker ID="datepicker" runat="server"  ClientEvents-OnDateSelected="DateValidator"
        MaxDate="2100-12-31" MinDate="1900-01-01"
        Culture="English (United States)" SelectedDate="2011-03-01" >
 
    <Calendar runat="server" UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x" FastNavigationStep="12" ></Calendar>
    <DatePopupButton ImageUrl="" HoverImageUrl="" CssClass=""></DatePopupButton>
 
    <DateInput ID="DI" runat="server" CausesValidation="true" DisplayDateFormat="M/d/yyyy" DateFormat="M/d/yyyy"
        LabelCssClass="" Width="" SelectedDate="2011-03-01"  
        <ClientEvents OnValueChanged="ValueChanged"/>
     </DateInput>
 
  </telerik:RadDatePicker>
</form>
</body>
</html>
 
<telerik:RadScriptBlock  ID="SOSRadScriptBlock" runat="server">
    <script type='text/javascript'>
 
        function ValueChanged(sender, args) {
  
            var dtv = $find(sender.controltovalidate).get_dateInput();
            var temp = args.Value.trim();
            if (temp != " " && !!temp) {
                args.IsValid = true;             
            } else {
                //date input value is either null or has a space
                dtv._invalid = true;
                  
                 //Below is the last approach I tried to change the style
                dtv.get_styles().InvalidStyle[0] += "background-color: lemonchiffon;";
                dtv.updateCssClass();
                args.IsValid = false;
 
            }
    </script>
</telerik:RadScriptBlock>
Maria Ilieva
Telerik team
 answered on 09 Mar 2011
1 answer
153 views

Hi,

1) I want a header in which there will be one main heading and under it there can be sub headings, the main header will span across its multiple sub headings, user can sort the grid by clicking on the sub headings. Please refer to the "UI.jpg"

2) The requirement is like i will be needing the Radgrid as usercontrol, which we will bind on Page. when we run the page, the screen looks fine except for the Merged Columns where in we need the headings and the Subheadeing, refer "Screenshot1.JPG"

The second issue which we I am facing is, The rad grd will have horizontal scroll and first 3 columns would be frozed.
But when we try to freeze the columns we face the following issues:

a) When we scroll, the complete alignment of the grid gets messed up, and one Grid line remains there and shows up in the middle of all scrolling columns. Refer "Screenshot2.JPG" .

b) After we scroll, the horizontal scroll itself disappears. Refer "Screenshot3.JPG" .

c) If we change the page size in pagination, the pagination also disappears. Refer "Screenshot4.JPG" .

Please refer to the code as well, We have created a user control "uclFleet.ascx" which we register in our page "Test_Fleet.aspx".

Please reply on an urgent basis.

Thanks.

<!--User control .ascx file-->
    
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="uclFleet.ascx.cs" Inherits="UserControls_uclFleet" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
    
    
<telerik:RadScriptManager runat="server" ID="RadScriptManager1" /> 
<script type="text/javascript"
    function fnGridCreated(sender, args) { 
           
        var scrollArea = sender.GridDataDiv; 
        var dataHeight = sender.get_masterTableView().get_element().clientHeight; 
        if (dataHeight < 350) { 
            scrollArea.style.height = dataHeight + 10 + "px"; 
        
    
</script> 
       
                <telerik:RadGrid ID="tlrkDgrFleet" runat="server" EnableViewState="true" CellPadding="0"
                    CellSpacing="0" GridLines="Both" Width="750px"
                    Skin="Office2007" HeaderStyle-Font-Size="8pt" 
                    HeaderStyle-Font-Bold="true" AllowPaging="true" ShowHeader="true" OnNeedDataSource="tlrkDgrFleet_NeedDataSource" OnItemDataBound="tlrkDgrFleet_OnItemDataBound"
                        
                    <MasterTableView CellPadding="0" CellSpacing="0" Width="99%" TableLayout="Fixed" ShowHeader="true" AutoGenerateColumns="false"
                        AllowPaging="true" ShowFooter="false"
                            
                        <Columns
                            <telerik:GridTemplateColumn HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="50px"
                                UniqueName="SerialNo" ItemStyle-HorizontalAlign="Right"
                                <HeaderTemplate
                                    <table border="0" cellpadding="0" cellspacing="0" width="100%"
                                        <tr
                                            <td style="border: 0" rowspan="2"
                                                Serial 
                                                <br /> 
                                                No. 
                                            </td
                                        </tr
                                    </table
                                </HeaderTemplate
                                   
                                <ItemTemplate
                                    <asp:Label ID="lblSerialNo" runat="server"><%# Eval("A") %></asp:Label
                                </ItemTemplate
                            </telerik:GridTemplateColumn
                            <telerik:GridTemplateColumn HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="100px"
                                UniqueName="ColHeader" ItemStyle-HorizontalAlign="left"
                               <HeaderTemplate
                                    <table border="0" cellpadding="0" cellspacing="0" width="100%"
                                        <tr
                                            <td style="width:100%" colspan="2"
                                                Column header 
                                                <br /><hr /> 
                                            </td
                                        </tr
                                        <tr
                                            <td
                                                Sub Col A 
                                            </td
                                            <td
                                                Sub Col B 
                                            </td
                                        </tr>                                         
                                    </table
                                </HeaderTemplate
                                <ItemTemplate
                                 <table border="0" cellpadding="0" cellspacing="0"
                                            
                                        <tr
                                            <td
                                                <asp:Label ID="lblA" runat="server" ><%# Eval("B") %></asp:Label
                                            </td
                                            <td
                                                <asp:Label ID="lblE" runat="server"><%# Eval("C") %></asp:Label
                                            </td
                                        </tr>                                         
                                    </table
                                        
                                    
                                    
                                       
                                </ItemTemplate
                            </telerik:GridTemplateColumn
                           <telerik:GridTemplateColumn HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="100px"
                                UniqueName="Delivery" ItemStyle-HorizontalAlign="left"
                               <HeaderTemplate
                                    <table border="0" cellpadding="0" cellspacing="0" width="100%"
                                        <tr
                                            <td style="border: 1" colspan="2"
                                                Delivery<br /><hr /> 
                                            </td
                                        </tr
                                        <tr
                                            <td
                                                Owner 
                                            </td
                                            <td
                                                Operator 
                                            </td
                                        </tr>                                         
                                    </table
                                </HeaderTemplate
                                <ItemTemplate
                                    <asp:Label ID="lblOwn" runat="server"><%# Eval("D") %></asp:Label
                                </ItemTemplate
                                <ItemTemplate
                                    <asp:Label ID="lblOper" runat="server"><%# Eval("E") %></asp:Label
                                </ItemTemplate
                            </telerik:GridTemplateColumn
                                
                            <telerik:GridTemplateColumn HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="150px"
                                UniqueName="Current" ItemStyle-HorizontalAlign="left"
                               <HeaderTemplate
                                    <table border="0" cellpadding="0" cellspacing="0"
                                        <tr
                                            <td style="border:0" colspan="3"
                                                Current<br /><hr /> 
                                            </td
                                        </tr
                                        <tr
                                            <td
                                                Own 
                                            </td
                                            <td
                                                LEAST 
                                            </td
                                            <td
                                                SLE123 
                                            </td
                                        </tr>                                         
                                    </table
                                </HeaderTemplate
                                <ItemTemplate
                                   <table border="0" cellpadding="0" cellspacing="0"
                                           
                                        <tr
                                            <td
                                                <asp:Label ID="lblCurrOwn" runat="server"><%# Eval("F") %></asp:Label
                                            </td
                                            <td
                                                <asp:Label ID="lblCurrLE" runat="server"><%# Eval("G")%></asp:Label
                                            </td
                                            <td
                                                <asp:Label ID="lblCurrSLE" runat="server"><%# Eval("H") %></asp:Label
                                            </td
                                        </tr>                                         
                                    </table
                                        
                                </ItemTemplate>                                 
                                    
                            </telerik:GridTemplateColumn
                             <telerik:GridTemplateColumn HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="50px"
                                UniqueName="Future" ItemStyle-HorizontalAlign="left"
                                <HeaderTemplate
                                    <table border="0" cellpadding="0" cellspacing="0" width="100%"
                                        <tr
                                            <td style="border: 0" rowspan="2"
                                                Future 
                                                <br /> 
                                                Owner 
                                            </td
                                        </tr
                                    </table
                                </HeaderTemplate
                                <ItemTemplate
                                    <asp:Label ID="lblr" runat="server"><%# Eval("I") %></asp:Label
                                </ItemTemplate
                            </telerik:GridTemplateColumn
                            <telerik:GridTemplateColumn  HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="50px"
                                UniqueName="Bus" ItemStyle-HorizontalAlign="left"
                                <HeaderTemplate
                                    <table border="0" cellpadding="0" cellspacing="0" width="100%"
                                        <tr
                                            <td style="border: 0" rowspan="2"
                                                Bus 
                                                <br /> 
                                                Contract 
                                            </td
                                        </tr
                                    </table
                                </HeaderTemplate
                                <ItemTemplate
                                    <asp:Label ID="lblBusCon" runat="server"><%# Eval("J") %></asp:Label
                                </ItemTemplate
                            </telerik:GridTemplateColumn
                            <telerik:GridTemplateColumn  HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="50px"
                                UniqueName="Number" ItemStyle-HorizontalAlign="left"
                                <HeaderTemplate
                                    <table border="0" cellpadding="0" cellspacing="0" width="100%"
                                        <tr
                                            <td style="border: 0" rowspan="2"
                                                House 
                                                <br /> 
                                                Number 
                                            </td
                                        </tr
                                    </table
                                </HeaderTemplate
                                <ItemTemplate
                                    <asp:Label ID="lblNo" runat="server"><%# Eval("K") %></asp:Label
                                </ItemTemplate
                            </telerik:GridTemplateColumn
                            <telerik:GridTemplateColumn  HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="50px"
                                UniqueName="CurrentSet" ItemStyle-HorizontalAlign="left"
                                <HeaderTemplate
                                    <table border="0" cellpadding="0" cellspacing="0" width="100%"
                                        <tr
                                            <td style="border: 0" rowspan="2"
                                                Current 
                                                <br /> 
                                                Set. 
                                            </td
                                        </tr
                                    </table
                                </HeaderTemplate
                                <ItemTemplate
                                    <asp:Label ID="lblCurrentSet" runat="server"><%# Eval("L") %></asp:Label
                                </ItemTemplate
                            </telerik:GridTemplateColumn
                            <telerik:GridTemplateColumn  HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="50px"
                                UniqueName="LaneNo" ItemStyle-HorizontalAlign="left"
                                <HeaderTemplate
                                    <table border="0" cellpadding="0" cellspacing="0" width="100%"
                                        <tr
                                            <td style="border: 0" rowspan="2"
                                                Lane 
                                                <br /> 
                                                No. 
                                            </td
                                        </tr
                                    </table
                                </HeaderTemplate
                                <ItemTemplate
                                    <asp:Label ID="lblLaneNo" runat="server"><%# Eval("M") %></asp:Label
                                </ItemTemplate
                            </telerik:GridTemplateColumn
                            <telerik:GridTemplateColumn  HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="50px"
                                UniqueName="PurDate" ItemStyle-HorizontalAlign="center"
                                <HeaderTemplate
                                    <table border="0" cellpadding="0" cellspacing="0" width="100%"
                                        <tr
                                            <td style="border: 0" rowspan="2"
                                                Purchase 
                                                <br /> 
                                                Date 
                                            </td
                                        </tr
                                    </table
                                </HeaderTemplate
                                <ItemTemplate
                                    <asp:Label ID="lblDeliveryDate" runat="server"><%# Eval("N") %></asp:Label
                                </ItemTemplate
                            </telerik:GridTemplateColumn
                                
                        </Columns
                    </MasterTableView
                   <ClientSettings>   
        <Scrolling AllowScroll="true" FrozenColumnsCount= "3" UseStaticHeaders="true" SaveScrollPosition="true" />   
  <ClientEvents OnGridCreated="fnGridCreated" /> 
    </ClientSettings
    
                </telerik:RadGrid>
//User Control uclFleet.ascx.cs file 
    
using System; 
using System.Data; 
using System.Configuration; 
using System.Collections; 
using System.Web; 
using System.Web.Security; 
using System.Web.UI; 
using Telerik.Web.UI; 
using System.Text; 
    
public partial class UserControls_uclFleet : System.Web.UI.UserControl 
        
    protected void tlrkDgrFleet_NeedDataSource(object source, 
         Telerik.Web.UI.GridNeedDataSourceEventArgs e) 
    
        DataTable dt = new DataTable(); 
        dt.Columns.Add("A"); 
        dt.Columns.Add("B");      
        dt.Columns.Add("C"); 
        dt.Columns.Add("D"); 
        dt.Columns.Add("E"); 
        dt.Columns.Add("F"); 
        dt.Columns.Add("G"); 
        dt.Columns.Add("H"); 
        dt.Columns.Add("I"); 
        dt.Columns.Add("J"); 
        dt.Columns.Add("K"); 
        dt.Columns.Add("L"); 
        dt.Columns.Add("M"); 
        dt.Columns.Add("N"); 
        for (int i = 0; i < 10; i++) 
        
            DataRow dr; 
            dr = dt.NewRow(); 
            dr["A"] = "1234"; 
            dr["B"] = "ABCD - hjkl"; 
            dr["C"] = "123-90"; 
            dr["D"] = "13434"; 
            dr["E"] = "1545"; 
            dr["F"] = "1656"; 
            dr["G"] = "1453"; 
            dr["H"] = "15435"; 
            dr["I"] = "5341"; 
            dr["J"] = "1345"; 
            dr["K"] = "135"; 
            dr["L"] = "135"; 
            dr["M"] = "1345"; 
            dr["N"] = "11/07/2010"; 
    
            dt.Rows.Add(dr); 
            DataRow dr1; 
            dr1 = dt.NewRow(); 
            dr1["A"] = "1234"; 
            dr1["B"] = "AWER - POUT"; 
            dr1["C"] = "123-90"; 
            dr1["D"] = "13434"; 
            dr1["E"] = "1545"; 
            dr1["F"] = "1656"; 
            dr1["G"] = "ASD"; 
            dr1["H"] = "15435"; 
            dr1["I"] = "DSFSF"; 
            dr1["J"] = "1345"; 
            dr1["K"] = "135"; 
            dr1["L"] = "EWEWR"; 
            dr1["M"] = "1345"; 
            dr1["N"] = "11/07/2010"; 
    
            dt.Rows.Add(dr1); 
        
        tlrkDgrFleet.DataSource = dt; 
    
    
    protected void tlrkDgrFleet_OnItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) 
    
           
    
}
<!-- Test_Fleet.aspx-->
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Test_Fleet.aspx.cs" Inherits="Test_Fleet" %> 
<%@ Register Src="~/UserControls/uclFleet.ascx" TagName="uclFleet" TagPrefix="uc2" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
    
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    
<head runat="server"
    
    <title></title
</head
<body
    <form id="form1" runat="server"
      
<table style="table-layout:fixed" width="100%"><tr><td
    <uc2:uclFleet ID="uclFleet" runat="server" />  </td></tr
   </table
     
       
    </form
</body
</html>
Pavlina
Telerik team
 answered on 09 Mar 2011
1 answer
86 views
Hi,
       I have an MVC application with a view which has a Telerik TabStrip Control. The TabStrip has 3 tabs: the First tab contains three Telerik Grids, and the other two tabs one grid each.  All The values which are being bound to the grid are being validated in the Model. Each of the grids has Edit button present in each row. After editing the fields in the grid's row when insert/ save is clicked, the model validation is supposed to be fired stopping from executing the code in the controller. The problem is that validation works only for the first grid of the first tab and not for the remaining 4 grids in the View .  Below is the code

VIEW:
 <% Html.Telerik().TabStrip()
           .Name("captabletab")
           .Items(tabstrip =>
           {
               
               tabstrip.Add()
               .Text("Tab1")
                .Content(() =>
                {%>
                    <br />
                    <span class="..."></span>
                    <br />
                    <br />
                    <div>
                        <% Html.Telerik().Grid(Model.Class1)
                        .Name("Name1")

                        .ToolBar(commands => commands.Insert().ButtonType(GridButtonType.ImageAndText).ImageHtmlAttributes(new { style = "margin-left:0" }))
                        .DataKeys(keys => keys.Add(c => c.ID))
                        .DataBinding(binding => binding.Server()
                        .Select("...", "...")
                        .Insert("....", "CapTable", new { mode = GridEditMode.InLine, type = GridButtonType.ImageAndText })
                        .Update(".....", "CapTable", new { mode = GridEditMode.InLine, type = GridButtonType.ImageAndText })
                        .Delete("....", "CapTable", new { mode = GridEditMode.InLine, type = GridButtonType.ImageAndText })
                        )
                        .Columns(columns =>
                         {
                             columns.Bound(p => p.Col1).Width(250);
                             columns.Bound(p => p.Col2).Width(100);
                             columns.Bound(p => p.Col3).Width(100);
                             columns.Command(commands =>
                             {
                                 commands.Edit().ButtonType(GridButtonType.ImageAndText);
                                 commands.Delete().ButtonType(GridButtonType.ImageAndText);
                             }).HtmlAttributes(new { nowrap = "nowrap", style = "white-space:nowrap !important;" }).Width(300).Title("");
                         })
                         .HtmlAttributes(new { style = "overflow-x:auto;overflow-y:hidden" })
                         .Resizable(re => re.Columns(true))
                         .Scrollable()
                         .Editable(editing => editing.Mode(GridEditMode.InLine))
                         .Pageable().Render();
        
                        %>
                        <br />
                    </div>
                    <span class="....">....</span>
                    <br />
                    <br />
                    <div>
                        <% Html.Telerik().Grid(Model.Class2)
                        .Name("....")
                        
                        .DataKeys(keys => keys.Add(c => c.ID))
                        .DataBinding(binding => binding.Server()
                         .Select("...", "....")
                        .Update("...", "....", new { mode = GridEditMode.InLine, type = GridButtonType.ImageAndText })
                        )
                        .Columns(columns =>
                         {
                             columns.Bound(p => p.Col1).Width(250);
                             columns.Bound(p => p.Col2).Width(100);
                             columns.Bound(p => p.Col3).Width(100);
                             columns.Command(commands =>
                             {
                                 commands.Edit().ButtonType(GridButtonType.ImageAndText);
                             }).HtmlAttributes(new { nowrap = "nowrap", style = "width:350px !important;white-space:nowrap !important;" }).Width(300).Title("");
                         })
                         .HtmlAttributes(new { style = "overflow-x:auto;overflow-y:hidden" })
                         .Scrollable()
                         .Resizable(re => re.Columns(true))
                         .Editable(editing => editing.Mode(GridEditMode.InLine))
                        .Pageable()
                        .Render();
                        %>
                        <br />
                    </div>
                    <span class="...">...</span>
                    <br />
                    <br />
                    <div>
                        <% Html.Telerik().Grid(Model.Class3)
                        .Name("...")
                       
                        .DataKeys(keys => keys.Add(c => c.ID))
                        .DataBinding(binding => binding.Server()
                        .Select("..", "...")
                        .Update("....", ".....", new { mode = GridEditMode.InLine, type = GridButtonType.ImageAndText })
                        )
                        .Columns(columns =>
                         {
                             columns.Bound(p => p.Col1).Width(250);
                             columns.Bound(p => p.Col2).Width(100);
                             columns.Command(commands =>
                             {
                                 commands.Edit().ButtonType(GridButtonType.ImageAndText);
                             }).HtmlAttributes(new { nowrap = "nowrap", style = "width:350px !important;white-space:nowrap !important;" }).Width(300).Title("");
                         })
                         .HtmlAttributes(new { style = "overflow-x:auto;overflow-y:hidden" })
                         .Scrollable()
                         .Editable(editing => editing.Mode(GridEditMode.InLine))
                        .Pageable()
                           .Resizable(re => re.Columns(true))
                        .Render();
                        %>
                        <br />
                    </div>
                    <%});
               tabstrip.Add()
               .Text("Tab2")
               .Content(() =>
               {%>
                    <% Html.Telerik().Grid(Model.Class4)
                        .Name("....")
                        
                        .ToolBar(commands => commands.Insert().ButtonType(GridButtonType.ImageAndText).ImageHtmlAttributes(new { style = "margin-left:0"}))
                        .DataKeys(keys => keys.Add(c => c.ID))
                        .DataBinding(binding => binding.Server()
                        .Select("...", "....")
                        .Insert("....", "....", new { mode = GridEditMode.InLine, type = GridButtonType.ImageAndText })
                        .Update("....", ".....", new { mode = GridEditMode.InLine, type = GridButtonType.ImageAndText })
                        .Delete("....", "....", new { mode = GridEditMode.InLine, type = GridButtonType.ImageAndText })
                        )
                        .Columns(columns =>
                        {
                            columns.Bound(p => p.Col1).Width(220);
                             columns.Bound(p => p.Col2).Width(150);
                             columns.Command(commands =>
                             {
                                 commands.Edit().ButtonType(GridButtonType.ImageAndText);
                                 commands.Delete().ButtonType(GridButtonType.ImageAndText);
                             }).HtmlAttributes(new { nowrap = "nowrap", style = "width:350px !important;white-space:nowrap !important;" }).Width(300).Title("");
                        })
                        .Editable(editing => editing.Mode(GridEditMode.InLine))
                        .Pageable()
                        .Scrollable()
                        .Resizable(re => re.Columns(true))
                        .Render();
                    %>
                <%});
                tabstrip.Add()
                .Text("Tab3")
                .Content(() =>
                {%>
                    <% Html.Telerik().Grid(Model.Class5)
                        .Name("...")
                       
                        .ToolBar(commands => commands.Insert().ButtonType(GridButtonType.ImageAndText).ImageHtmlAttributes(new { style = "margin-left:0"}))
                        .DataKeys(keys => keys.Add(c => c.ID))
                        .DataBinding(binding => binding.Server()
                        .Select("...", "...")
                        .Insert("....", "....", new { mode = GridEditMode.InLine, type = GridButtonType.ImageAndText })
                        .Update("....", "....", new { mode = GridEditMode.InLine, type = GridButtonType.ImageAndText })
                        .Delete(".....", "CapTable", new { mode = GridEditMode.InLine, type = GridButtonType.ImageAndText })
                        )
                        .Pageable()
                        .Selectable()
                        .Columns(columns =>
                            {
                                columns.Bound(c => c.Col1).Width(300);
                                columns.Bound(c => c.Col2).Width(100);
                                columns.Bound(c => c.Col3).Width(100);
                                columns.Command(commands =>
                                {
                                    commands.Edit().ButtonType(GridButtonType.ImageAndText);
                                    commands.Delete().ButtonType(GridButtonType.ImageAndText);
                                }).HtmlAttributes(new { nowrap = "nowrap", style = "width:350px !important;white-space:nowrap !important;" }).Width(300).Title("");
                            })
                             .Editable(editing => editing.Mode(GridEditMode.InLine))
                           .Resizable(re => re.Columns(true))
                        .Render();
                    %>
                <%});
           })
           .SelectedIndex(((int)ViewData["SelectedIndex"]))
           .Render();



My MODEL has the classes - Class1, Class2, Class3, Class4, Class5 with properties which have validation using Attributes . Sample below:

public class Class1
    {

        public int ID { get; set; }

        [DisplayName("Column1")]
        [Required(ErrorMessage = "The Column1 field is required")]
        [RegularExpression(@"\b\d+\b", ErrorMessage = "The Column1 field should be a Positive Integral Value.")]
        public int Col1{ get; set; }

        [DisplayName("Column2")]
        [StringLength(20, ErrorMessage = "The length of Column2 should be less than 20 characters.")]
        [Required(ErrorMessage = "The Column2 is Required.")]
        public string Col2{ get; set; }




 
Tsvetina
Telerik team
 answered on 09 Mar 2011
1 answer
90 views

Requirements

RadControls version

.NET version : 3.5

Visual Studio version : 2008

programming language : C#

browser support

all browsers supported by RadControls


PROJECT DESCRIPTION
I get the below error while using RadChart using ObjectDataSource. Duration is a Double field and not sure why its not being identified as numeric. Also tried Int32, Int64 & other options. Also just to test I tried replacing the Property name with some other text (which is not a property) the error change the same except for the change in property name.

note : Im using evaluation copy not sure if the issue is with this version.

03/03/2011 20:48:47 System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> Telerik.Charting.ChartException: The type of column with name Duration is not numeric at Telerik.Charting.DataManager.GetColumnIndex(String column, ColumnType columnType) at Telerik.Charting.DataManager.GetValuesColumn(Int32 groupsColumn, String column, ColumnType columnType, Boolean auto) at Telerik.Charting.DataManager.GetValuesYColumns(String[] valuesYColumns, Boolean auto) at Telerik.Charting.DataManager.DataBindSeries(Int32 rows) at Telerik.Charting.DataManager.DataBind() at Telerik.Web.UI.RadChart.PerformDataBinding(IEnumerable data) at Telerik.Web.UI.RadChart.OnDataSourceViewSelectCallback(IEnumerable retrievedData) at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) at Telerik.Web.UI.RadChart.PerformSelect() at Telerik.Web.UI.RadChart.DataBind() at System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() at System.Web.UI.WebControls.BaseDataBoundControl.OnPreRender(EventArgs e) at Telerik.Web.UI.RadDataBoundControl.OnPreRender(EventArgs e) at Telerik.Web.UI.RadChart.OnPreRender(EventArgs e) at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace --- at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.webforms_dynamictips_aspx.ProcessRequest(HttpContext context) in c:\Users\N.R.Bellamkonda\AppData\Local\Temp\Temporary ASP.NET Files\cfms\1010adf4\94dc6435\App_Web_ezfgr_e8.6.cs:line 0 at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)


Yavor
Telerik team
 answered on 09 Mar 2011
0 answers
53 views
how can i change the event of telerik shcedular from double click to mouse down,mouse drag and mouse leave to load the rad dock.
vivak
Top achievements
Rank 1
 asked on 09 Mar 2011
1 answer
775 views
Hi,
I need to redirect to another aspx page when the user clicks the Telerik Grid Add button.  How is the best way to do this?  I can't seem to find an Add button click event to trap and do a redirect.
I'm using RadControls for ASP.Net AJAX Q2010 SP2.

Below is the code from my applicationUC.aspx page.

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ApplicationsUC.ascx.cs" Inherits="SunSmart.Web.Common.UserControls.ApplicationsUC" %>



<%@ Import Namespace="SunSmart.BusinessEntities.Enums" %>

<style type="text/css">
    .RadGrid .rgCommandTable
    {
        border:0;
    }
    
    .RadGrid .rgRow td , .RadGrid .rgAltRow td, .RadGrid .rgHeader
    {
        border:0;/*-right: solid 1px #DEEBF7; */
        border-right: solid 1px #000000;
    }
 
    .RadGrid .rgHeader
    {
        border-bottom: solid 1px #000000;
    }
</style>

<telerik:RadGrid ID="applicationsGrid" runat="server" AutoGenerateColumns="false" Skin="Office2007"
    OnInsertCommand="applicationsGrid_InsertCommand"
    OnItemDataBound="applicationsGrid_OnItemDataBound" AllowPaging="true" PageSize="5">

    <PagerStyle Mode="NextPrevAndNumeric" />

    <MasterTableView ShowHeadersWhenNoRecords="true" EnableNoRecordsTemplate="true" AllowSorting="true"
        AutoGenerateColumns="false" CommandItemDisplay="Top"
        AllowAutomaticInserts="false" AllowAutomaticDeletes="false" AllowAutomaticUpdates="false"
        CommandItemSettings-AddNewRecordText="Create New Sunsmart Application" DataKeyNames="SunsmartApplicationId">

        <NoRecordsTemplate>
            No sunsmart applications found.
        </NoRecordsTemplate>

        <Columns>
            <telerik:GridBoundColumn HeaderText="Address Id" DataField="SunsmartApplicationId" ReadOnly="true"
                UniqueName="SunsmartApplicationId" SortExpression="SunsmartApplicationId" Visible="false" />

            <telerik:GridHyperLinkColumn HeaderText="Program" DataTextField="Program.ProgramDesc" NavigateUrl="#"
                Visible="true" UniqueName="Program" SortExpression="Program.ProgramDesc" />

            <telerik:GridBoundColumn HeaderText="Status" DataField="SunsmartApplicationStatu.SunsmartApplicationStatusDesc" UniqueName="SunsmartApplicationStatusDesc"
                SortExpression="SunsmartApplicationStatu.SunsmartApplicationStatusDesc" Visible="true" />

            <telerik:GridBoundColumn HeaderText="Appl Date" DataField="ApplicationDate" UniqueName="ApplicationDate"
                SortExpression="ApplicationDate" Visible="true" />

           <telerik:GridBoundColumn HeaderText="Application Form Status" DataField="ApplicationFormStatu.ApplicationFormStatusDesc "
               UniqueName="ApplicationFormStatusDesc" SortExpression="ApplicationFormStatu.ApplicationFormStatusDesc " />

           <telerik:GridBoundColumn HeaderText="Agreement Status" DataField="AgreementStatu.AgreementStatusDesc"
               UniqueName="AgreementStatusDesc" SortExpression="AgreementStatu.AgreementStatusDesc" />


        </Columns>
        
    </MasterTableView>

</telerik:RadGrid>
Princy
Top achievements
Rank 2
 answered on 09 Mar 2011
3 answers
154 views
Hi all,
           In radgrid i have a column called Employee names in this i will get the value as Employee1|Employee2|Employee3. I need the color change for the value Employee1 should be red color and Employee2 should be Green color and Employee3 should be Blue in color. Please Help me out.

Can you help me figure out what I have to do in radgrid?

Thank you,
Kingsleen Solomon Doss.J
Shinu
Top achievements
Rank 2
 answered on 09 Mar 2011
2 answers
92 views

I have a RadScheduler  with a RadSchedulerContextMenu that shows when the user right clicks an appointment. Inside that RadSchedulerContextMenu, I have several RadMenuItems, some of which are disabled. One of the RadMenuItems is Text="Edit" Value="CommandEdit" Enabled="False", however, it is NOT disabled. The other items are disabled when I set Enabled="false", but not the Edit item.

<telerik:RadSchedulerContextMenu runat="server" ID="ContextMenuNone" Skin="Vista" >  
<Items>    
<telerik:RadMenuItem Text="Edit" Value="CommandEdit" ImageUrl="~/edit.png" Enabled="false" />    
...
</Items>
</telerik:RadSchedulerContextMenu>

 
How can I disable the CommandEdit RadMenuItem?

Robert Helm
Top achievements
Rank 1
 answered on 08 Mar 2011
2 answers
115 views
I have the calendar set to allow multiple selection. Each selected day is going to be stored in the db. The issue I am having is determining what date was unselected from e.SelectedDates. I have found no other function/property to detemine this value.

My goal is simular to this. but even this does not allow me to know what the unselected date was.
http://www.telerik.com/community/forums/aspnet-ajax/calendar/toggle-function.aspx

I am using VS2005 telerik version 2008.1.619.20. I cannot upgrade.

Thanks
Dan
Top achievements
Rank 1
 answered on 08 Mar 2011
6 answers
409 views
Hi,

Am I missing something? The $find is not working for a RadPanelBar, here is the code:

... 
<body topmargin="0" leftmargin="0"
    <form id="form1" runat="server"
    <div> 
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
        </telerik:RadScriptManager> 
        <telerik:RadPanelBar ID="rpbNavigation" runat="server" style="width:100%" Skin="Outlook" EnableViewState="false"
        </telerik:RadPanelBar> 
    </div> 
    </form> 
    <telerik:RadCodeBlock ID="RadCodeBlock2" runat="server"
        <script type="text/javascript"
            checkMain(); 
            function checkMain() { 
                var panelBar = $find("<%= rpbNavigation.ClientID %>"); 
 
                var item = panelBar.findItemByText(Main.selectedModule); 
            } 
        </script> 
    </telerik:RadCodeBlock> 
</body> 
... 

I tried to put the script block on the header tag and in the body tag. If I replace by $get, it works, but then I can't access the findItemByText function. The funny thing is that I use a very similar code on other page and it works, the difference is that I use a RadMenu instead a RadPanelBar.

On, the call to checkMain() would be on the onload event of the body, I tried to move around to see if there was something to do with the timing of this call, but no luck.

Any help is appreciated.

Thanks,
Eduardo
Lorenzo
Top achievements
Rank 1
 answered on 08 Mar 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?