Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
108 views
I'm trying to bind data from a two-dimensional List structure to a grid but its not working out.  This is what I'm trying to do in the NeedDataSource event for my grid:

            List<List<object>> rows = new List<List<object>>();  
 
            List<object> list1 = new List<object>();  
            list1.Add("testing1");  
            list1.Add("testing2");  
            List<object> list2 = new List<object>();  
            list2.Add("testing3");  
            list2.Add("testing=42");  
            rows.Add(list1);  
            rows.Add(list2);  
            radGrid.DataSource = rows; 

I'm hoping to get output that looks like:

testing1   testing2
testing3   testing=42

Instead I get:

Capacity  Count
4               2
4 2

Can anyone tell me how I can do something like this without using a DataSet or DataReader?
Rubens
Top achievements
Rank 1
 answered on 21 Jun 2009
4 answers
87 views
Hi,
I have an aspx with a submit button which open a radWindow on click (server side) using the following lines:

 

InfoWind.NavigateUrl = "../Meida/InfoContent.aspx + dataObj.ToString();  
InfoWind.VisibleOnPageLoad = true 


where InfoWind is the RadWindow.
In the page that pops up in the window there is a button which closes the window on click calling the following javascript function:

            function WindowClose()  
            {  
                var oWindow = null;  
                if (window.radWindow)   
                    oWindow = window.radWindow;  
                else   
                    if (window.frameElement.radWindow)   
                        oWindow = window.frameElement.radWindow;  
                oWindow.close();  
            } 

the code works fine and then the user gets the main window again.
on that screen there is also a HyperLink control which navigates to a classic asp page which I don't have control over.
My problem is on this scenario:

  1. the user open the pop up mentioned above by using a submit button
  2. then uses the WindowClose to close the pop up and return to the main window
  3. clicks the HyperLink on the main Window and gets transffered to an asp page.
  4. clicks the browser's Back button to go back to the original main window

 

in this case the excpected behavior is to get the main window, but what actually happens is that the main window is displayed and right after  that the pop up opens up again...

Here is the RadWindow and RadWindowManager definitions on the main page:

<telerik:RadWindowManager  
     EnableEmbeddedSkins="False" KeepInScreenBounds="True" DestroyOnClose="True" 
       Behaviors="Close"  Skin="ReformaSkin"   
        VisibleStatusbar="False"  ID="windowManager"  runat="server" Behavior="Close"   
        InitialBehavior="Maximize"   
        Left="" style="display: none;"  Top="">  
            <windows> 
                <telerik:RadWindow ID="InfoWind" runat="server" Behaviors="Close, Maximize"   
                    DestroyOnClose="true" EnableEmbeddedSkins="False"   
                    InitialBehavior="Close, Maximize" Left="" NavigateUrl="" Skin="ReformaSkin"   
                    style="display:none;" Modal="false" Top="" RestrictionZoneID="frnHotz"  > 
                </telerik:RadWindow> 
            </windows> 
    </telerik:RadWindowManager> 


Please tell me what am I doing wrong?

Thanx,
Revital
Revital Keren
Top achievements
Rank 1
 answered on 21 Jun 2009
1 answer
60 views
Hi, I am evaluating the demo and I am trying to realize one of my client's ideas. Dynamically creating docs by dragging images from a palette down to the dock zone.

I am using your dynamic dock example and a hidden Dock when you drop the hidden dock I do not dock that one but instead create the appropriate dock in server code.

I use the code below to move the hidden dock to the handle object. Unfortunately this breaks as soon as I start dragging, obviously because the position is not updated from the current setting of clientHeight and Width but rather from the original position of the dock at the time of the mouseDown. Is there a smart way to get past this. I actually think my clients idea is quite smart, to have a number of code blocks that is used as templates that you can drag new docks from. I am very impressed with the Telerik suite, to solve this would just be the icing of the cake for my presentation :)

/Magnus

            var obj = document.getElementById("Handle_" + dock.get_id()); 
            var output = new Object(); 
            var mytop = 0, myleft = 0; 
            output.width = obj.clientWidth; 
            output.height = obj.clientHeight; 
 
            while (obj) { 
                mytop += obj.offsetTop; 
                myleft += obj.offsetLeft; 
                obj = obj.offsetParent; 
            } 
            output.left = myleft; 
            output.top = mytop; 
            dock.set_top(output.top); 
            dock.set_left(output.left); 
            dock.set_width(output.width); 
            dock.set_height(output.height); 

