Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
111 views
Hi,
I have a tree view in the following shape with the checkbox support...

Text: Paret-Node-1    Value:1
        Text: Child-Node-1       Value:1
        Text: Child-Node-2       Value:2
        Text: Child-Node-3       Value:3
Text: Paret-Node-2    Value:2
        Text: Child-Node-4       Value:4
        Text: Child-Node-5       Value:5
        Text: Child-Node-6       Value:6

How can I get the "values" of Parent node and child nodes.

Regards,

Veronica
Telerik team
 answered on 16 Aug 2010
1 answer
103 views
I basically need an idiots guide to drag and drop handlers as I look at the example code and simply dont understand what each part of the JS code does, if it helps I would be writing data bach to a SQL database as a result of a drop event.
Any help would be greatly appriciated.
Dan
Pavlina
Telerik team
 answered on 16 Aug 2010
1 answer
277 views
Hi,

Problem : 1
I want to export rad grid and i want custom title on radgrid.
I did try to use caption and caption displayed on UI but didnt display on Export to excel.
I like to show on Export to excel Like "Report Name : abc , Report Date : 08/12/10 " And some other criteria. Also caption height should be 5 px when export to excel. Because report has 30 columns and 65 rows and i need to fit in one page.

Problem : 2
I want the grid to be export in landscape mode so can you send me example code for that.(please look at my code that i am currently using). I need tiltle and export in landscape mode. 

Radgrid.MasterTableView.Caption = lblCaption

