Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
216 views
// ASP.NET MVC
Hello,


I have a problem with my tab, when I click on any other tab change this.
What's weird is that my tab works in the home page but not in another page "Parameter"
I just picked up the code on your site regarding tab.
I will put the screen and the code copies.

Thank you for your help

ParameterView:

@using System.Globalization
@using Telerik.Web.Mvc.UI
 
 
@{ Html.Telerik().TabStrip()
        .Name("TabStrip")
        .Items(tabstrip =>
        {
            tabstrip.Add()
                .Text("ASP.NET MVC")
                .ImageUrl("~/Content/Common/Icons/Suites/mvc.png")
                .Content(@<text>
                    <ul>
                        <li>Pure ASP.NET MVC components</li>
                        <li>Completely Open Source</li>
                        <li>Exceptional Performance</li>
                        <li>Based on jQuery</li>
                        <li>Search Engine Optimized</li>
                        <li>Cross-browser support</li>
                    </ul>
                </text>);
            tabstrip.Add()
                .Text("Silverlight")
                .ImageUrl("~/Content/Common/Icons/Suites/sl.png")
                .Content(@<text>
                    <ul>
                        <li>Built on Silverlight 3</li>
                        <li>RIA services support</li>
                        <li>Validation support</li>
                        <li>Out of browser support</li>
                        <li>The first commercial 3D chart</li>
                        <li>Free testing framework</li>
                    </ul>
                </text>);
            tabstrip.Add()
                .Text("ASP.NET AJAX")
                .ImageUrl("~/Content/Common/Icons/Suites/ajax.png")
                .Content(@<text>
                    <ul>
                        <li>Built on top of Microsoft ASP.NET AJAX framework</li>
                        <li>Rich client-side capabilities; nearly identical client-side and server-side APIs</li>
                        <li>.NET 3.5 built-in support for LINQ, EntityDataSource, ADO.NET DataServices, WCF, etc</li>
                        <li>Performance optimization helper controls and HTTP compression</li>
                        <li>SharePoint and DotNetNuke Integration; ASP.NET MVC-ready</li>
                        <li>Wide cross-browser compatible and XHTML compliant</li>
                    </ul>
                </text>);
            tabstrip.Add()
                .Text("OpenAccess ORM")
                .ImageUrl("~/Content/Common/Icons/Suites/orm.png")
                .Content(@<text>
                    <ul>
                        <li>Model First and Schema First approaches</li>
                        <li>Stored Procedures for Multiple Databases</li>
                        <li>Views for Multiple Databases</li>
                        <li>Generic Metadata Access and artificial fields API in the runtime</li>
                        <li>Support for Ado.Net Data Services and WCF</li>
                        <li>Support for LINQ, OQL, and SQL Languages</li>
                    </ul>
                </text>);
            tabstrip.Add()
                .Text("Reporting")
                .ImageUrl("~/Content/Common/Icons/Suites/rep.png")
                .Content(@<text>
                    <ul>
                        <li>Excellent data presentation and analysis: Crosstabs, Charts, Tables, Lists</li>
                        <li>SubReports, Barcodes, Images, Shapes, and more</li>
                        <li>Revolutionary WYSIWYG design surface in Visual Studio</li>
                        <li>Easy conditional formatting, sorting, filtering, grouping</li>
                        <li>Powerful styling, data binging and data processing models</li>
                        <li>Significantly reduced development time through wizards and builders</li>
                    </ul>
                </text>);
            tabstrip.Add()
                .Text("Sitefinity ASP.NET CMS")
                .ImageUrl("~/Content/Common/Icons/Suites/sitefinity.png")
                .Content(@<text>
                    <ul>
                        <li>Multi-lingual Content Integration</li>
                        <li>Workflow Engine</li>
                        <li>Document versioning</li>
                        <li>Permissions</li>
                        <li>Interface Localization</li>
                        <li>Wide cross-browser compatible and XHTML compliant</li>
                    </ul>
                </text>);
        })
        .SelectedIndex(0)
        .Render();
}


GridControler:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
 
namespace WebRH2012.Controllers
{
    using System.Linq;
    using System.Web.Mvc;
 