SungamRammah
Top achievements
Rank 1
 answered on 21 Jun 2009
5 answers
193 views
Hi,

Is there a way to set the PanelBar up with the DataNavigateUrlField so that clicking on the item will open the page in a new window?

Thanks,
Dan
Dan
Top achievements
Rank 1
 answered on 20 Jun 2009
1 answer
89 views
Hello i am using Radeditor in my application using that i want sent the mail.  I can type the content in rad content area and applying the
bold  / Italic / Underline effect to the Text ... and adding some enter but when i sent the mail that time mail sending properly but it send the HTML content ............ HOw to send the formated text.

The Content Area Content

Hello How are you

Thanks


Regards
Rahul Mahajan

--------------------------------------------------------------------------------------

And the Code Behind Code

  mails.Body() = RadEditor1.Content.ToString

----------------------------------------------------------------------------------------------------
and the mailed content is



<strong><em><span style="text-decoration: underline;">Hello How are you</span></em></strong> <br />
<br />
<br />
<em>Thanks</em> <br />
<br />
<strong>Regards <br />
Rahul Mahajan</strong>



How to achieve this  ? Help me Urgent !!!!!!!

Mark Fitzpatrick
Top achievements
Rank 1
 answered on 20 Jun 2009
0 answers
63 views
Hi Telerik Team,

 I want to explicitly give file path to 'telerik:RadUpload' in javascript. i.e without browsing.
For example i have two RadUpload controls,so once if i get the path in the first Raduploader i have to pass the same path to the second Raduploader. 

Thanks in advance.
Bindhu
Top achievements
Rank 1
 asked on 20 Jun 2009
2 answers
298 views
Hi All

I have radgrid with employee informations

There some fields like (first name, middle name, last name, dob, address, doj, designation,username password and status(active/inactive))

The active/inactive is a check box.

<

telerik:RadGrid ID="RadGrid1" runat="server" Skin="WebBlue"  GridLines="None" AllowPaging="True" AllowSorting="True" Width="97%" AutoGenerateColumns="False" ShowStatusBar="true" OnPreRender="RadGrid1_PreRender" OnNeedDataSource="RadGrid1_NeedDataSource"  OnUpdateCommand="RadGrid1_UpdateCommand" OnInsertCommand="RadGrid1_InsertCommand" OnDeleteCommand="RadGrid1_DeleteCommand">

 

 

 

My problem is.

When a employee logins, he should not be able to change his status(active/inactive) .

So is there any way to change the enable option to false for the check box(active/inactive) in edit mode only for the logged in user.

Thank u in advance

-Anto

Anto (DLL Version : 2008.3.1314.35)
Top achievements
Rank 2
 answered on 20 Jun 2009
2 answers
96 views

Hi All

I have a radgrid.

With the option of automatic Insert/Update/Delete.

It works fine.

There are five fields. The first one is modificationNum

 

I need is:

 

This field should not be able to modify while edit is clicked, But it must be able to enter data while insert.

 

Is there any option for this.

 

-Anto

Anto (DLL Version : 2008.3.1314.35)
Top achievements
Rank 2
 answered on 20 Jun 2009
2 answers
263 views
Hi,

I'm currently using 5 RadDocks placed in a RadDockZone. They are declared in the front code and I use code-behind functions to save and load their state when needed.

Right now, if I move dock A atop of dock B, dock A stays behind dock B (assuming dock B started with a higher zIndex). What I would like, is having a dock being moved over another dock to get in front of it. Actually, even just clicking on a dock (more exactly on its title bar) should "bring it to front".

Additionally, this order needs to be saved/loaded just like the dock state.

Is there an (easy) way to accomplish this (client-side preferred of course)?

You'll find below code relevant to the save/load processes as well as the docks declaration.

