Telerik Forums
UI for ASP.NET AJAX Forum
8 answers
318 views
I would like to use RadGrid drag'n drop feature to reorder a list of items.
So I follow your sample available at http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/Programming/DragAndDrop/DefaultCS.aspx
(Telerik.Web.UI.dll 2008.1.415.20)

It worked very well until I embed the grid into the content template of a master page. Then I cannot retreive the destination node in the drop event handler...

I do not understand why a master page causes this problem but the rest of the code is strictly the same :

Page without master page :

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="WithoutMasterPage.aspx.cs" Inherits="WithoutMasterPage" %> 
<%@ 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"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server"
    <title>Page sans titre</title> 
</head> 
<body> 
    <form id="form1" runat="server"
     
        <asp:ScriptManager ID="scripManager" runat="server" /> 
         
        <telerik:RadGrid runat="server" ID="grdPendingOrders" Skin="Sunset" OnNeedDataSource="grdPendingOrders_NeedDataSource" AllowPaging="True" Width="350px" OnRowDrop="grdPendingOrders_RowDrop" AllowMultiRowSelection="true"
            <MasterTableView DataKeyNames="Id"
            </MasterTableView> 
            <ClientSettings AllowRowsDragDrop="True"
                <Selecting AllowRowSelect="True" EnableDragToSelectRows="true" /> 
            </ClientSettings> 
        </telerik:RadGrid><asp:Label ID="LabelDestItem" runat="server" ForeColor="Red" /> 
     
    </form> 
</body> 
</html> 

Page with master page (the master page is the default template, no extra code) :

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="WithMasterPage.aspx.cs" Inherits="WithMasterPage" Title="Untitled Page" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"
 
    <asp:ScriptManager ID="scripManager" runat="server" /> 
     
    <telerik:RadGrid runat="server" ID="grdPendingOrders" Skin="Sunset" OnNeedDataSource="grdPendingOrders_NeedDataSource" AllowPaging="True" Width="350px" OnRowDrop="grdPendingOrders_RowDrop" AllowMultiRowSelection="true"
        <MasterTableView DataKeyNames="Id"
        </MasterTableView> 
        <ClientSettings AllowRowsDragDrop="True"
            <Selecting AllowRowSelect="True" EnableDragToSelectRows="true" /> 
        </ClientSettings> 
    </telerik:RadGrid> 
     
    <asp:Label ID="LabelDestItem" runat="server" ForeColor="Red" /> 
 
</asp:Content> 

Code behind is the same for the two pages :

    protected void grdPendingOrders_NeedDataSource(object source, GridNeedDataSourceEventArgs e) { 
        List<GridItem> items = new List<GridItem>(); 
        items.Add(new GridItem(1, "Item1")); 
        items.Add(new GridItem(2, "Item2")); 
        items.Add(new GridItem(3, "Item3")); 
        this.grdPendingOrders.DataSource = items; 
    } 
 
    protected void grdPendingOrders_RowDrop(object sender, GridDragDropEventArgs e) { 
        if (e.DestDataItem != null) { 
            this.LabelDestItem.Text = "e.DestDataItem.OwnerGridID = " + e.DestDataItem.OwnerGridID; 
        } else { 
            this.LabelDestItem.Text = "e.DestDataItem is null!"
        } 
    } 
In the first case, e.DestDataItem is correctly set, in the other it's always null.

Have you got an explaination for this issue?

Thanks,

Gilles

Maria Ilieva
Telerik team
 answered on 20 Dec 2012
5 answers
163 views
Hi,
I have used the rad grid. In the ItemCommand i have checked for the rows as below. Also, if any of the existing rows in the available 10 are deleted, the user should be able to add one more item. I  have used this code:
protected void radgrid1_ItemCommand(object sender, GridCommandEventArgs e)
        {
             
                int i = int.Parse(hdnRowsCount.Value);
  
                if (e.CommandName == RadGrid.InitInsertCommandName)
                {                                  
                   if (i < 10)
                    {
                       i++;
                       hdnRowsCount.Value = Convert.ToString(i);
                    }
                    else
                    {
                        e.Canceled = true;
                        radgrid1.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;
                    }
                }
                if (e.CommandName == RadGrid.DeleteCommandName)
                {
                    i--;
                }
              
        }

In the aspx, i have the "hdnRowsCount" set to 0. Once the item is deleted, the user should be able to add new rows again. Also, when the number of rows has reached, "Add new item" option should be hidden. Now It is not gettiong hidden.
How to fix this?
Thanks
Tsvetoslav
Telerik team
 answered on 20 Dec 2012
1 answer
85 views
Hello,

Currently I'm using a Chart, type pie. I've a legend next to the pie, to define the colors in the pie. Next to the chart, there is a DataList, which shows the corresponding data value per item. 

I was wondering, if it were possible, to show the item name AND the item value in the legend. Then I can delete my DataList, and the design will be much better.

