Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
297 views
Is there any built-in method to convert a RadTreeNode object to a RadTreeNodeData object or vice versa in a RadTreeView?
Joel Kraft
Top achievements
Rank 2
 answered on 31 Jan 2012
13 answers
450 views
Multiple selection works by using ctrl key, but we have to click 20-30 times if we have to select many items. If the nodes are sorted, is there a way to select them shift style, so that all leaf nodes are selected between 2 clicks.
Bozhidar
Telerik team
 answered on 31 Jan 2012
3 answers
198 views
I have a treeview with a number of nodes that contain various editing controls that are generated from templates.  The problem is that the checkboxes are being treated like radio buttons as it will only allow one at a time to be checked.  When I check one, it appears the tree automatically unchecks any others in the entire tree, firing the checkchanged handler for each in its template.

This only seems to be exhibited when a checkbox is clicked, I can generate the tree with multiple check boxes checked, but as soon as you check one I see this behavior.

All the checkboxes have unique ID's.

When I place several checkboxes on the same page with their own checkchanged handlers, but outside of the tree, they do not demonstrate this behavior amongst themselves.  Although even checking one of these, the ones in the tree do.

I added some code to the checkchanged handlers in the templates and checked the __EVENTTARGET param and kicked it out of any that didn't match the ID of the sender.  This kept the underlying data correct, but when the page regenerates all the other checkboxes are still unchecked.  This would seem to imply that the tree is somehow forcing this on the controls when they're rendered.

If not I don't know where else this would be coming from.  Any insight is appreciated though.
Bozhidar
Telerik team
 answered on 31 Jan 2012
1 answer
117 views
Hi,

I need to get the currently selected tag.
So, i am using  editor.getSelectedElement();