Protected Sub rgFlash_DataBound(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rgFlash.DataBound
        If Export = True Then
            rgFlash.ExportSettings.ExportOnlyData = True
            rgFlash.ExportSettings.FileName = "Report Name"
            rgFlash.ExportSettings.IgnorePaging = True
            rgFlash.ExportSettings.HideStructureColumns = True
            rgFlash.FilterMenu.Visible = False

            rgFlash.HeaderContextMenu.Visible = False
            rgFlash.EnableHeaderContextMenu = False
            rgFlash.EnableHeaderContextFilterMenu = False
            rgFlash.AllowSorting = False
            rgFlash.AllowPaging = False
            rgFlash.AllowFilteringByColumn = False
            rgFlash.MasterTableView.AllowFilteringByColumn = False
            rgFlash.MasterTableView.AllowSorting = False
            rgFlash.MasterTableView.AllowPaging = False
            rgFlash.MasterTableView.EnableHeaderContextFilterMenu = False
            rgFlash.MasterTableView.EnableHeaderContextMenu = False
        End If

        lblRecordCount.Text = "Records : " & recordcount

    End Sub

  Protected Sub rgFlash_GridExporting(ByVal source As System.Object, ByVal e As Telerik.Web.UI.GridExportingArgs) Handles radgrid.GridExporting
        'rgFlash.MasterTableView.Caption = Caption
        ExportDataGridToExcel(radgrid, Response)
    End Sub


    Public Sub ExportDataGridToExcel(ByVal ctrl As System.Web.UI.Control, ByVal response As System.Web.HttpResponse)

        response.Clear()

        response.Buffer = True

        response.Cache.SetCacheability(HttpCacheability.NoCache)

        response.ContentType = "application/vnd.ms-excel"

        response.AddHeader("content-disposition", "attachment;filename=Flash Report.xls")

        response.Charset = ""

        Me.EnableViewState = False

        Dim oStringWriter As New System.IO.StringWriter()

        Dim oHtmlTextWriter As New System.Web.UI.HtmlTextWriter(oStringWriter)

        'this.ClearControls(ctrl);

        ctrl.RenderControl(oHtmlTextWriter)

        ' set content type and character set to cope with european chars like the umlaut.

        response.Write("<meta http-equiv=Content-Type content=""text/html; charset=utf-8"">" & vbLf)

        ' add the style props to get the page orientation

        response.Write(AddExcelStyling())

        response.Write(oStringWriter.ToString())
        response.Write("</body>")
        response.Write("</html>")

        response.[End]()

    End Sub

    Private Function AddExcelStyling() As String
        ' add the style props to get the page orientation
        Dim sb As New StringBuilder()

        sb.Append("<html xmlns:o='urn:schemas-microsoft-com:office:office'" & vbLf + "xmlns:x='urn:schemas-microsoft-com:office:excel'" & vbLf + "xmlns='http://www.w3.org/TR/REC-html40'>" & vbLf + "<head>" & vbLf)

        sb.Append("<style>" & vbLf)

        sb.Append("@page")

        'page margin can be changed based on requirement.....

        sb.Append("{margin:.10in .10in .10in .10in;" & vbLf)

        sb.Append("mso-header-margin:.10in;" & vbLf)

        sb.Append("mso-footer-margin:.10in;" & vbLf)

        sb.Append("mso-height-source:96.75pt;" & vbLf)

        sb.Append("mso-page-orientation:landscape;}" & vbLf)



        sb.Append("</style>" & vbLf)

        sb.Append("<!--[if gte mso 9]><xml>" & vbLf)

        sb.Append("<x:ExcelWorkbook>" & vbLf)

        sb.Append("<x:ExcelWorksheets>" & vbLf)

        sb.Append("<x:ExcelWorksheet>" & vbLf)

        sb.Append("<x:Name>Flash Report</x:Name>" & vbLf)

        sb.Append("<x:WorksheetOptions>" & vbLf)

        sb.Append("<x:Print>" & vbLf)

        sb.Append("<x:ValidPrinterInfo/>" & vbLf)

        sb.Append("<x:PaperSizeIndex>9</x:PaperSizeIndex>" & vbLf)

        sb.Append("<x:HorizontalResolution>600</x:HorizontalResolution" & vbLf)

        sb.Append("<x:VerticalResolution>600</x:VerticalResolution" & vbLf)

        sb.Append("</x:Print>" & vbLf)

        sb.Append("<x:Selected/>" & vbLf)

        sb.Append("<x:DoNotDisplayGridlines/>" & vbLf)

        sb.Append("<x:ProtectContents>False</x:ProtectContents>" & vbLf)

        sb.Append("<x:ProtectObjects>False</x:ProtectObjects>" & vbLf)

        sb.Append("<x:ProtectScenarios>False</x:ProtectScenarios>" & vbLf)

        sb.Append("</x:WorksheetOptions>" & vbLf)

        sb.Append("</x:ExcelWorksheet>" & vbLf)

        sb.Append("</x:ExcelWorksheets>" & vbLf)

        sb.Append("<x:WindowHeight>12780</x:WindowHeight>" & vbLf)

        sb.Append("<x:WindowWidth>19035</x:WindowWidth>" & vbLf)

        sb.Append("<x:WindowTopX>0</x:WindowTopX>" & vbLf)

        sb.Append("<x:WindowTopY>0</x:WindowTopY>" & vbLf)

        sb.Append("<x:ProtectStructure>False</x:ProtectStructure>" & vbLf)

        sb.Append("<x:ProtectWindows>False</x:ProtectWindows>" & vbLf)

        sb.Append("</x:ExcelWorkbook>" & vbLf)

        sb.Append("</xml><![endif]-->" & vbLf)

       sb.Append("</head>" & vbLf)

        sb.Append("<body>" & vbLf)

        Return sb.ToString()

    End Function


Thanks for your all previous support and look at this issue.
Daniel
Telerik team
 answered on 16 Aug 2010
1 answer
76 views
Hello there,

I've currently installed the trial version of the telerik ultimate collection and I want to add a RadMenu to my website. I've found some examples on the web and I tried to build my code.

But I get the error; 

'Telerik.Web.UI, Version=2010.1.519.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4' File or assembly name or one of its dependencies not found.

I have the Telerik.Web.UI in my bin folder and it references to Bin35 folder in program files, which means the dll is for dotNET 3.5. The another issue is my DLL version is not 2010.1.519.20. My DLL's version is 2010.2.713.35 and I registered it into GAC util. I'm using W7 Ultimate and VS2008 SP1.


What do I need to do now?
Thanks.

Pavlina
Telerik team
 answered on 16 Aug 2010
1 answer
85 views
Hi,

I have the following grid, all the  GridBoundColumn's populate when the grid is loaded but the radcombobox does not. How can I get it to display the current value?  Does anyone have an example of a radgrid where one of the columns is a drop down or combo box?

 


Thanks for any help in advance,

 

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadGrid1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                <telerik:AjaxUpdatedControl ControlID="Label1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadGrid 
    ID="RadGrid1" 
    DataSourceID="SessionDataSource1" 
    OnItemDataBound = "RadGrid1_ItemDataBound"
    Width="97%"
    ShowStatusBar="True" 
    AllowSorting="True" 
    PageSize="7" 
    GridLines="None" 
    AllowPaging="True"
    runat="server" 
    AllowAutomaticUpdates="True" 
    AutoGenerateColumns="False">
    <MasterTableView 
                TableLayout="Fixed" 
                DataKeyNames="checklistNo" 
                EditMode="InPlace" 
                DataSourceID="SessionDataSource1">
      <Columns>
        <telerik:GridBoundColumn UniqueName="CategoryID" DataField="CategoryID" HeaderText="CategoryID" ReadOnly="True" >
            <HeaderStyle Width="10%" />
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn UniqueName="checklistNo" DataField="checklistNo" HeaderText="checklistNo"  Display="False" ReadOnly="True" >
            <HeaderStyle Width="25%" />
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn UniqueName="Related_item_type_label" DataField="Related_item_type_label" HeaderText="Question"  ReadOnly="True">
            <HeaderStyle Width="30%" />
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn UniqueName="Service_impact_category" DataField="Service_impact_category" ReadOnly="True" HeaderText="Service Impact" >
            <HeaderStyle Width="10%" />
        </telerik:GridBoundColumn>
         <telerik:GridTemplateColumn UniqueName="Inspection Result" DataField="INSPECTION_RESULT" HeaderText="Inspection Result">
            <HeaderStyle Width="17%" />   
            <ItemStyle Width="17%" />
            <EditItemTemplate>
               <telerik:RadTextBox Visible="False" AutoPostBack="true" ID="lblInspectionResult" runat="server"  Text='<%#Eval("INSPECTION_RESULT")%>'>
               </telerik:RadTextBox>
               <telerik:RadComboBox visible="True" ID="cbInspectionResult" AppendDataBoundItems="true" runat="server"  DataTextField="INSPECTION_RESULT" DataValueField="INSPECTION_RESULT">
               </telerik:RadComboBox>
            </EditItemTemplate>
         </telerik:GridTemplateColumn>
        <telerik:GridBoundColumn UniqueName="Inspection_Fault" DataField="Inspection_Fault" HeaderText="Fault" >
            <HeaderStyle Width="10%" />
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn UniqueName="inspection_comment" DataField="inspection_comment" HeaderText="Comments" >
            <HeaderStyle Width="10%" />
        </telerik:GridBoundColumn>
      </Columns>
    </MasterTableView>
    <ClientSettings>
        <ClientEvents 
              
            OnRowClick="RowClick"
            OnRowDblClick="RowDblClick"
              
            OnGridCreated="GridCreated" 
            OnCommand="GridCommand" />
    </ClientSettings>
</telerik:RadGrid>

,
Judy

Veli
Telerik team
 answered on 16 Aug 2010
8 answers
212 views
Hi guys!
We've been using Telerik.Web.UI v.2010.1.309.35 in our project, and recently have switched to v.2010.1.519.35 . Since that I've discovered that ListView doesn't seem to process <%%> tags correctly during binding. For instance, here's the EditItemTemplate that I have:
<EditItemTemplate>
 <tr>
  <td style="vertical-align:top">
   <rlt:TextBox ID="txtDurationMonth" runat="server" 
                ValueType="Integer"
                Width="50px" 
                Text='<%#Eval("DurationMonth") %>'
   ></rlt:TextBox>
   <asp:RangeValidator runat="server" 
                ControlToValidate="txtDurationMonth" 
                ErrorMessage="Integer value required" 
                MinimumValue="0" 
                MaximumValue="<%#int.MaxValue %>" 
                Type="Integer" 
                SetFocusOnError="true">
   </asp:RangeValidator>
  </td>
  <td style="vertical-align:top">
   <rlt:LinkButton ID="lbSave" runat="server" 
          CommandName="<%#RadListView.UpdateCommandName%>" CommandArgument='<%#Eval("Id") %>'>Save</rlt:LinkButton>
  </td>
 </tr>
</EditItemTemplate>
When I switch into Edit mode, I started getting an exception that it cannot parse '' (empty string) for MaximumValue of rangevalidator. I removed that validator at all and it switched fine, but CommandName of lbSave was always empty. Also, ListView has DataKeyNames="Id" However, if I try to get an ID in ListView ItemCommand handler like this:

((

RadListViewDataItem)e.ListViewItem).GetDataKeyValue("Id")

I get "index was out of range" exception. So I had to switch back to v.2010.1.309.35.  And now it works as it should, but that version has an issue with RadEditor, which is being stretched in some occasions.
So, is it some bug or do I miss something? Thanx in advance!

 

Neha
Top achievements
Rank 1
 answered on 16 Aug 2010
1 answer
93 views
I've got a Masterpage with an Ajaxmanager & loading panel on & 2 content panels. Content1 is a menu and Content2 is the actual aspx pages for the application where 100% of the application is loaded. On the screens there are save & cancel buttons with code behind procedures. I want to be able to show the loading panel when clicking save or cancel or even when an aspx page is loading.

Is this achievable and how?
Pavlina
Telerik team
 answered on 16 Aug 2010
1 answer
155 views
Hi Telerik Team,

The issue is my group headers are not coming while exporting since I am writing the following code:
if (e.Item is GridGroupHeaderItem)
{
(e.Item
as GridGroupHeaderItem).DataCell.Visible = false;
e.Item.PreRender +=
new EventHandler(Item_PreRender);
}
which is hiding the GroupHeaders DataCell since I need to customize the header as demonstrated in the following link
http://www.telerik.com/help/aspnet-ajax/aligning_items_in_groupheader2.html

Now,Please let me know with (e.Item as GridGroupHeaderItem).DataCell.Visible = false;
 and creating my own Table cells for the group header how can I bring the group header while exporting to excel?

I think export to excel takes group headers from Datacell only it does not identify anything else.Since I am adding table cells manually in the header it is not getting those.Please let me know how to resolve this issue?
Regards,
Shubh
Daniel
Telerik team
 answered on 16 Aug 2010
1 answer
179 views
Using jQuery to track changes on a form automatically sets the dirty flag for all controls at the form level, but controls (TextBox, DropDownList) inside a Grid edit row are not captured.  We are using the $(":input").change() method to capture changes in input controls.  Is there any automated way to capture the controls inside the Grid edit row?
Veli
Telerik team
 answered on 16 Aug 2010
7 answers
253 views
I currently am trying to perform a rebind of the Grid through AJAX whenever a node on a RadTreeView control is clicked.  The new data is successfully rebound, but for some reason the ability after rebinding I loose the ability to select items inside the grid.

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <ClientEvents />
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="rtFiles" EventName="OnNodeClick">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="grdFiles" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
  
    </AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadSplitter ID="Splitter" Width="100%" runat="server">
    <telerik:RadPane ID="Pane1" runat="server">
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
        </telerik:RadAjaxLoadingPanel>
        <telerik:RadTreeView ID="rtFiles" runat="server"
            EnableAjaxSkinRendering="true"
            AllowNodeEditing="false"
            OnClientContextMenuItemClicking="rtFiles_onClientContextMenuItemClicking"
            oncontextmenuitemclick="rtFiles_ContextMenuItemClick" 
            onnodeedit="rtFiles_NodeEdit"
            OnNodeClick="rtFiles_NodeClick"
            >
            <ContextMenus>
                <telerik:RadTreeViewContextMenu ID="fileContextMenu">
                    <Items>
                        <telerik:RadMenuItem Text="Rename" Value="rename" PostBack="false"></telerik:RadMenuItem>
                        <telerik:RadMenuItem Text="Delete" Value="delete"></telerik:RadMenuItem>
                    </Items>
                </telerik:RadTreeViewContextMenu>
                <telerik:RadTreeViewContextMenu ID="albumContextMenu">
                    <Items>
                        <telerik:RadMenuItem Text="New Album" Value="newAlbum"></telerik:RadMenuItem>
                        <telerik:RadMenuItem Text="Upload File" Value="uploadFile"></telerik:RadMenuItem>
                        <telerik:RadMenuItem Text="Rename" Value="rename" PostBack="false"></telerik:RadMenuItem>
                        <telerik:RadMenuItem Text="Delete" Value="delete"></telerik:RadMenuItem>
                    </Items>
                </telerik:RadTreeViewContextMenu>
            </ContextMenus>
        </telerik:RadTreeView>
    </telerik:RadPane>
    <telerik:RadSplitBar ID="Split1" CollapseMode="Backward" runat="server" />
    <telerik:RadPane ID="Pane2" runat="server">
        <telerik:RadGrid ID="grdFiles" Width="100%" runat="server" AllowMultiRowSelection="true"
            onneeddatasource="grdFiles_NeedDataSource" 
            OnItemDataBound="grdFiles_ItemDataBound" >
            <SelectedItemStyle BackColor="Red" />
            <MasterTableView ShowHeader="true" UseAllDataFields="false" AutoGenerateColumns="false" RetrieveAllDataFields="false">
                <Columns>
                    <telerik:GridTemplateColumn HeaderText="File Name" >
                        <HeaderStyle Width="20px" />
                        <ItemTemplate>
                            <img src="/internetsite/Images/Icons/<%# Convert.ToBoolean(Convert.ToString(DataBinder.Eval(Container.DataItem, "Title")).Contains("."))? Convert.ToString(DataBinder.Eval(Container.DataItem, "Title")).Substring(Convert.ToString(DataBinder.Eval(Container.DataItem, "Title")).LastIndexOf(".") + 1) + ".gif" : "folder.gif" %>" /> <%# DataBinder.Eval(Container.DataItem, "Title") %>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                </Columns>
            </MasterTableView>
            <ClientSettings EnableRowHoverStyle="true">
                <Selecting AllowRowSelect="true" />
            </ClientSettings>
        </telerik:RadGrid>
    </telerik:RadPane>
</telerik:RadSplitter>

protected void grdFiles_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
   {
       string strValue;
       if (rtFiles.SelectedNode == null)
       {
           strValue = rtFiles.Nodes[0].Value;
       }
       else
       {
           strValue = rtFiles.SelectedNode.Value;
       }
       reloadDataSource_grdFiles(int.Parse(strValue.Substring(strValue.IndexOf("_") + 1)));
   }
protected void reloadDataSource_grdFiles(int intId)
   {
       grdFiles.MasterTableView.DataKeyNames = new string[] { "Id", "Title" };
       grdFiles.DataSource = myDataSource(intID);
   }
Pavlina
Telerik team
 answered on 16 Aug 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?