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

Splitter.  Frustrated beyond belief.

A real simple one,  Vertical orientation, left panel splitbar and right panel.

It will not stretch across the screen.
Splitter width="100%" panes are width=20% and width = 80%...this results in the Actual Splitter itself offsetting from the left, hiding half the left pane, and reducing the right pane to about 50px.

And as this runs on a variety of different width monitors,...using fixed sizes is a no go.

I have tried minwidth, maxwidth, 

LiveResize

="true" ResizeWithBrowserWindow="true"  and all combos I could think of. including not specifying width in splitter or/and panes or variations thereon.

 


(This after an upgrade to 2209.1 from  Q4 2006,..which also took some effort but worked)

Funny enough Height="100%" works correctly.

 

<telerik:RadSplitter ID="RadSplitter" runat="server"

 

 

Orientation="Vertical" LiveResize="true" ResizeWithBrowserWindow="true"

 

 

height="100%" Width="100%"

 

 

BackColor="pink">

 

 

 

<telerik:RadPane ID="NavPane" runat="server"

 

 

Width="250px"

 

 

Height="99%" Scrolling="None" >

 

 

<table width="100%">...............................................label and buttons

 

</

table>

 

<

telerik:RadTreeView ID="RadTreeRisk" runat="server"

 

 

Height="755px" Width="100%" BackColor="yellow"

 

 

OnNodeExpand="RadTreeRisk_NodeExpand"

 

 

OnNodeClick="RadTreeRisk_NodeClick"

 

 

MultipleSelect="false"

 

 

CausesValidation="false" />

 

 

</telerik:RadPane>

 

 

<telerik:RadPane ID="contentPane" runat="server" Scrolling="None"

 

 

ContentUrl="" Height="100%" Width="100%"

 

 

Collapsed="false" >

 

...............Some grids and divs for labels  (all width=100%)

 

</telerik:RadPane>

 

 

 

</telerik:RadSplitter>

 


It runs in an  asp:Content placeholder  (MasterPage)(asp.net 2.0)
 
