Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
92 views
Hi,

Background:
in my asp.net 4.0 app (ajaxified) I reload content of tree on every postback.

Scenario:
2 users load same tree. First two items are ItemA and ItemB, so, user1 right clicks and deletes ItemA, his view is refreshed and he can see that there is no more ItemA. User2 thinks that he doesn't like ItemA he sees (in his already outdated view), right clicks -> Delete and instead of deleting nonexistent ItemA, ItemB gets deleted, because underneath tree was reloaded in Page_Load and context menu's index remained same, but node changed.

I get referenced node id to delete in
protected void tvProjectElements_ContextMenuItemClick(object sender, RadTreeViewContextMenuEventArgs e) {    }
from e.Node.Value

Suggestion:
Maybe for current (or in general) use case context menus should reference to nodes not by index, but by some internal "node-context menu (item) key"? Or this could be configurable, like setting custom key (most likely same as using custom attributes) or fetch node's DataValueField, anyway, to make them correspond to each other.

Possible workaround:
When I will get back to solving this issue, probably I will give a try to fix this using custom attributes (e.MenuItem.Attributes), setting those in data bound event for each nodes' context menu and checking in ContextMenuItemClick by comparing to e.Node.Value value.

Thanks :)
Plamen
Telerik team
 answered on 02 Nov 2011
1 answer
40 views
When double click into an appointment and edit the description, if the text contain "<text>" then the controller isn'ta able to save anything due to an error.  This seems like a bug.  I'm using the latest version of the dll.  This even happens on your demo site.  Is there a way around it?  Basically try putting "<xxx>" where xxx can be any letter.  Interestingly, if xxx is a number, it will work.

Thanks,
Eddie
Plamen
Telerik team
 answered on 02 Nov 2011
1 answer
107 views
Hi

I have a combobox that displays a longer description of the TextField when open than it displays when collapsed. I achieve this using an Item Template as below:

<telerik:RadComboBox ID="cmbP9" Runat="server" DataTextField="Code" DataValueField="P9CodeID" 
                ToolTip="P9" Width="200" DropDownWidth="400px" HighlightTemplatedItems="true">
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
   <ItemTemplate>
       <span>
       <asp:Literal runat="server" ID="litCode" Text='<%# Eval( "Code" )%>'></asp:Literal>
                     - 
      <asp:Literal runat="server" ID="litTitle" Text='<%# Eval( "Title" )%>'></asp:Literal>                    
       </span>
       <br />
   </ItemTemplate>
</telerik:RadComboBox>

I want to now be able to create a combobox like this entirely from code. How can I create an Item Template as above from code or is there another way of achieving the same thing?

Cheers

Stewart
Kalina
Telerik team
 answered on 02 Nov 2011
8 answers
153 views
I try to export a simple grid without any success

to excel - it only give me the current page when ignorpaging = false and none when ignorepaging = true

to pdf - it give me an error of unsupported file type.

How do I resolve this?
Lan
Top achievements
Rank 1
 answered on 02 Nov 2011
1 answer
52 views
Combobox selected values are not persisting on pressing Browser "Back" button.Is there any work around for this?
Kalina
Telerik team
 answered on 02 Nov 2011
2 answers
67 views

We have a text element on the left hand side, and a button on the right hand side of the treeview row.   We want to use a context menu which only gets activated when the blue image button is clicked.   What actually happens is the context menu is activated when we click anywhere on the treeview row (see picture attached).

We are using this nodetemplate in the RadTreeView with a context menu.

<NodeTemplate>
    <div style="width:100%;height:22px;">
        <span style="float:left;font-family:Arial;font-weight:bold;font-size:13px;">
        <%# DataBinder.Eval(Container, "Text") %>
        </span>
    <img class="treeGear" src="../img/gearsbluebtn.png" alt="Options" width="38px" height="22px" />
    </div>
</NodeTemplate>

 

How can we limit the context menu to only activate when the blue button is clicked? 

Marcus
Top achievements
Rank 1
 answered on 02 Nov 2011
5 answers
97 views
If I add a textbox or radtextbox to a template, you can't set focus to the textbox to enter text..  This work with IE7.  Testing failed with FF 3.6.1 and FF 4.01.

easy to reproduce:

<telerik:RibbonBarTemplateItem ID="templatetextbox">
    <Template>
        <asp:TextBox runat="server" ID="txtTest"></asp:TextBox>
    </Template>
</telerik:RibbonBarTemplateItem>
Kate
Telerik team
 answered on 02 Nov 2011
10 answers
407 views
Hi!
  I am using Telerik ASP.NET Ajax Controls  2011.2.712.40 on .NET 4.0 framework. In that I am facing an issue while using new feature of RadComboBox as Checkbox for multiple selection. It doesnt work fine on many browsers as I am unable to check check boxes. Below is the code snippet.


(In .aspx Page)

<telerik:RadComboBox ID="rdcmb" CheckBoxes="true" runat="server"
 EmptyMessage="Status"  DropDownWidth="200px"
 MaxHeight="140px"  Width="200px">
 </telerik:RadComboBox>