Thanks in advance,
Nicolas



    Protected Sub SaveDockLayout() 
        Dim tConnection As New SqlConnection(ConfigurationManager.ConnectionStrings("Infinis_Connection").ConnectionString) 
 
        Dim tDockState As String 
        Dim tSerializer As New Script.Serialization.JavaScriptSerializer() 
        Dim tConverters As New List(Of Script.Serialization.JavaScriptConverter)() 
        tConverters.Add(New UnitConverter()) 
        tSerializer.RegisterConverters(tConverters) 
 
        Dim tStateList As List(Of DockState) = docks_DockLayout.GetRegisteredDocksState() 
        Dim tSerializedList As New StringBuilder() 
        Dim i As Integer = 0 
 
        While i < tStateList.Count 
            tSerializedList.Append(tSerializer.Serialize(tStateList(i))) 
            tSerializedList.Append("|") 
            System.Math.Max(System.Threading.Interlocked.Increment(i), i - 1) 
        End While 
 
        tDockState = tSerializedList.ToString() 
        If tDockState.Trim() <> [String].Empty Then 
            Try 
                tConnection.Open() 
                Dim tCommand As New SqlCommand([String].Format("UPDATE SystemUser set DocksPosition='{0}' WHERE RecId = {1}", tDockState, Session("CurrentSession_UserId")), tConnection) 
                tCommand.ExecuteNonQuery() 
                tConnection.Close() 
            Catch 
            End Try 
        End If 
    End Sub 

    Protected Sub LoadDockLayout() 
        Dim tConnection As New SqlConnection(ConfigurationManager.ConnectionStrings("Infinis_Connection").ConnectionString) 
 
        Dim tDock As RadDock = Nothing 
        Dim tSerializer As New Script.Serialization.JavaScriptSerializer() 
        Dim tConverters As New List(Of Script.Serialization.JavaScriptConverter)() 
        tConverters.Add(New UnitConverter()) 
        tSerializer.RegisterConverters(tConverters) 
 
        'Get saved state string from the database - set it to dockState variable for example  
        Dim tDockState As String = "" 
        Try 
 
            tConnection.Open() 
            Dim tCommand As New SqlCommand("SELECT DocksPosition FROM SystemUser WHERE RecId = @RecId", tConnection) 
            tCommand.Parameters.AddWithValue("RecId", Session("CurrentSession_UserId")) 
            tDockState = tCommand.ExecuteScalar().ToString() 
            tConnection.Close() 
        Catch 
        End Try 
 
        Dim tCurrentDockStates As String() = tDockState.Split("|"c) 
        For Each tStringState As String In tCurrentDockStates 
            If tStringState.Trim() <> String.Empty Then 
                Dim tState As DockState = tSerializer.Deserialize(Of DockState)(tStringState) 
                tDock = DirectCast(docks_DockLayout.FindControl(tState.UniqueName), RadDock) 
                tDock.ApplyState(tState) 
            End If 
        Next 
    End Sub 

        <telerik:RadDockLayout runat="server" ID="docks_DockLayout" EnableViewState="false" StoreLayoutInViewState="false"> 
                 
            <telerik:RadDockZone runat="server" ID="docks_Dockzone" Orientation="Vertical" MinWidth="300px" MinHeight="500px" Style="position:absolute; top:30px; left:0px;"> 
             
                <telerik:RadDock ID="dock_Product" runat="server" Width="300px" Height="200px" Top="200px" ExpandedHeight="200" 
                    Left="200px" Title="Products" CssClass="style_DockPanels" Skin="Black" 
                     Resizable="true" DefaultCommands="All" Closed="false" Collapsed="true" OnClientCommand="DockProduct_ClientCommand" > 
                    <ContentTemplate> 
                        <telerik:RadTreeView ID="tree_Product" Height="100%" Width="100%" runat="server" 
                            OnNodeExpand="tree_NodeExpand"  
                            ShowLineImages="true"  
                            EnableDragAndDrop="true" 
                            EnableDragAndDropBetweenNodes="false" 
                            Skin="Black"  
                            SingleExpandPath="true" 
                            LoadingStatusPosition="AfterNodeText"  
                            OnClientNodeDropping="Tree_NodeDropping" OnClientNodeDragStart="Tree_NodeDragStart" /> 
                    </ContentTemplate> 
                </telerik:RadDock> 
 
                [there's 4 others just like that] 
Nicolas
Top achievements
Rank 1
 answered on 20 Jun 2009
3 answers
648 views

In our system, the user can choose a minute input interval.  So, if a user chooses every 15 minutes, they would only be allowed to enter 00, 15, 30, or 45 in the minute’s field.  Using the RadTimePicker, what is the easiest way to achieve this behavior?

 

Also, how do I change the RadTimePicker from am/pm to 24 hour time format programmatically?

Daniel
Telerik team
 answered on 19 Jun 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?