and needs to stretch across the screen accurately   (match with the Head and HorizontalMenus in divs which soze correctly if I use 100% widths.

TIA
NEal

Veselin Vasilev
Telerik team
 answered on 09 Apr 2009
3 answers
248 views
Hi,

I can't find anything about this in the docs or in the forums.
I'm trying to exclude a specific zone from decoration rather than specify all the zones that should be decorated, and I'm hoping this is the way to do it. If so, how do I use it?

Thanks!
Georgi Tunev
Telerik team
 answered on 09 Apr 2009
4 answers
171 views
Hi all

What would cause the  ReorderTabsOnSelect="True" not to work? It did not work on the 2008 Q2, but I got around it with the TabStrip CSS files. These have gone to pieces now with the 2009 Q1 version, but I would be OK with the reorderonselect.

My guess would be its a postback / reload issue but has anyone had a simiar problem.

My Fill routine:

 

Private Sub FillTabs()

 

Dim Expert As New clsExpert

 

Dim TabDat As Data.DataTable = Expert.GetAssessmentScales()

 

With RadTabStrip

.DataFieldID =

"AssessmentScale_ID"

 

 

 

.DataFieldParentID =

"AssessmentScaleParent_ID"

 

 

.DataTextField =

"AssessmentScale_Title"

 

 

.DataValueField =

"AssessmentScale_ID"

 

 

.DataSource = TabDat
.DataBind()

.ReorderTabsOnSelect =

"true"

 

End With

 

End Sub

 


My Mark up
<telerik:RadTabStrip

 

 

ID="RadTabStrip"

 

 

runat="server"

 

 

EnableEmbeddedSkins="true"

 

 

Skin="Outlook"

 

 

SelectedIndex="0"

 

 

ReorderTabsOnSelect="True"

 

 

PerTabScrolling="True">

 

</telerik:RadTabStrip>

 


Andy

Andy Green
Top achievements
Rank 2
 answered on 09 Apr 2009
3 answers
219 views


Hello everyone,

I'd appreciate if anyone can help me in the following.

I have a page with
1 RadDockLayout
2 Rad DocZones - going to increase the number later on to have more stuff added to my application.
In each RadDock I have a control

I want to have a DropDownList that will have the closed RadDocks and when selected the will re-open again
the following is my code : 


<%

@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="SaveAndLoad.aspx.cs" Inherits="SaveAndLoad" %>

 

<%

@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

 

<

 

asp:Content ID="Content2" runat="server" contentplaceholderid="ContentPlaceHolder1">

 

 

<asp:ScriptManager ID="ScriptManager1" runat="server">

 

</

 

asp:ScriptManager>

 

 

<asp:UpdatePanel ID="UpdatePanel1" runat="server">

 

 

<ContentTemplate>

 

 

<telerik:raddocklayout runat="server" enableviewstate="False"

 

 

id="RadDockLayout1" onloaddocklayout="RadDockLayout1_LoadDockLayout"

 

 

onsavedocklayout="RadDockLayout1_SaveDockLayout"

 

 

storelayoutinviewstate="False">

 

 

<telerik:raddockzone runat="server" id="RadDockZone2" orientation="vertical"

 

 

style="width:300px;min-height:100px;float:left;margin-right:20px;" Width="22px">

 

 

<telerik:raddock runat="server" id="RadDock3" title="Databound control"

 

 

AutoPostBack="true">

 

 

<contenttemplate>

 

 

<asp:gridview runat="server" id="GridView1" width="100%">

 

 

</asp:gridview>

 

 

</contenttemplate>

 

 

</telerik:raddock>

 

 

</telerik:raddockzone>

 

 

<telerik:raddockzone runat="server" id="RadDockZone1" orientation="vertical"

 

 

style="width:300px;min-height:100px;float:left;">

 

 

<telerik:raddock runat="server" id="RadDock2" title="Text"

 

 

text="This is a dock with some text inside" AutoPostBack="true"

 

 

CommandsAutoPostBack="True" Skin="Default">

 

 

</telerik:raddock>

 

 

</telerik:raddockzone>

 

 

</telerik:raddocklayout>

 

 

</ContentTemplate>

 

 

</asp:UpdatePanel>

 

 

</

 

asp:Content>

 





using

 

System;

 

using

 

System.Collections.Generic;

 

using

 

System.Web;

 

using

 

System.Web.UI;

 

using

 

System.Web.UI.WebControls;

 

using

 

System.Collections;

 

using

 

System.Web.Script.Serialization;

 

using

 

System.Data.SqlClient;

 

using

 

Telerik.Web.UI;

 

using

 

System.Text;

 

public

 

partial class SaveAndLoad : System.Web.UI.Page

 

{

 

protected void Page_Load(object sender, EventArgs e)

 

{

 

ArrayList source = new ArrayList();

 

source.Add(

"one");

 

source.Add(

"two");

 

source.Add(

"three");

 

GridView1.DataSource = source;

GridView1.DataBind();

}

 

protected void RadDockLayout1_LoadDockLayout(object sender, Telerik.Web.UI.DockLayoutEventArgs e)

 

{

HttpCookie positionsCookie = Request.Cookies.Get(

"positionsCookie");

 

 

if (positionsCookie != null)

 

{

 

String serializedList = positionsCookie.Value;

 

 

if (serializedList != null)

 

{

 

String[] states = serializedList.Split('|');

 

 

 

for (int i = 0; i < states.Length-1; i++)

 

{

DockState state = DockState.Deserialize(states[i]);

RadDock dock = (RadDock)RadDockLayout1.FindControl(state.UniqueName);

dock.Closed =

false;

 

dock.ApplyState(state);

e.Positions[state.UniqueName] = state.DockZoneID;

e.Indices[state.UniqueName] = state.Index;

}

}

}

}

 

protected void RadDockLayout1_SaveDockLayout(object sender, Telerik.Web.UI.DockLayoutEventArgs e)

 

{

HttpCookie positionsCookie = Request.Cookies.Get(

"positionsCookie");

 

 

if (positionsCookie == null | Page.IsPostBack)

 

{

positionsCookie =

new HttpCookie("positionsCookie");

 

Page.Response.Cookies.Add(positionsCookie);

 

List<DockState> stateList = ((RadDockLayout)sender).GetRegisteredDocksState();

 

 

StringBuilder serializedList = new StringBuilder();

 

 

for (int i = 0; i < stateList.Count; i++)

 

{

serializedList.Append(stateList[i].ToString());

serializedList.Append(

"|");

 

}

positionsCookie.Expires =

DateTime.MaxValue;

 

positionsCookie.Value = serializedList.ToString();

}

}

 

 

protected void RadDock2_Command(object sender, DockCommandEventArgs e)

 

{

}

}




Thanks in advance.                    

Obi-Wan Kenobi
Top achievements
Rank 1
 answered on 09 Apr 2009
1 answer
169 views
Is it possible to buy only RAD Editor and not all the other Controls?
We need a good and stable Editor for our DNN site.

- Anders
Lidiya
Telerik team
 answered on 09 Apr 2009
1 answer
183 views
Hi Everyone,

I have a two grids, with drag and drop functionality.  The grids allow you to drag and drop rows to one another.  I'm having two issues that appear to be bugs, and I'm wondering if there is a work around or a fix.

1)  My first issue happens when I try to drag rows from the left hand side grid to the right hand side one.  The rows drag and drop over fine, but I'm having an issue with ordering/positioning them.  For example, if I want to drag a row from the left hand side grid to the right hand side one, and put that row in a certain position, it always adds it to the bottom of the grid as the last row.  Once it has been added over, I can reorder the rows, however, I'd like to put a row into any position I want on the initial drag and drop.