(In .aspx.cs)

if (rdcmb.CheckedItems != null)
            {
                status = string.Empty;
                var sb = new StringBuilder();
                var collection = rdcmb.CheckedItems;
                foreach (var item in collection)
                    sb.Append(item.Value + ",");
                String ApplicationVariable= sb.ToString();
            }
Kalina
Telerik team
 answered on 02 Nov 2011
10 answers
293 views
in the samples of the aps.net ajax controls under listview there is an application scenario called Image Gallery.

I have been trying to reduplicate this application and i am using vb.net. i followed all the tutorials and steps, but when i compile the app i get an error that Photo is not defined

<%@ Import Namespace="Data" %>
<%@ Import Namespace="Photo" %>

Data

Imports System
Imports System.Collections.Generic
Imports System.Drawing.Imaging
Imports System.IO
Imports System.Linq
Imports System.Web
Imports System.Drawing
  
Namespace Data
    Public NotInheritable Class DataProvider
        Private Sub New()
        End Sub
        <ThreadStatic()> _
        Private Shared _photos As List(Of Photo)
  
        Public Shared Function GetData() As IList(Of Photo)
            If _photos IsNot Nothing Then
                Return _photos
            End If
  
            _photos = New List(Of Photo)()
            For Each files As String In Directory.GetFiles(HttpContext.Current.Server.MapPath("~/Images"))
                Dim photo = New Photo() With { _
                    .Name = Path.GetFileName(files) _
                }
  
                Dim image__1 As Image = Image.FromFile(files)
                Using memoryStream = New MemoryStream()
                    image__1.Save(memoryStream, ImageFormat.Png)
                    photo.Data = memoryStream.ToArray()
                End Using
                _photos.Add(photo)
            Next
            Return _photos
        End Function
  
        Public Shared Sub Update(ByVal photoId As Integer, ByVal name As String)
            Dim first As Photo = _photos.FirstOrDefault(Function(p) p.Id = photoId)
  
            If first IsNot Nothing Then
                first.Name = name
            End If
        End Sub
    End Class
  
      
End Namespace

Photo
Public Class Photo
    Private Shared ReadOnly _key As New Object()
    Private Shared _counter As Integer
  
    Public Sub New()
        Id = GetId()
    End Sub
  
    Public Property Name() As String
        Get
            Return m_Name
        End Get
        Set(ByVal value As String)
            m_Name = Value
        End Set
    End Property
    Private m_Name As String
    Public Property Data() As Byte()
        Get
            Return m_Data
        End Get
        Set(ByVal value As Byte())
            m_Data = Value
        End Set
    End Property
    Private m_Data As Byte()
    Public Property Id() As Integer
        Get
            Return m_Id
        End Get
        Private Set(ByVal value As Integer)
            m_Id = Value
        End Set
    End Property
    Private m_Id As Integer
  
    Protected Shared Function GetId() As Integer
        SyncLock _key
            _counter += 1
        End SyncLock
        Return _counter
    End Function
End Class



<ItemTemplate>
                    <fieldset style="float: left; margin: 5px 5px 5px 5px; padding: 2px 2px 2px 2px;
                        background: #eeeeee" class="myClass" onmouseover="containerMouseover(this)" onmouseout="containerMouseout(this)">
                        <telerik:RadBinaryImage Style="cursor: pointer;" runat="server" ID="RadBinaryImage1"
                            DataValue='<%#Eval("Data") %>' Height='<%#ImageHeight %>' Width="<%#ImageWidth %>"
                            ResizeMode="Fit" onclick="<%#CreateWindowScript(DirectCast(Container.DataItem, Photo)) %>"
                            AlternateText="Click to view larger image" ToolTip="Click to view larger image" />
                        <br />
                        <div style="margin-top: -30px; position: fixed; display: none; width: <%#ImageHeight.Value/1.5 %>px;">
                            <asp:TextBox runat="server" ID="TextBox1" Text='<%#Bind("Name") %>' CssClass="txt"
                                OnTextChanged="TextBox1_TextChanged" AutoPostBack="true" ToolTip="Edit image name" />
                        </div>
                    </fieldset>
                </ItemTemplate>


What am i missing here..

Thanks in Advanced

TClemons
Maria Ilieva
Telerik team
 answered on 02 Nov 2011
4 answers
180 views
Hi,

Simple request. I would like to remove the border around the panelbar. It would appear that if I set the BorderWidth="0" does not do it.

Example of what I am trying shown below:-

        <telerik:RadPanelBar ID="RadPanelBar1" runat="server" Skin="Outlook" BorderWidth="0px">  
            <Items> 
                <telerik:RadPanelItem Text="Locations" Expanded="true" BorderWidth="0px">  
                    <ItemTemplate><p>Hello Telerik</p></ItemTemplate>      
                </telerik:RadPanelItem> 
            </Items> 
        </telerik:RadPanelBar> 
 

Is there a Css style I need to override instead?

Thanks,
Martin
Brian Azzi
Top achievements
Rank 2
 answered on 02 Nov 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?