in my editor has code in html like
<subelement id="717" type="complementary"><tag type="open" text="complementary" elem-tag="subelement">|</tag><p><tag type="open" text="p" elem-tag="p">|</tag>
       
 
      An increasing amount of information on complementary and alternative medicine is becoming available. The scope of the BNF is restricted to the discussion of conventional medicines but reference is made to complementary treatments if they affect conventional therapy (e.g. interactions with St John's wort—see Appendix 1). Further information on herbal medicines is available at
            
the design mode content looks like below.
complementary-and-alternative-medicine|
p| An increasing amount of information on complementary and alternative medicine is becoming available. The scope of the BNF is restricted to the discussion of conventional medicines but reference is made to complementary treatments if they affect conventional therapy (e.g. interactions with St John's wort—see Appendix 1). Further information on herbal medicines is available at XRef : http://www.mhra.gov.uk| www.mhra.gov.uk |Xref : http://www.mhra.gov.uk . |p
|complementary-and-alternative-medicine


when the user right cliks with in any of this tag, i need to get the selected tag in editor.

so, iam using  editor.getSelectedElement();

the tag format assigned in editor like'
<tag1><tag2><p>text</p></tag2><tag1>

tag1 is click, the getselectedelemat return the <p> tag always.

because the <p> is the editable tag, which contain the text.

but the user selected the not editable tag, that is the root tag of <p> tag.

How to get the exact tag that is selected in editor.

Thanks,
Uma
Rumen
Telerik team
 answered on 31 Jan 2012
2 answers
117 views
Hi,

i am getting the following error when RadToolTipManager loads a usercontrol (problem is with ie9 9.0.4)

RadToolTipManager response error:

Exception=Sys.WebForms.PageREquestManagerServerErrorExecution; An Unknown error occurred while processing the request on the server. the status code returned from the server was: 500

it is working fine with ie9 (9.0.2)

can please any one help me to resolve this issue.

Thank you in advance

Jai

Jay
Top achievements
Rank 1
 answered on 31 Jan 2012
2 answers
349 views
After implementing the RadCompression model on a previously working ashx page I was using for secure file downloads, itstopped working in Firefox, Chrome, & Safari, but continued to work in IE (tested v9).  I found 2 possible places for the error, but due to time constraints had to stop and simply remove the RadCompression module.

1.    On my development box, Win 7, IIS 7, flushing the data (context.Response.Flush()) between the header and the content caused the browsers listed above to report an invalid compression.

2. On my production server, Windows Server 2003, IIS 6, the browsers just sit there and spin, as if they are waiting for more content.  I think this is due to my manually adding a "Content-Length" based on the size of the uncompressed content.  Is there a sample showing the correct parameters to set when using RadCompression in this scenario?  My page, based on parameters, may return any of the following, and so I am also setting the content type and content-disposition headers manually:

    a.    HTML (text/html)
    b.    Text (text/plain)
    c.    Zip (application/zip)
    d.    Excel (application/vnd.ms-excel)
    e.    Excel 2007 (application/vns.openxmlformats-officedocument.spreadsheetml.sheet)
    f.    Jpg (image/jpeg)

These files are dynamically generated, so I would also like to specify "no-cache" in the sample as well.

The following is my working (without RadCompression) sample. (Again, it works in IE, but not others.)

Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
 
        '''The following 2 lines do not seem to make a difference, but were added when trying to test
        context.Response.Clear
        context.Response.BufferOutput = True
 
        'Get the filename
        Dim fileName As String = context.Request.QueryString("i")
         
        'Get the file type
        Dim fileType As String = context.Request.QueryString("t")
         
        'Get the project name
        Dim projectName As String = Managers.SessionManager.ProjectName(context.Session)
         
        'Get the userId
        Dim userId As Integer = Managers.SessionManager.UserId(context.Session)
         
        'Make sure the project and user name are valid
        If IsProjectAndUserValid(projectName, userId) = True Then
         
            Dim securePath As String = Utilities.IO.GetSecureDirectory(Managers.ConfigManager.SecureOutput, projectName, userId)
         
            'Create the full physical path to the file       
            Dim fullPath As String = IO.Path.Combine(securePath, fileName)
         
            'See if the file exist
            If IO.File.Exists(fullPath) Then
                'Open a fileinfo object for the file
                Dim currentFileInfo As New IO.FileInfo(fullPath)
                 
                Select Case fileType.ToLower
                    Case "zip"
                        context.Response.AddHeader("Content-Disposition", "attachment;filename=MyZip.zip")
                        context.Response.ContentType = "application/zip"
                    Case "export"
                        'Get the fileextension
                        Dim fileExtension As String = IO.Path.GetExtension(fullPath)
                        If fileExtension = ".html" OrElse fileExtension = ".htm" Then
                            context.Response.AddHeader("Content-Disposition", "attachment;filename=Export.htm")
                            context.Response.ContentType = "text/html"
                        ElseIf fileExtension = ".txt" Then
                            context.Response.AddHeader("Content-Disposition", "attachment;filename=Export.txt")
                            context.Response.ContentType = "text/plain"
                        ElseIf fileExtension = ".xls" Then
                            context.Response.AddHeader("Content-Disposition", "attachment;filename=Export.xls")
                            context.Response.ContentType = "application/vnd.ms-excel"
                        ElseIf fileExtension = ".xlsx" Then
                            context.Response.AddHeader("Content-Disposition", "attachment;filename=Export.xlsx")
                            context.Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
                        End If
                    Case "print"
                        context.Response.ContentType = "text/html"
                    Case "image"
                        context.Response.AddHeader("Content-Disposition", "inline;filename=Print.jpg")
                        context.Response.ContentType = "image/jpeg"
                End Select
                 
                '''The following line has had inconsistant results in some browsers
                'context.Response.CacheControl = "no-cache"
                '''Is the following line is another (unconfirmed) problem for RadCompression?
                context.Response.AddHeader("Content-Length", currentFileInfo.Length.ToString)
                context.Response.StatusCode = 200
                ''''The following line breaks RadCompression in IIS7
                'context.Flush()
                context.Response.WriteFile(fullPath)
                context.Response.Flush()
                context.Response.End()
            Else
                context.Response.StatusCode = 200
                context.Response.Write("No data located for this request.")
                context.Response.End()
            End If
             
        End If     
         
    End Sub

Chuck
Top achievements
Rank 1
 answered on 31 Jan 2012
10 answers
459 views
Hi Telerik Team,

I have a very strange requirement from the customer. Customer is using a RAD Grid with GridTemplateColumn used having both HeaderTemplate & ItemTemplate => both having a check-box.

I just followed this link  to set the checkbox to the RAD Grid.


Ex: Assume that the RAD Grid is having 3 records with a check-box similiar to the screenshot given in the above link. When we select "HeaderCheckbox", all the item check-boxes are selected which is clear.

User is now trying to now select all 3 records (item template records) manually. Please keep in mind that Multi-select is allowed for my grid. What customer is asking why is header check-box not selected for this scenario? 

So in ToggleRowSelection method, I tried to access headertemplate check-box and set the check-box to checked but I am not able to achieve it. I tried with RadGrid1.MasterTableView.Columns[0] and tried to find the checkbox. But I couldn't find it.

could you please let me know how to access HeaderTemplate check-box from ItemTemplate check-box event handler?
protected void ToggleRowSelection(object sender, EventArgs e)
{
((sender
 as CheckBox).Parent.Parent as GridItem).Selected = (sender as CheckBox).Checked;
}


Regards,
Kishan G K


Regards,
Kishan G K
Roselin
Top achievements
Rank 1
 answered on 31 Jan 2012
1 answer
57 views
Hi,

It's possible to add a user control from page methods?If yes, how?
I need this because I want to add a usercontrol to a node of a tree. I use web service like expand mode.
Thanks,
Timo
Plamen
Telerik team
 answered on 31 Jan 2012
1 answer
123 views
Hi
I am using a RadGrid to drag and drop onto a RadScheduler. The page works and functions exactly as required in a standard page, however, when I place exactly the same code into a page that calls a masterpage I get a javascript error "'null' is null or not an object"

I'm assuming this would be something to do with the following javascript, however I cant pinpoint exactly what.

<script type="text/javascript">
            function rowDropping(sender, eventArgs) {
                // Fired when the user drops a grid row
                var htmlElement = eventArgs.get_destinationHtmlElement();
                var scheduler = $find('<%= RadScheduler1.ClientID %>');
  
                if (isPartOfSchedulerAppointmentArea(htmlElement)) {
                    // The row was dropped over the scheduler appointment area
                    // Find the exact time slot and save its unique index in the hidden field
                    var timeSlot = scheduler._activeModel.getTimeSlotFromDomElement(htmlElement);
                    alert(timeSlot.get_index());
                    $get("TargetSlotHiddenField").value = timeSlot.get_index();
  
                    // The HTML needs to be set in order for the postback to execute normally
                    eventArgs.set_destinationHtmlElement("TargetSlotHiddenField");
                }
                else {
                    // The node was dropped elsewhere on the document
                    eventArgs.set_cancel(true);
                }
            }
  
            function isPartOfSchedulerAppointmentArea(htmlElement) {
                return $telerik.$(htmlElement).parents().is("div.rsAllDay") ||
                            $telerik.$(htmlElement).parents().is("div.rsContent")
            }
  
            function onRowDoubleClick(sender, args) {
                sender.get_masterTableView().editItem(args.get_itemIndexHierarchical());
            }
        </script>


Any pointers on why this wouldnt work on a page that calls a masterpage would be much appreciated - I tested this with a masterpage that was essentially blank as well with no other scripts included on it.

Many thanks.
Karl.
Plamen
Telerik team
 answered on 31 Jan 2012
1 answer
93 views
I'm using rad grid grouping and when expanding groups they should be ajaxified but for some reasons it's still doing a full postback.
Can you help? Here is the code:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                       <AjaxSettings>
                           <telerik:AjaxSetting AjaxControlID="grdActivity">
                               <UpdatedControls>
                                   <telerik:AjaxUpdatedControl ControlID="grdActivity" LoadingPanelID="RadAjaxLoadingPanel1" />
                               </UpdatedControls>
                           </telerik:AjaxSetting>
                       </AjaxSettings>
                   </telerik:RadAjaxManager>
                   <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
                   </telerik:RadAjaxLoadingPanel>
                  <div id="RecentActivityContent" class="QuickViewContent">
                     <telerik:RadGrid runat="server" ID="grdActivity" DataSourceID="objActivity" Width="360px"
                      GridLines="Horizontal" Skin="Sunset" ShowHeader="false" >
                      <HeaderStyle CssClass="HistoryGridHeader" />
                       <PagerStyle Mode="NextPrevNumericAndAdvanced"></PagerStyle>
                       <MasterTableView AutoGenerateColumns="false" CssClass="GridRecentActivity">
                           <GroupByExpressions>
                               <telerik:GridGroupByExpression>
                                   <SelectFields>
                                       <telerik:GridGroupByField FieldAlias="Date" FieldName="Date" FormatString="{0:D}"
                                           HeaderValueSeparator=" from date: " />
                                   </SelectFields>
                                   <GroupByFields>
                                       <telerik:GridGroupByField FieldName="Date" SortOrder="Descending" >
                                       </telerik:GridGroupByField>
                                   </GroupByFields>
                               </telerik:GridGroupByExpression>
                           </GroupByExpressions>
                           <Columns>
                               <telerik:GridTemplateColumn DataField="Message" HeaderText="Message" UniqueName="Message">
                                   <ItemTemplate>
                                       <asp:Label runat="server" id="Label1" Text='<%# Eval("Type") %>' CssClass="FirstColumn" />   -  
                                       <asp:Label runat="server" id="lblMessage" Text='<%# Eval("Message") %>' />
                                   </ItemTemplate>
                               </telerik:GridTemplateColumn>
                           </Columns>
                       </MasterTableView>
                       <ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True">
                           <Selecting AllowRowSelect="True"></Selecting>
                           <Resizing AllowRowResize="True" AllowColumnResize="True" EnableRealTimeResize="True"
                           ResizeGridOnColumnResize="False"></Resizing>
           </ClientSettings>
                   </telerik:RadGrid>
Thanks,
Ron.
Shinu
Top achievements
Rank 2
 answered on 31 Jan 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?