Is that possible?

Greetings,
Thye
Petar Kirov
Telerik team
 answered on 20 Dec 2012
5 answers
161 views
Hello, I have page with several rad textboxes - and one of them doesn't work right in Internet Explorer (IE 9).  It works fine in all other browsers.
The issue is that you can't click on it to type into the box.  BUT, if you hover over the border (very edge of the textbox), you get the Text Mouse Pointer that allows you to click on it and type.  But, just clicking on the textbox in the type area doesn't work.

It works great in Chrome and FireFox.

How to overcome this issue?
Vasil
Telerik team
 answered on 20 Dec 2012
3 answers
155 views

How to set the different color for FooterAggregateFormatString show value

and one more doubt how to set different color for every level

reply as soon as possible .

Thanks Advance,
Mohamed.
Princy
Top achievements
Rank 2
 answered on 20 Dec 2012
9 answers
97 views
Hi,
We currently use a custom skin for our Grids and Menu's however, i would like to use the "Metro" Skin for the Grid Filter menu's but it seems the attributes provided do not work.

<telerik:RadGrid ID="rgCampaignSelect" runat="server" AllowPaging="True" PageSize="10" AllowSorting="true" AllowFilteringByColumn="true" EnableEmbeddedSkins="False" Skin="GatorLayout" FilterMenu-Skin="Metro" FilterMenu-EnableEmbeddedSkins="True">

The above doesnt set the Filter Menu Items skin to Metro, it stays as GatorLayout.  I then tell it to use Embedded Skins and it errors saying GatorLayout is not an embedded skin.

How can i fix this?

Thanks,
Michael
Eyup
Telerik team
 answered on 20 Dec 2012
1 answer
52 views
I know that there is an option to set first day of the week,
but is there an option to set the workweek to be different from monday-friday?
For example saturday-wednesday workweek as in some arabic countries.
Plamen
Telerik team
 answered on 20 Dec 2012
1 answer
85 views
2012 Q3 controls

This sample code: <telerik:RadTextBox runat="server" Width="400px" Label="Test" /> results in the label and inputbox having equal widths.  I need to produce the more accepted behaviour of having the input box closer to the label and having it widen/narrow according to the Width property for all my textbox controls.  How can I accomplish this?

Eyup
Telerik team
 answered on 20 Dec 2012
8 answers
892 views
I'm getting this error:


RadAsyncUpload does not have permission to write files in the TemporaryFolder. In Medium Trust scenarios, the TemporaryFolder should be a subfolder of the Application Path.


I have given Network Service full control of App_Data folder.  What am I missing?
Peter Filipov
Telerik team
 answered on 20 Dec 2012
1 answer
65 views
I am trying to create a User Control to place into a Telerik MegaMenu (RadMenu). The User Control is named "clientfilter" which will pull a sub-set of data from a SharePoint 2010 list. I have placed the following code into the "Page_Load" event but am getting errors on render.

protected void Page_Load(object sender, EventArgs e)
        {
            SPSite site = new SPSite("http://abcdev");
            using (SPWeb web = site.OpenWeb())
            {
                try
                {
                    SPList clientlist = web.Lists.TryGetList("clientmatter");
                    if (clientlist != null)
                    {
                        SPListItemCollection clientitems = clientlist.Items;
                        DataGrid dg = new DataGrid();
                        dg.DataSource = clientlist.Items.GetDataTable();
 
                        foreach (SPListItem clientitem in clientitems)
                        {
                            string clientddlvalue = clientitem["clientid"].ToString();
                            //myselect.Items.Add(clientddlvalue);
                             
                        }
                         
                        if ( !IsPostBack )
                         {
                           GridBoundColumn boundColumn;
 
                           //Important: first Add column to the collection
                           boundColumn = new GridBoundColumn();
                           this.RadGrid1.MasterTableView.Columns.Add(boundColumn);
 
                           //Then set properties
                           boundColumn.DataField = "clientid";
                           boundColumn.HeaderText = "clientid";
                         }
                    }
                }
                catch
                {
 
                }
                {
                    web.Dispose();
                }
            }
               
        }

The error I can see is "failure loading assembly 'Telerik.Web.UI.Design' ...", however, not sure if this is the real error or a by-product of a different error. When I originally entered the assembly registrations I mis-typed the name, however, I have subsequently fixed the name, but the error still persists. I have added the following to the GAC already:

  • Telerik.Web.UI
  • Telerik.Web.Design
  • Telerik.Web.UI.Skins

In my custom master page I have the following registrations:
<%@ Register Tagprefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI, Version=2012.3.1205.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" %>
<%@ Register Tagprefix="telerik" Namespace="Telerik.Web.Design" Assembly="Telerik.Web.Design, Version=2012.3.1205.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" %>

What am I missing? Why will the code not work?

Thank you in advance.
Marin
Telerik team
 answered on 20 Dec 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?