2) The second issue is a little bit different.  The issue only occurs on this behavior:
    -Drag and drop rows from the left hand side grid to the right one
    -Re-position the rows in the right hand grid
    -Change the page of the left hand grid (I have paging enabled since there about 500 rows)
    -The right hand side grid then populates with the same rows that are in the left hand side grid, and all other rows and paging     
      disappears

My code is below, any help is greatly appreciated!  Thanks.

HTML/JS

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MaintenanceConsists.aspx.cs" 
    Inherits="Web.MaintenanceConsists" %> 
 
<%@ 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></title
    <style type="text/css"
        html, body, form 
        { 
            height: 100%; 
            padding: 0px; 
            margin: 0px; 
            overflow: hidden; 
        } 
    </style> 
    <telerik:RadScriptBlock runat="server" ID="scriptBlock"
 
        <script type="text/javascript"
function onRowDropping(sender, args) 
    if (sender.get_id() == "<%=uxRadGridAvailable.ClientID %>") 
    { 
        var node = args.get_destinationHtmlElement(); 
        if(!isChildOf('<%=uxRadGridSelected.ClientID %>', node) && !isChildOf('<%=uxRadGridAvailable.ClientID %>', node) ) 
        { 
            args.set_cancel(true); 
        } 
    } 
    if (sender.get_id() == "<%=uxRadGridSelected.ClientID %>") 
    { 
        var node = args.get_destinationHtmlElement(); 
        if(!isChildOf('<%=uxRadGridAvailable.ClientID %>', node) && !isChildOf('<%=uxRadGridSelected.ClientID %>', node) ) 
        { 
            args.set_cancel(true); 
        } 
    } 
 
function isChildOf(parentId, element) 
    while(element) 
    { 
        if (element.id && element.id.indexOf(parentId) > -1) 
        { 
            return true; 
        } 
        elementelement = element.parentNode; 
    } 
    return false; 
 
function centerUpdatePanel() 
    centerElementOnScreen(document.getElementById("uxRadAjaxLoadingPanel")); 
 