    using Models;
    using System;
    using Telerik.Web.Mvc.UI;
    using Telerik.Web.Mvc;
    using System.Data.Entity.Validation;
    public partial class GridController : Controller
    {
        //[SourceCodeFile("EditableProduct (model)", "~/Models/EditableProduct.cs")]
        //[SourceCodeFile("SessionProductRepository", "~/Models/SessionProductRepository.cs")]
        //[SourceCodeFile("Date.ascx (editor)", "~/Views/Shared/EditorTemplates/Date.ascx")]
        private readonly JSIEntities context = new JSIEntities();
        public ActionResult ForeignKeyColumn()
        {
 
 
            return View(new GridModel(Statut.getAllStatut()));
        }
        [GridAction]
        public ActionResult _ForeignKeyColumn()
        {
            return View(new GridModel(Statut.getAllStatut()));
        }
        [AcceptVerbs(HttpVerbs.Post)]
        [GridAction]
        public ActionResult _ForeignKeyColumnUpdateOrder(int id, int employeeId)
        {
 
            //var order = new ClientEditableOrder
            //{
            //    OrderID = id,
            //    Employee = new NorthwindDataContext().Employees
            //            .Where(e => e.EmployeeID == employeeId)
            //            .Select(e => e.FirstName + " " + e.LastName).SingleOrDefault()
            //};
            //// Exclude "Employee" from the list of updated properties
            //if (TryUpdateModel(order, null, null, new[] { "Employee" }))
            //{
            //    SessionClientOrderRepository.Update(order);
            //}
            return View(new GridModel(Statut.getAllStatut()));
        }
 
 
 
        public ActionResult EditingAjax(GridEditMode? mode, GridButtonType? type, GridInsertRowPosition?
            insertRowPosition)
        {
            ViewData["mode"] = mode ?? GridEditMode.InLine;
            ViewData["type"] = type ?? GridButtonType.Text;
            ViewData["insertRowPosition"] = insertRowPosition ?? GridInsertRowPosition.Top;
            return View();
        }
        [GridAction]
        public ActionResult _SelectAjaxEditing()
        {
            //return View(new GridModel(SessionProductRepository.All()));
            return null;
        }
        //[AcceptVerbs(HttpVerbs.Post)]
        //[CultureAwareAction]
        //[GridAction]
        //public ActionResult _SaveAjaxEditing(int id)
        //{
        //    EditableProduct product = SessionProductRepository.One(p => p.ProductID == id);
 
        //    TryUpdateModel(product);
        //    SessionProductRepository.Update(product);
        //    return View(new GridModel(SessionProductRepository.All()));
        //}
        [AcceptVerbs(HttpVerbs.Post)]
        //[CultureAwareAction]
        [GridAction]
        public ActionResult _InsertAjaxEditing(FormCollection form, string entityName, int id)
        {
 
            var result = new object();
 
            var newObject = new object();
            var model = new GridModel();
 
 
            switch (entityName)
            {
 
                case "augmentations":
 
                    newObject = AUGMENTATIONS.FormCollectionToAugmentations(form, id);
                    //((AUGMENTATIONS)newObject).REF_CANDIDAT = id;
                    if (TryValidateModel((AUGMENTATIONS)newObject))
                    {
 
                        context.AUGMENTATIONS.Add(((AUGMENTATIONS)newObject));
                        context.SaveChanges();
 
 
                    }
                    model = new GridModel(CANDIDATS.getCandidatByID(id, context).getHistoAugmention());
                    break;
                case "corange":
                    newObject = HISTO_MT_CARTE_ORANGE_CANDIDAT.FormCollectionToHistoMtCorange(form, id);
                    //((HISTO_MT_CARTE_ORANGE_CANDIDAT)newObject).REF_CANDIDAT = id;
                    if (TryValidateModel((HISTO_MT_CARTE_ORANGE_CANDIDAT)newObject))
                    {
 
                        context.HISTO_MT_CARTE_ORANGE_CANDIDAT.Add(((HISTO_MT_CARTE_ORANGE_CANDIDAT)newObject));
                        context.SaveChanges();
 
 
                    }
                    model = new GridModel(CANDIDATS.getCandidatByID(id, context).getHistoCorange());
                    break;
                case "ndf":
                    newObject = CANDIDATS_NDF.FormCollectionToHistoMtCorange(form, id);
                    if (TryValidateModel((CANDIDATS_NDF)newObject))
                    {
                        context.CANDIDATS_NDF.Add(((CANDIDATS_NDF)newObject));
                        context.SaveChanges();
                    }
                    model = new GridModel(CANDIDATS.getCandidatByID(id, context).getHistoNdf());
                    break;
                case "primes":
                    newObject = PRIMES.FormCollectionToHistoMtCorange(form, id);
                    if (TryValidateModel((PRIMES)newObject))
                    {
                        context.PRIMES.Add(((PRIMES)newObject));
                        context.SaveChanges();
                    }
                    model = new GridModel(CANDIDATS.getCandidatByID(id, context).getHistoPrime());
                    break;
            }
            return View(model);
 
 
 
            //Create a new instance of the EditableProduct class.
            //EditableProduct product = new EditableProduct();
            //Perform model binding (fill the product properties and validate it).
            //if (TryUpdateModel(product))
            //{
            //    //The model is valid - insert the product.
            //    SessionProductRepository.Insert(product);
            //}
            ////Rebind the grid
            //return View(new GridModel(SessionProductRepository.All()));
 
        }
        //[AcceptVerbs(HttpVerbs.Post)]
        //[GridAction]
        //public ActionResult _DeleteAjaxEditing(int id)
        //{
        //    //Find a customer with ProductID equal to the id action parameter
        //    EditableProduct product = SessionProductRepository.One(p => p.ProductID == id);
        //    if (product != null)
        //    {
        //        //Delete the record
        //        SessionProductRepository.Delete(product);
        //    }
 
