Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
130 views
I have the following definition for a RadToolBar:
<telerik:RadToolBarDropDown  Text="Export Options">
    <Buttons>
        <telerik:RadToolBarButton runat="server" ImageUrl="~/_assets/images/report/excel.png" ToolTip="Export to Excel" />
        <telerik:RadToolBarButton runat="server" ImageUrl="~/_assets/images/report/csv.png" ToolTip="Export to CSV (Raw Data Dump)" />
    </Buttons>
</telerik:RadToolBarDropDown>

For some reason these items won't show up (see attachment). The parent RadToolBar instance is using the Windows7 skin, although I also tried the Vista skin and no luck there either. There is no data binding on this toolbar - all items are static and the RadToolBarDropDown in question is at the root level (inside the main <Items> collection). I'm on Q2 2011.

Thoughts?
digitall
Top achievements
Rank 1
 answered on 09 Nov 2011
2 answers
118 views
Hi All,

I am using the technique show in this forum to refresh a RadGrid on a RadWindow close:

http://www.telerik.com/community/forums/aspnet-ajax/window/refresh-radgrid-on-close-of-radwindow.aspx

This works like a charm.  :)  My challenge is, however, while the grid refreshes itself beautifully, the context menu targeting the grid "disables" itself.  Specifically, when the user right-clicks, nothing happens at all.

When I refresh the page, the context menu "re-enables" itself, and I'm back off to the races.  

To resolve this, I've tried to DataBind the context menu in the Code Behind (in the AjaxRequest procedure as show in the forum post above).  But, that did not help.

So, I think my specific question is how do I "reactivate" a context menu targeting a RadGrid after I run the procedure shown in the forum post above?  

Thanks you very much for any help that you can provide.

Jim
James
Top achievements
Rank 1
 answered on 09 Nov 2011
5 answers
86 views
When I enter text in the RadEditor for SharePoint 2010 (a page content field), highlight the text and select Heading 1 from the menu, and then press enter, the new line is still within the H1 element (and has similar styles applied).

I expected that the H1 element would be closed (unless I specifically extended it by pressing shift+enter).