function centerElementOnScreen(element) 
    var scrollTop = document.body.scrollTop; 
    var scrollLeft = document.body.scrollLeft; 
    var viewPortHeight = document.body.clientHeight; 
    var viewPortWidth = document.body.clientWidth; 
    if (document.compatMode == "CSS1Compat") 
    { 
     viewPortHeight = document.documentElement.clientHeight; 
     viewPortWidth = document.documentElement.clientWidth; 
     scrollTop = document.documentElement.scrollTop; 
     scrollLeft = document.documentElement.scrollLeft; 
    } 
    var topOffset = Math.ceil(viewPortHeight/2 - element.offsetHeight/2); 
    var leftOffset = Math.ceil(viewPortWidth/2 - element.offsetWidth/2); 
    var top = scrollTop + topOffset - 40; 
    var left = scrollLeft + leftOffset - 70; 
       element.style.position = "absolute"
    element.style.top = top + "px"; 
    element.style.left = left + "px"; 
        </script> 
 
    </telerik:RadScriptBlock> 
</head> 
<body> 
    <form id="form1" runat="server"
    <asp:ScriptManager ID="ScriptManager" runat="server" /> 
    <telerik:RadAjaxLoadingPanel IsSticky="true" ID="uxRadAjaxLoadingPanel" runat="server" 
        Height="75px" Width="75px"
        <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading1.gif") %>' 
            style="border: 0px;" /> 
    </telerik:RadAjaxLoadingPanel> 
    <telerik:RadAjaxManager runat="server" ID="uxRadAjaxManager"
        <ClientEvents OnRequestStart="centerUpdatePanel();"></ClientEvents> 
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="uxRadGridAvailable"
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="uxRadGridAvailable" LoadingPanelID="uxRadAjaxLoadingPanel" /> 
                    <telerik:AjaxUpdatedControl ControlID="uxRadGridSelected" LoadingPanelID="uxRadAjaxLoadingPanel" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="uxRadGridSelected"
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="uxRadGridAvailable" LoadingPanelID="uxRadAjaxLoadingPanel" /> 
                    <telerik:AjaxUpdatedControl ControlID="uxRadGridSelected" LoadingPanelID="uxRadAjaxLoadingPanel" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManager> 
    <telerik:RadSplitter ID="uxRadSplitter" runat="server" Width="100%" Height="100%" 
        Orientation="Horizontal" BorderSize="0" BorderStyle="None" Skin="Web20" VisibleDuringInit="False"
        <telerik:RadPane ID="uxRadPaneHeader" runat="server" Height="100px"
            Header Pane 
        </telerik:RadPane> 
        <telerik:RadSplitBar ID="uxRadSplitBarHeader" runat="server" CollapseMode="Forward" /> 
        <telerik:RadPane ID="uxRadPaneDetail" runat="server" Scrolling="None"
            <telerik:RadSplitter ID="uxRadSplitterDetail" runat="server" Skin="Web20" VisibleDuringInit="False"
                <telerik:RadPane ID="uxRadePaneLeft" runat="server"
                    <telerik:RadGrid runat="server" ID="uxRadGridAvailable" Skin="Office2007" OnNeedDataSource="uxRadGridAvailable_NeedDataSource" 
                        AllowMultiRowSelection="True" AutoGenerateColumns="False" OnRowDrop="uxRadGridAvailable_RowDrop" 
                        GridLines="None" Height="100%" Width="100%" BorderStyle="None" AllowPaging="True" 
                        PageSize="50"
                        <MasterTableView DataKeyNames="assetID" TableLayout="Fixed" Caption="Equipment" EnableNoRecordsTemplate="False"
                            <RowIndicatorColumn> 
                                <HeaderStyle Width="20px" /> 
                            </RowIndicatorColumn> 
                            <ExpandCollapseColumn> 
                                <HeaderStyle Width="20px" /> 
                            </ExpandCollapseColumn> 
                            <Columns> 
                                <telerik:GridBoundColumn DataField="assetID" HeaderText="Equipment ID" UniqueName="column"
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn DataField="category" HeaderText="Category" UniqueName="column1"
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn DataField="type" HeaderText="Type" UniqueName="column2"
                                </telerik:GridBoundColumn> 
                            </Columns> 
                            <SortExpressions> 
                                <telerik:GridSortExpression FieldName="assetID" /> 
                            </SortExpressions> 
                        </MasterTableView> 
                        <ClientSettings AllowRowsDragDrop="True"
                            <Selecting AllowRowSelect="True" EnableDragToSelectRows="true" /> 
                            <ClientEvents OnRowDropping="onRowDropping" /> 
                            <Scrolling AllowScroll="true" UseStaticHeaders="true" /> 
                        </ClientSettings> 
                        <HeaderContextMenu EnableTheming="True" Skin="Office2007"
                            <CollapseAnimation Duration="200" Type="OutQuint" /> 
                        </HeaderContextMenu> 
                        <PagerStyle Mode="NextPrevAndNumeric" /> 
                        <FilterMenu EnableTheming="True" Skin="Office2007"
                            <CollapseAnimation Duration="200" Type="OutQuint" /> 
                        </FilterMenu> 
                    </telerik:RadGrid> 
                </telerik:RadPane> 
                <telerik:RadSplitBar ID="uxRadSplitBarDetail" runat="server" /> 
                <telerik:RadPane ID="uxRadPaneRight" runat="server"
                    <telerik:RadGrid runat="server" ID="uxRadGridSelected" Skin="Office2007" OnNeedDataSource="uxRadGridSelected_NeedDataSource" 
                        Width="100%" AllowMultiRowSelection="True" AutoGenerateColumns="False" OnRowDrop="uxRadGridSelected_RowDrop" 
                        GridLines="None" BorderStyle="None" Height="100%"
                        <HeaderContextMenu EnableTheming="True" Skin="Office2007"
                            <CollapseAnimation Duration="200" Type="OutQuint" /> 
                        </HeaderContextMenu> 
                        <MasterTableView DataKeyNames="assetID" TableLayout="Fixed" Caption="Positions"
                            <RowIndicatorColumn> 
                                <HeaderStyle Width="20px" /> 
                            </RowIndicatorColumn> 
                            <ExpandCollapseColumn> 
                                <HeaderStyle Width="20px" /> 
                            </ExpandCollapseColumn> 
                            <Columns> 
                                <telerik:GridBoundColumn HeaderText="Equipment ID" DataField="assetID"
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn HeaderText="Category" DataField="category"
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn HeaderText="Type" DataField="type"
                                </telerik:GridBoundColumn> 
                            </Columns> 
                        </MasterTableView> 
                        <ClientSettings AllowRowsDragDrop="True"
                            <Selecting AllowRowSelect="True" EnableDragToSelectRows="true" /> 
                            <ClientEvents OnRowDropping="onRowDropping" /> 
                            <Scrolling AllowScroll="True" UseStaticHeaders="True" /> 
                        </ClientSettings> 
                        <FilterMenu EnableTheming="True" Skin="Office2007"
                            <CollapseAnimation Duration="200" Type="OutQuint" /> 
                        </FilterMenu> 
                    </telerik:RadGrid> 
                </telerik:RadPane> 
            </telerik:RadSplitter> 
        </telerik:RadPane> 
        <telerik:RadSplitBar ID="RadSplitBarFooter" runat="server" CollapseMode="Backward" /> 
        <telerik:RadPane ID="RadPaneFooter" runat="server" Height="50px"
            Footer Pane 
        </telerik:RadPane> 
    </telerik:RadSplitter> 
    </form> 