        //    //Rebind the grid
        //    return View(new GridModel(SessionProductRepository.All()));
        //}
    }
}


Layout:

<!DOCTYPE html>
<html>
<head>
    <title>Outil RH </title>
    <meta http-equiv="X-UA-Compatible" content="IE=100" />
    <meta http-equiv="Content-Type" content="text/html; CHARSET=UTF-8 " />
    <link href="@Url.Content("../../Content/jquery.contextMenu.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("../../Content/themes/base/jquery.ui.all.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("../../Content/StyleGridView.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("../../Content/StyleRH.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("../../Scripts/jquery-1.7.2.min.js")"></script>
    @*    <script src="@Url.Content("../../Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>*@
     
    <script src="@Url.Content("../../Scripts/jquery.ui.core.js")" type="text/javascript"></script>
    <script src="../../Scripts/jquery.ui.widget.js"></script>
    <script src="@Url.Content("../../Scripts/jquery.ui.tabs.js")" type="text/javascript"></script>
    <script src="@Url.Content("../../Scripts/jquery-ui-1.8.11.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("../../Scripts/jquery.editable-1.3.3.js")" type="text/javascript"></script>
    <script src="@Url.Content("../../Scripts/Script.js")" type="text/javascript"></script>
    <script src="@Url.Content("../../Scripts/jquery.contextMenu.js")" type="text/javascript"></script>
    <script src="@Url.Content("../../Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("../../Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("../../Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>
    <link href="@Url.Content("../../Content/2013.2.611/telerik.common.min.css")" rel="stylesheet" />
    <link href="@Url.Content("../../Content/2013.2.611/telerik.vista.min.css")" rel="stylesheet" />
    <link href="@Url.Content("../../Content/2013.2.611/telerik.rtl.min.css")" rel="stylesheet" />
 
    <script type="text/javascript">
        $(document).ready(function () {
            if (window.location.search.length == 0) {
                if ($("#All_Candidats").val() < 1)
                    $(".MenuInfo").hide("fast", function () { $(".MenuInfo").css("height", "0"); });
            }
        });
 
    </script>
 
 
    <base target="_self" />
</head>
<body>
    <div id="Contenu">
        @Html.Partial("header")
        @RenderBody()
        <div id="footer">
        </div>
    </div>
</body>
</html>
David
Top achievements
Rank 1
 asked on 30 Oct 2013
5 answers
129 views
Hi,

I would like to drag an item from a RadtreeView and drop in on the RadScheduler.
How can I detect this on the server-side?

Which other server-side events can I use if I want to:
Edit, move, copy and delete an item?

Thanks,
Egbert
Kate
Telerik team
 answered on 30 Oct 2013
1 answer
438 views
Hi

Using a Multicolumn Combobox with OpenAccess and trying to insert a blank item - as need to have the option of not selecting any item from the list - tried various solutions/posts with no success - code for combobox as below

<telerik:RadComboBox runat="server" ID="RadComboBox1" Height="190px" Width="100%"
    MarkFirstMatch="true" DataSourceID="OpenAccessLinqDataSource1" EnableLoadOnDemand="true"
    HighlightTemplatedItems="true" DataValueField="PartID" DataTextField="PartNumber"
    AppendDataBoundItems="True" SelectedValue='<%# Bind("PartID") %>' ItemsPerRequest="10"
    EnableVirtualScrolling="True" Filter="Contains" OnSelectedIndexChanged="RadComboBox1_SelectedIndexChanged"
    AutoPostBack="True">
    <HeaderTemplate>
        <ul>
            <li class="col1">Part Number</li>
            <li class="col2">Part Description</li>
        </ul>
    </HeaderTemplate>
    <ItemTemplate>
        <ul>
            <li class="col1">
                <%# DataBinder.Eval(Container.DataItem, "PartNumber")%>
            </li>
            <li class="col2">
                <%# DataBinder.Eval(Container.DataItem, "PartDescription")%></li>
        </ul>
    </ItemTemplate>
</telerik:RadComboBox>

Tried online demo http://www.telerik.com/help/aspnet-ajax/combobox-insert-default-item-when-databinding.html 

(Using vb)

Thanks



Boyan Dimitrov
Telerik team
 answered on 30 Oct 2013
1 answer
98 views
1 : I don't know how to do like this exp: http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/nestedviewtemplatedeclarativerelations/defaultcs.aspx
I have a list of item List<item> get by DAL how to bind it to Detail info
(i don't have sqldatasource)

2: I wonder why all exp use sqldatasource is it the new stand of programming ?

3 : Can i bind the list item to sqldatasourece and do like exp

Thanks.



Viktor Tachev
Telerik team
 answered on 30 Oct 2013
2 answers
166 views
Hi Sir,

      i am having some problem when i am using Two RadGrids with in Single page.

     Problem: (1). When i Click Add New Record Button on RadGrid1 then it is in Insert Mode
               (2).  Next if Click on Add New Record Button on Second RadGrid2 then Both are in Insert mode.
             
               (3). Now i want to Add the Records through RadGrid2 after Clicking Insert Button Now the Problem is Both Grids validations are        firing so  the Record is not able to Add through RadGrid2. how to overcome this problem Please give me the Suggestion.

Please go-through the Screenshots.

      


Venkateswarlu
Top achievements
Rank 1
 answered on 30 Oct 2013
4 answers
188 views
I have a pair of ListBoxes that I use to transfer items between.  I've disabled the Double Click capability for both ListBoxes, but the right hand box still allows double-clicking.  I was able to duplicate this using the online example here (http://demos.telerik.com/aspnet-ajax/listbox/examples/functionality/transfer/defaultcs.aspx).  In the example, disable the Double Click Transfer.  You can verify that double click is disabled by trying to click in the left hand box.  Then, move a couple of items to the right hand box.  Now, double click one of those items and you'll see they are moved back to the left hand box.  This is not the behavior I expected to see.  I need to be able to leave the box enabled, but prevent the user from transferring data by double clicking.  Please help.

Please note:  Setting Allow Transfer to false does not prevent this type of double clicking to transfer items.  Weird!

Dave
Priyalakshmi
Top achievements
Rank 1
 answered on 30 Oct 2013
1 answer
142 views
Hi,
it is possible to upload files using Copy/paste from windows Explorer, e.g. you select one or several files in a folder, ctrl+c, set focus to AsyncUpload, press ctrl+v, AsyncUpload upload files?

Thanks
Alex
Shinu
Top achievements
Rank 2
 answered on 30 Oct 2013
1 answer
134 views
Hi, 

I have a rad grid where all the columns created dynamically from code behind. Some are template columns and others are bound columns. I have a save button which is outside the grid where i need to read the cell values on click event. 
But inside the on click event I can't access the mastertableview columns or items. 

Eg: radGrid.MasterTableView.Items.Count - this equals to zero. Therefore I can't iterate through the cell values. 

The grid is defined on the markup. And I add the dynamically columns on Page_Init(). I'm assigning a dynamically generated DataTable as the datasource for the grid.

I have tried lot of solutions suggested in forums but nothing works. So now I started reading all the cell values from client side and it seems slow. Can somebody help?

Thanks. 
Princy
Top achievements
Rank 2
 answered on 30 Oct 2013
1 answer
68 views
Hello I am new to RadScheduler, and trying to edit the appointment format.

For example, when we try to add an appointment, it asks us to fill subject, location, background, etc, I want to make my own appointment format, so i can get rid of such features that i do not need in my program.

Is there any way to do this?
Plamen
Telerik team
 answered on 30 Oct 2013
4 answers
184 views
In a post I found -- I used the below code to hide the expalnd and collapse image on the panel bar.

<style type="text/css">  
    div.RadPanelBar .rpExpandable .rpText,  
    div.RadPanelBar .rpExpanded .rpText  
    {  
        background-image:none;  
    }  
</style>

Which worked great, until I upgraded to the latest 2010 Q2 dll.  I was using the 2009 Q3 dll. 

It would be great if there was a property for this -- although I don't see anything like that.   Any ideas?

Thanks,
Todd.
Shinu
Top achievements
Rank 2
 answered on 30 Oct 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?