I have demonstrated this behavior on my trial install of RadEditor for SharePoint (as well as on the Telerik demo at http://sharepoint.telerik.com/aspnet-ajax/web-parts/Pages/Content-Editor-Web-Part-using-RadEditor.aspx), in IE8 and Chrome 15. (Behavior is as expected in Firefox 7.)

Unfortunately, this is the same as the behavior of SharePoint 2010's default rich-text editor. I reported the behavior to Microsoft (see http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010general/thread/49f4276d-c709-43ad-9ebd-e5fc44c1b4f4/), which they say they will address in a future update. This is the primary reason why I am evaluating 3rd-party rich-text editors.

Are there any workarounds for this behavior?
Rumen
Telerik team
 answered on 09 Nov 2011
1 answer
84 views
Hi
I have a radgrid.
When I'm sorting the fields the grid height is changing and  headertext also changing like if headertext is in two words
after click the column words showing one on another.
I have to display time into two line, so I hardcoded the headertext width.
When grid load initially its showing date correctly, but if I do soting its not showing date correctly as I expected.
Like this if I sort one column other getting affected.
.I have this problem in two grid.
here is my code.
Please help me as soon as possible
<telerik:RadAjaxPanel ID="callogRadPnl" runat="server">
       <telerik:RadGrid  ID="callogGrd" style="border:0; margin-top:-20px;" runat="server" AllowSorting="true"   PageSize="5" AllowPaging="true" Width="99%"  
                                CssClass="gridView1" AutoGenerateColumns="false"  
                    onitemcommand="callogGrd_ItemCommand1" onitemcreated="callogGrd_ItemCreated" AllowFilteringByColumn="true" 
                                        onneeddatasource="callogGrd_NeedDataSource" 
                                oninit="callogGrd_Init">
       <MasterTableView>
       <HeaderStyle HorizontalAlign="Left" Height="10px" />
       <ItemStyle Font-Names="Arial" Font-Size="12px" ForeColor="#000000"/>      
       <AlternatingItemStyle Font-Names="Arial" Font-Size="12px" ForeColor="#000000"/>
       <PagerStyle Mode="NumericPages"/>
       <Columns>
       <telerik:GridBoundColumn DataField="BeginTime" HeaderText="Begin" SortExpression="BeginTime" HeaderStyle-Width="150px" FilterControlWidth="55px"/>
       <telerik:GridBoundColumn DataField="EndTime" HeaderText="EndTime" SortExpression="EndTime" HeaderStyle-Width="180px" AllowFiltering="false" />
       <telerik:GridBoundColumn DataField="DispatcherName" HeaderText="Dispatcher" SortExpression="DispatcherName" FilterControlWidth="55px"/>
       <telerik:GridBoundColumn DataField="ConsoleName" HeaderText="Console" SortExpression="ConsoleName" FilterControlWidth="55px" AllowFiltering="true"/>
       <telerik:GridBoundColumn DataField="EndpointName" HeaderText="Endpoint" SortExpression="EndpointName" FilterControlWidth="55px"/>
       <telerik:GridBoundColumn DataField="CallType" HeaderText="CallType" SortExpression="CallType" FilterControlWidth="55px"  HeaderStyle-Width="130px" />
       <telerik:GridBoundColumn DataField="CallData" HeaderText="CallData" SortExpression="CallData" AllowFiltering="false"/>
       <telerik:GridBoundColumn DataField="TimeToAnswer" HeaderText="AnswerTime" SortExpression="TimeToAnswer" AllowFiltering="false" />
       <telerik:GridBoundColumn DataField="CallDuration" HeaderText="Duration" SortExpression="CallDuration" UniqueName="calDuration" AllowFiltering="false"/>
       </Columns>
       </MasterTableView>
       <ExportSettings Csv-FileExtension="Csv" Csv-RowDelimiter="NewLine">
       </ExportSettings>
       </telerik:RadGrid>
      </telerik:RadAjaxPanel>
Pavlina
Telerik team
 answered on 09 Nov 2011
1 answer
240 views
Hi.

I need to load text to RadEditor from database that can be changed by user from website. The problem is that default text colour must be black, and all changes that user makes must be in red colour only. How can I achieve this? I tried to use something like

function OnClientSelectionChange(editor, args) {
    editor.get_document().execCommand("ForeColor", false, "Red");
}

But in this case font colour changes to red event when user select some part of the text with mouse or with keyboard, and that is totally wrong. I also tried to handle "keydown" event for the content area, but in this case each symbol is wrapped by span tag, so I get something like

<span style="font: red;">r<span style="font: red;">e<span style="font: red;">s</span></span><span>

And this is incorrect to, also, it causes problems with performance in the case of long text. Could someone please help me with this issue?
Rumen
Telerik team
 answered on 09 Nov 2011
6 answers
469 views
How can I disable the hover and selected style from a TreeView?
I found this thread ( http://www.telerik.com/community/forums/thread/b311D-bdakad.aspx ) talking about a HoveredCssClass ans SelectedCssClass property, but I didn't find these properties.

[]'s,

Henrique
Kate
Telerik team
 answered on 09 Nov 2011
4 answers
65 views
Hi,

I am having some troubles with the 2011 R2 version of the components. I was using the ones from the 2010R2 and it was working fine. But I got a few days ago the newer version and i used the upgrade wizard.
Once I tried to launch my app, my login page didn't have neither css nor javascript and I got that javascript error :

Erreur : La feuille de style http://url/Common.css n'a pas été chargée car son type MIME, « text/html Â», n'est pas « text/css Â»

That text says that the stylesheet found has a "text/html mimetype but is waiting for a "text/css" one

I also realised with firebug, that the css stream I got from the server was not a css file, but the entire html page. However, once I was logged in, everything worked well, and including when i logged out.

So I looked for what changes did the wizard and I saw that the runAllManagedModulesForAllRequests attribute set to true in the module section of the web.config (System.webServer -> modules) was the origin of the problem. Once deleted, it works well.

My question is, why do I get those problems with this attribute? Do I need it anyway?

Thanks for reply
Iana Tsolova
Telerik team
 answered on 09 Nov 2011
2 answers
52 views
Hello,

When a header item is expanded and the user enters edit mode on any item under that header, the group collapses.  After re-expanding the header, the item is in edit mode.  Is this behavior by design?  If so, is there a way (VB.Net) around it?  Thanks! 
Jim
Top achievements
Rank 1
 answered on 09 Nov 2011
2 answers
92 views
I have a RadGrid bound to a query result. One of the query fields is an Id value which I use as the DataField value in several GridBoundColumn columns. I've overriden GridBoundColumn.FormatDataValue so I can use the Id to look up an object in a session state collection. Depending on the column's HeaderText value, FormatDataValue returns different properties of the retrieved object.

This all works lovely, except sorting is based on the Id value, not on what's actually in the grid. Furthermore, the UI indicates that all the Id-based columns are the same, presumably because they have the same DataField value. In the attached screenshot, I clicked on the City column. I would expect Chicago to sort ahead of London and Washington, but the rows are sorted by Address Id and the UI shows all the Address Id-based columns as currently sorted.

How can I revise things to make sorting work as I would expect?

Code to reproduce the problem follows.

Please note: I'm not looking for an answer that says, "flatten your data before putting it in the grid." I understand that I could do that. Remember this is a trivial example of a much more complex application. I do not want to avoid the issue I've presented; I want to solve it.

Thank you kindly!

ASPX code:
<%@ Page Language="VB" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register TagPrefix="xx" Namespace="Example" %>
<%@ Import Namespace="System.Linq" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<script runat="server">
 
   Protected Sub grdExample_NeedDataSource(ByVal sender As Object, ByVal e As GridNeedDataSourceEventArgs)
      Dim Landmarks() As Landmark
       
      Landmarks = {New Landmark With {.Name = "Wrigley Field", .AddressId = 3}, _
                   New Landmark With {.Name = "British PM Residence", .AddressId = 1}, _
                   New Landmark With {.Name = "Hofbräuhaus", .AddressId = 4}, _
                   New Landmark With {.Name = "Whitehouse", .AddressId = 2}}
 
      grdExample.DataSource = Landmarks
       
   End Sub
    
   Protected Sub Page_Init(ByVal sender As Object, ByVal e As EventArgs)
 
      If CType(Session.Item("addrCollection"), Address()) Is Nothing Then
         Call Session.Add("addrCollection", _
            {New Address With {.Id = 1, .Street = "10 Downing St", .City = "London", .PostalCode = "SW1A 2AA", .Province = "England", .Country = "UK"}, _
             New Address With {.Id = 2, .Street = "1600 Pennsylvania Ave NW", .City = "Washington", .PostalCode = "20500", .Province = "District of Columbia", .Country = "USA"}, _
             New Address With {.Id = 3, .Street = "1060 W. Addison St", .City = "Chicago", .PostalCode = "60613", .Province = "Illinois", .Country = "USA"}, _
             New Address With {.Id = 4, .Street = "Am Platzl 9", .City = "Munich", .PostalCode = "D-80331", .Province = "Bavaria", .Country = "Germany"}})
      End If
       
   End Sub
 
   </script>
 
   <head runat="server">
      <title>Sorting Issue</title>
   </head>
   <body>
      <form id="form1" runat="server">
         <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
         <div>
            <telerik:RadGrid ID="grdExample" runat="server" OnNeedDataSource="grdExample_NeedDataSource" AllowSorting="true" AutoGenerateColumns="false" >
               <MasterTableView>
                  <Columns>
                     <telerik:GridBoundColumn DataField="Name" HeaderText="Landmark" />
                     <telerik:GridNumericColumn DataField="AddressId" HeaderText="Address ID" />
                     <xx:SampleColumn DataField="AddressId" HeaderText="Country" />
                     <xx:SampleColumn DataField="AddressId" HeaderText ="Province" />
                     <xx:SampleColumn DataField="AddressId" HeaderText="City" />
                     <xx:SampleColumn DataField="AddressId" HeaderText="Street Address" />
                     <xx:SampleColumn DataField="AddressId" HeaderText="Postal Code" />
                  </Columns>
               </MasterTableView>
            </telerik:RadGrid>
         </div>
      </form>
   </body>
</html>

Classes:

Option Infer Off
Option Strict On
Option Explicit On
 
Imports Telerik.Web.UI
Imports System.Web.HttpContext
 
Namespace Example
 
   Public Class SampleColumn
 
      Inherits GridBoundColumn
 
      Protected Overrides Function FormatDataValue(ByVal dataValue As Object, ByVal item As GridItem) As String
         Dim lm As Landmark
         Dim Addresses As IEnumerable(Of Address)
         Dim address As Address
 
         lm = CType(item.DataItem, Landmark)
         Addresses = CType(Current.Session.Item("addrCollection"), Address())
         address = Addresses.First(Function(a As Address) a.Id = lm.AddressId)
 
         Select Case MyBase.HeaderText
            Case "Street Address"
               Return address.Street
            Case "City"
               Return address.City
            Case "Postal Code"
               Return address.PostalCode
            Case "Province"
               Return address.Province
            Case "Country"
               Return address.Country
            Case Else
               Return "Huh?"
         End Select
 
      End Function
 
   End Class
 
End Namespace
 
Public Class Landmark
   Public Property Name As String
   Public Property AddressId As Integer
End Class
 
Public Class Address
   Public Property Id As Integer
   Public Property Street As String
   Public Property City As String
   Public Property Province As String
   Public Property PostalCode As String
   Public Property Country As String
End Class

 





Marin
Telerik team
 answered on 09 Nov 2011
4 answers
129 views
Scenario: I wanted to create custom skin for telerik radgrid.How do i do it?

Thanks a million in advance.

Tsvetoslav
Telerik team
 answered on 09 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?