</body> 
</html> 
 

C#

using System; 
using TRMS.Utilities; 
using System.Data; 
using Telerik.Web.UI; 
using System.Web.UI.WebControls; 
using System.Collections.Generic; 
using TRMS.BLL; 
 
namespace Web 
    public partial class MaintenanceConsists : System.Web.UI.Page 
    { 
        #region GlobalVariables 
        string TableName = ""
        string Fields = ""
        #endregion 
        #region Events 
        protected void Page_Load(object sender, EventArgs e) 
        { 
            GetQueryString(); 
        } 
 
        protected void uxRadGridAvailable_NeedDataSource(object source, GridNeedDataSourceEventArgs e) 
        { 
            uxRadGridAvailable.DataSource = AvailableFields; 
        } 
        protected void uxRadGridSelected_NeedDataSource(object source, GridNeedDataSourceEventArgs e) 
        { 
            uxRadGridSelected.DataSource = SelectedFields; 
        } 
 
        protected void uxRadGridAvailable_RowDrop(object sender, GridDragDropEventArgs e) 
        { 
            DropRowAvailableGrid(e); 
        } 
 
        protected void uxRadGridSelected_RowDrop(object sender, GridDragDropEventArgs e) 
        { 
            DropRowSelectedGrid(e); 
        } 
        #endregion 
        #region Methods 
        private void GetQueryString() 
        { 
            TableName = Request.QueryString.Get("Table"); 
            Fields = Request.QueryString.Get("Fields"); 
        } 
 
        protected IList<Field> AvailableFields 
        { 
            get 
            { 
                try 
                { 
                    object obj = Session["AvailableFields"]; 
                    if (obj == null
                    { 
                        obj = GetAvailableFields(); 
                        if (obj != null
                        { 
                            Session["AvailableFields"] = obj; 
                        } 
                        else 
                        { 
                            obj = new List<Field>(); 
                        } 
                    } 
                    return (IList<Field>)obj; 
                } 
                catch 
                { 
                    Session["AvailableFields"] = null
                } 
                return new List<Field>(); 
            } 
            set { Session["AvailableFields"] = value; } 
        } 
 
        protected IList<Field> SelectedFields 
        { 
            get 
            { 
                try 
                { 
                    object obj = Session["SelectedFields"]; 
                    if (obj == null
                    { 
                        Session["SelectedFields"] = obj = new List<Field>(); 
                    } 
                    return (IList<Field>)obj; 
                } 
                catch 
                { 
                    Session["SelectedFields"] = null
                } 
                return new List<Field>(); 
            } 
            set { Session["SelectedFields"] = value; } 
        } 
 
        protected IList<Field> GetAvailableFields() 
        { 
            string AssetID = ""
            string Category = ""
            string AssetType = ""
 
            IList<Field> results = new List<Field>(); 
            if (!StringUtility.IsNullOrEmptyString(TableName) && !StringUtility.IsNullOrEmptyString(Fields)) 
            { 
                DataSet availableDataSet = MaintenanceConsistsBLLC.GetEquipmentAndTypes(TableName, Fields); 
                if (availableDataSet != null
                {        
                    try 
                    { 
                        foreach (DataRow dataRow in availableDataSet.Tables[0].Rows) 
                        { 
                            AssetID = dataRow["AssetID"].ToString(); 
                            Category = dataRow["Category"].ToString(); 
                            AssetType = dataRow["AssetType"].ToString(); 
                            results.Add(new Field(AssetID, Category, AssetType)); 
                        } 
                    } 
                    catch 
                    { 
                        results.Clear(); 
                    } 
                } 
                else 
                { 
                    results = null
                } 
            } 
            else 
            { 
                results = null
            } 
 
            return results; 
        } 
 
        private void DropRowAvailableGrid(GridDragDropEventArgs e) 
        { 
            if (string.IsNullOrEmpty(e.HtmlElement)) 
            { 
                if (e.DraggedItems[0].OwnerGridID == uxRadGridAvailable.ClientID) 
                { 
                    // items are drag from available to selected grid   
                    if ((e.DestDataItem == null && SelectedFields.Count == 0) || 
                        e.DestDataItem != null && e.DestDataItem.OwnerGridID == uxRadGridSelected.ClientID) 
                    { 
                        IList<Field> selectedFields = SelectedFields; 
                        IList<Field> availableFields = AvailableFields; 
                        foreach (GridDataItem draggedItem in e.DraggedItems) 
                        { 
                            Field tmpField = GetField(availableFields, (string)draggedItem.GetDataKeyValue("assetID")); 
                            if (tmpField != null
                            { 
                                selectedFields.Add(tmpField); 
                                availableFields.Remove(tmpField); 
                            } 
                        } 
                        SelectedFields = selectedFields; 
                        AvailableFields = availableFields; 
                        uxRadGridAvailable.Rebind(); 
                        uxRadGridSelected.Rebind(); 
                    } 
                    else if (e.DestDataItem != null && e.DestDataItem.OwnerGridID == uxRadGridAvailable.ClientID) 
                    { 
                        //reorder items in available  grid   
                        IList<Field> availableFields = AvailableFields; 
                        Field field = GetField(availableFields, (string)e.DestDataItem.GetDataKeyValue("assetID")); 
                        int destinationIndex = availableFields.IndexOf(field); 
                        List<Field> fieldsToMove = new List<Field>(); 
                        foreach (GridDataItem draggedItem in e.DraggedItems) 
                        { 
                            Field tmpField = GetField(availableFields, (string)draggedItem.GetDataKeyValue("assetID")); 
                            if (tmpField != null
                                fieldsToMove.Add(tmpField); 
                        } 
                        foreach (Field fieldToMove in fieldsToMove) 
                        { 
                            availableFields.Remove(fieldToMove); 
                            availableFields.Insert(destinationIndex, fieldToMove); 
                        } 
                        AvailableFields = availableFields; 
                        uxRadGridAvailable.Rebind(); 
                        e.DestDataItem.Selected = true
                    } 
                } 
            } 
        } 
 
        private void DropRowSelectedGrid(GridDragDropEventArgs e) 
        { 
            if (string.IsNullOrEmpty(e.HtmlElement)) 
            { 
                if (e.DraggedItems[0].OwnerGridID == uxRadGridSelected.ClientID) 
                { 
                    // items are drag from selected to available grid   
                    if ((e.DestDataItem == null && AvailableFields.Count == 0) || 
                        e.DestDataItem != null && e.DestDataItem.OwnerGridID == uxRadGridAvailable.ClientID) 
                    { 
                        IList<Field> availableFields = AvailableFields; 
                        IList<Field> selectedFields = SelectedFields; 
                        foreach (GridDataItem draggedItem in e.DraggedItems) 
                        { 
                            Field tmpField = GetField(selectedFields, (string)draggedItem.GetDataKeyValue("assetID")); 
                            if (tmpField != null
                            { 
                                availableFields.Add(tmpField); 
                                selectedFields.Remove(tmpField); 
                            } 
                        } 
                        AvailableFields = availableFields; 
                        SelectedFields = selectedFields; 
                        uxRadGridSelected.Rebind(); 
                        uxRadGridAvailable.Rebind(); 
                    } 
                    else if (e.DestDataItem != null && e.DestDataItem.OwnerGridID == uxRadGridSelected.ClientID) 
                    { 
                        //reorder items in selected  grid   
                        IList<Field> selectedFields = SelectedFields; 
                        Field field = GetField(selectedFields, (string)e.DestDataItem.GetDataKeyValue("assetID")); 
                        int destinationIndex = selectedFields.IndexOf(field); 
                        List<Field> fieldsToMove = new List<Field>(); 
                        foreach (GridDataItem draggedItem in e.DraggedItems) 
                        { 
                            Field tmpField = GetField(selectedFields, (string)draggedItem.GetDataKeyValue("assetID")); 
                            if (tmpField != null
                                fieldsToMove.Add(tmpField); 
                        } 
                        foreach (Field fieldToMove in fieldsToMove) 
                        { 
                            selectedFields.Remove(fieldToMove); 
                            selectedFields.Insert(destinationIndex, fieldToMove); 
                        } 
                        AvailableFields = selectedFields; 
                        uxRadGridSelected.Rebind(); 
                        e.DestDataItem.Selected = true
                    } 
                } 
            } 
        } 
 
        private static Field GetField(IEnumerable<Field> fieldsToSearchIn, string fieldName) 
        { 
            foreach (Field field in fieldsToSearchIn) 
            { 
                if (field.assetID == fieldName) 
                { 
                    return field; 
                } 
            } 
            return null
        } 
        #endregion 
        #region Nested type: Field 
        protected class Field 
        { 
            private string _assetID; 
            private string _category; 
            private string _type; 
 
            public Field(string assetID, string category, string type) 
            { 
                _assetID = assetID; 
                _category = category; 
                _type = type; 
            } 
            public string assetID 
            { 
                get { return _assetID; } 
            } 
            public string category 
            { 
                get { return _category; } 
            } 
            public string type 
            { 
                get { return _type; } 
            } 
        } 
        #endregion   
  
    } 



Rosen
Telerik team
 answered on 09 Apr 2009
1 answer
120 views
Dear sir,

I'm dynamic created RadDock and set the AutoPostBack = True. I need after drag&drop the RadDock, the RadDock save into database one by one (Not save the RadDockLayout). May I have some sample code in VB.NET. Thank in advanced.
Petio Petkov
Telerik team
 answered on 09 Apr 2009
1 answer
152 views
I want to desing the menu control . And speically i am looking for the propertites which can let me design the portion that extended downward after clicking the main link.  For example the menu above on this page. When you click the 'PRODUCTS ' the slection will extend downwords, So how I can design that part.  To be very specific when you click on the 'PRODUCTS' and look at the last selection of Telerik WebUI Test Studio, under neath the text there is no extra space is there.  And all of the different seleciton seem to have the same width . But the problem with mine that all the one have the same size, however the last one have extra space and has a doted line which gives extra space. I want to get rid of this.

Oh by the way, I am creating the menu dynamically, That means I don't have Item tags in my source file ,this being created  at run time from database.

Thanks,
Amir.
Princy
Top achievements
Rank 2
 answered on 09 Apr 2009
3 answers
316 views
I am already using the RadCodeBlock to allow server code to be embedded in the javascript markup, i.e.

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
   
<script language="javascript" type="text/javascript">
        
function AjaxReq(args) {
           $find("
<%= RadAjaxPanel1.ClientID %>").ajaxRequestWithTarget("<%= Button1.UniqueID %>", '');
         }
   
</script>
</
telerik:RadCodeBlock>

Is it possible to do the same thing with externally referenced javascript files?  i.e.

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
   
<script language="javascript" type="text/javascript" src="myscript.js"></script>
</
telerik:RadCodeBlock>
--------------------------------------------------------------------------------------------------------------------------------------------
MyScript.js

        function AjaxReq(args) {
           $find("
<%= RadAjaxPanel1.ClientID %>").ajaxRequestWithTarget("<%= Button1.UniqueID %>", '');
         }
--------------------------------------------------------------------------------------------------------------------------------------------


I don't want to put all my javascript in the aspx page itself, to allow re-use etc.

Thanks.
Dimo
Telerik team
 answered on 09 Apr 2009
2 answers
161 views
Hey.

I'm building my grid programmatic, and in my itembound method i need to do some lookups on spesific columns based on the Id.
So when i create the grid i need to specify which column is a lookup column.

I was hoping i could use attributes, but columns don't have this property.

public static void DefineColumn(string strFile, RadGrid hraGrid)   
{   
   hraGrid.ItemDataBound += new GridItemEventHandler(default_ItemDataBound);   
   
   GridBoundColumn myCol = new GridBoundColumn();   
   hraGrid.MasterTableView.Columns.Add(myCol);   
  
   myCol.attribute["Type"] = "TextLookup";  
  
   myCol.DataField = ;   
   myCol.UniqueName = strBuf;   
   myCol.SortExpression = strBuf;   
  
   GridBoundColumn myCol2 = new GridBoundColumn();   
   hraGrid.MasterTableView.Columns.Add(myCol);   
     
   myCol2.DataField = ;   
   myCol2.UniqueName = strBuf;   
   myCol2.SortExpression = strBuf;          
}   

itembound method
foreach (GridColumn col in e.Item.OwnerTableView.RenderColumns) 
{           
    if (col.type == "TextLookup") 
    {      
      item[0].Text = (string)getText(iTextID); 
    } 

Princy
Top achievements
Rank 2
 answered on 09 Apr 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?