Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
118 views
Hi,

I want to do the following with docking zones.
I want to split the page in 4 zones (as an example) -> 1=left top, 2=right top, 3=left bottom, 4 =right bottom
In each zone a control will be placed.

If a control is unpinned then for example:
if zone 3 is unpinned then zone 4 should resize and merge with zone 3. If i drag the control from 4 to 1 then 1 should be placed in zone 4(=3+4) . If i drag 1 to 2 then the controls are swapped. etc
If zone 2 and 4 is unpinned then 1 should merge with zone 2 and 3 with 4.(or 1 merge with 3 and 4 with 2)

Is there an example where I can start to do this kind of functionality?

ps: It would be nice if Telerik could design wysiwyg layout manager where you can define (forbidden)zones with properties like draggable, resizable (and automatic resizing the area when a zone is unpinned), etc.

Thanks,

Henk
Slav
Telerik team
 answered on 12 Oct 2012
2 answers
162 views
Hi,

I am unable to export a rad grid with nested grid in it. When I export it, only master table data is being exported but not the data from nested grid. I tried using all the suggestions like making inner grid's hierarchydefaultexpanded to true as well but nothing really did the trick. please let me know on how to proceed further. Appreciate your help.

Regards,
Syam.
Swamy
Top achievements
Rank 1
 answered on 12 Oct 2012
4 answers
379 views
Good Day 
 
i am using a AsyncUpload(telerik), i am in a point where i am supposed to save the File to a certain Folder. 


First i check if the directory exist 
 
 
Dim baseDire As String = Server.MapPath("~/MyFILES/")
If IO.Directory.Exists(baseDire & Request("Req_ID").ToString()) = False Then
               IO.Directory.CreateDirectory(baseDire & Request("Req_ID").ToString())
           End If

 
Because i am doing multiple Upload  , i will have to loop through the items of the Upload control and save to a folder. 


For Each file As UploadedFile In UploadPropDoc.UploadedFiles
              Dim bytes(file.ContentLength - 1) As Byte
              file.InputStream.Read(bytes, 0, file.ContentLength)
               'Save the File to the disk
              file.SaveAs(baseDire + file.GetName())
          Next



Now when ever i debug this , when it comes to this line 


file.SaveAs(baseDire + file.GetName())
 


i get an Error 
 
 The process cannot access the file because it is being used by another process 
 


I have removed the Readonly in the Folder that it supposed to write to and gave everyone permission , but still the error persist.


Thanks


Rowi
Top achievements
Rank 1
 answered on 12 Oct 2012
3 answers
113 views

Hi,

I am using radgrid with grouping options,the problem it loads fine ,however after that it never binds even on paging,sorting or on other controls.when i remove grouping  it works fine. can you please reply soon.its very urgent.

below is my code

  <telerik:RadGrid ID="RgrdConsultantVacationweek" AutoGenerateColumns="false" AllowPaging="true"
                    PageSize="8" runat="server" DataMember="ConsultantID" OnNeedDataSource="RgrdConsultantVacationweek_NeedDataSource"
                    AllowSorting="true" OnItemCommand="RgrdConsultantVacationweek_ItemCommand" ShowGroupPanel="true"
                    ShowFooter="True">
                    <ExportSettings HideStructureColumns="true" />
                    <ClientSettings>
                        <Selecting AllowRowSelect="true" />
                        <ClientEvents OnRowDblClick="OnRowDblClick" />
                    </ClientSettings>
                    <MasterTableView CommandItemDisplay="Top" ClientDataKeyNames="VacationRequestID"
                        ShowGroupFooter="true" EnableViewState ="true">
                        <CommandItemTemplate>
                            <table width="100%">
                                <tr>
                                    <td style="text-align: right">
                                        <asp:LinkButton ID="LnkExportToexcel" runat="server" CommandName="ExportToExcel">
                                            <asp:Image ID="imgexportToexcel" ImageUrl="~/Img/Export to excel.gif" runat="server" />
                                        </asp:LinkButton>
                                        &nbsp;
                                        <asp:LinkButton ID="LnkExportTopdf" runat="server" CommandName="ExportTopdf">
                                            <asp:Image ID="ImgPdf" ImageUrl="~/Img/ExportToPDF.gif" runat="server" />
                                        </asp:LinkButton>
                                        &nbsp;
                                        <asp:LinkButton ID="LnkExporrtToCsv" runat="server" CommandName="ExporrtToCsv">
                                            <asp:Image ID="Imgcsv" ImageUrl="~/Img/ExportToCSV.gif" runat="server" />
                                        </asp:LinkButton>
                                        &nbsp;
                                        <asp:LinkButton ID="LnkExportToWord" runat="server" CommandName="ExportToWord">
                                            <asp:Image ID="ImgWord" ImageUrl="~/Img/ExportToWord.gif" runat="server" />
                                        </asp:LinkButton>
                                    </td>
                                </tr>
                            </table>
                        </CommandItemTemplate>
                        <GroupHeaderTemplate>
                            <asp:Label runat="server" ID="Label1" Text='<%#Eval("vacationmonth") %>' Visible="true">
                            </asp:Label>
                        </GroupHeaderTemplate>
                        <GroupFooterTemplate>
                          
                            <asp:Label ID="lblBusinessdaystext" Text="Total  " runat="server"></asp:Label>
                            <asp:Label ID="lblBusinessdays" runat="server" Text='<%# Eval("Businessdays") %>'>
                            </asp:Label>
                        </GroupFooterTemplate>
                        <Columns>
                            <telerik:GridBoundColumn DataField="VacationRequestID" HeaderText="VacationRequestID"
                                Visible="false">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="ConsultantID" HeaderText="ConsultantID" Visible="false">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="ConsultantName" HeaderText="Resource" SortExpression="ConsultantName">
                            </telerik:GridBoundColumn>
                            <telerik:GridTemplateColumn ItemStyle-Width="15%" HeaderText="Dates">
                                <ItemTemplate>
                                    <asp:Label ID="lblDates" runat="server" Text='<%#String.Format("{0}-{1}", Eval("startdate").ToString(),Eval("enddate").ToString()) %>'></asp:Label>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridBoundColumn Aggregate="Sum" DataField="Businessdays" HeaderText="Business Days"
                                Visible="true" FooterText="Total   ">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Approved" HeaderText="Approved" Visible="true">
                            </telerik:GridBoundColumn>
                        </Columns>
                        <GroupByExpressions>
                            <telerik:GridGroupByExpression>
                                <GroupByFields>
                                    <telerik:GridGroupByField FieldName="vacationmonth" />
                                </GroupByFields>
                            </telerik:GridGroupByExpression>
                        </GroupByExpressions>
                    </MasterTableView>
                </telerik:RadGrid>




protected void RgrdConsultantVacationweek_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            try
            {
                BindRgrdConsultantVacationweek();
            }
            catch (Exception ex)
            {


            }
        }


        protected void BindRgrdConsultantVacationweek()
        {
            try
            {
                //DateTime lastDate = GetLastDateOfWeek((DateTime.Now).Date, DayOfWeek.Saturday);
                DataTable dt = GetConsultantRequest(Convert.ToInt32(Session["CRUserID"]), true, Convert.ToInt32(Session["UserType"]), Convert.ToInt32(ddlTypeOfLeave.SelectedValue), rdpProjectStartDate.SelectedDate, rdpProjectEndDate.SelectedDate, Convert.ToInt32(ddlPractices.SelectedValue));
                RgrdConsultantVacationweek.DataSource = dt;
               
            }
            catch (Exception ex)
            {


            }
        }
thanks in advance.
Eyup
Telerik team
 answered on 12 Oct 2012
1 answer
216 views
Hi ,

I have a requirement to show realfont sizes in pt.  I used the trick already mentioned in many other threads:-

function OnClientSelectionChange(editor, args) {
 
 
    var tool = editor.getToolByName("RealFontSize");
    if (tool ) {
        setTimeout(function () {
            debugger;
            var value = tool.get_value(); 
            if (!value || value.indexOf('pt') >= 0)
                return;
            value.replace('px', '');
            var newSize = parseInt(value) * 0.75;
            if (newSize.toString().indexOf('.25') >= 0) {
                newSize -= 0.25;
            } else if (newSize.toString().indexOf('.75') >= 0) {
                newSize += 0.25;
            }
            tool.set_value(newSize + 'pt');
        }, 0);
    }
}


The problem comes when i use style builder over some text and set the font size to some other metric say cm/mm. i don't see the converted value in pt in the real font size dropdown in pt. this works fine in Chrome and Firefox but on in IE.

I am using radeditor in ribbonbar mode. Is there a way to fix this.

Thanks,
AM

Rumen
Telerik team
 answered on 12 Oct 2012
1 answer
159 views
Hello,

To Print  Grid Data With all paging  & Filter Data, i use this program (from : http://www.telerik.com/community/forums/aspnet-ajax/grid/how-to-print-grid-data-with-all-paging.aspx ) :
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Testing.aspx.vb" Inherits="Aspen.Testing" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
 
<head runat="server">
    <title>Telerik Print Fucntion</title>
<telerik:RadCodeBlock runat ="server" ID= "ClientExport">
<script type = "text/javascript" >
          
    function getOuterHTML(obj){
           if (typeof (obj.outerHTML) == 'undefined')
                {
                      var divWrapper = document.createElement("div");
                      var copyOb = obj.cloneNode(true);
                      divWrapper.appendChild(copyOb);
                      return divWrapper.innerHTML
                }
            else
         return obj.outerHTML;
 }
 function PrintRadGrid( ){  
            var radGrid = $find('RadGrid1');
             
            var previewWnd = window.open('about:blank', '', '', false);
            var sh = '<%= ClientScript.GetWebResourceUrl(RadGrid1.GetType(),String.Format("Telerik.Web.UI.Skins.{0}.Grid.{0}.css",radGrid1.Skin)) %>';
            var styleStr = "<html><head><link href = '" + sh + "' rel='stylesheet' type='text/css'></link></head>";
            var htmlcontent = styleStr + '<body>' + getOuterHTML($find('RadGrid1').get_element()) + '</body></html>'; 
            previewWnd.document.open();
            previewWnd.document.write(htmlcontent);
            previewWnd.document.close();
            previewWnd.print();
            previewWnd.close();       
 }  
     
 </script>
 </telerik:RadCodeBlock>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
      <AjaxSettings >
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID ="btnExport">
            <UpdatedControls >
                <telerik:AjaxUpdatedControl ControlID ="btnExport" />
            </UpdatedControls>
            </telerik:AjaxSetting>
           </AjaxSettings>
    </telerik:RadAjaxManager>
    <div>
        <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging ="true"
            Width="493px" >
        <ExportSettings FileName ="Hello" Excel-FileExtension ="xls" OpenInNewWindow ="true" IgnorePaging ="true" ></ExportSettings>
            <MasterTableView>
                 <RowIndicatorColumn>
                     <HeaderStyle Width="20px"></HeaderStyle>
                </RowIndicatorColumn>
 
                <ExpandCollapseColumn>
                     <HeaderStyle Width="20px"></HeaderStyle>
                </ExpandCollapseColumn>
            </MasterTableView>
            <ClientSettings>
                <Scrolling AllowScroll="True" UseStaticHeaders="True" />
            </ClientSettings>
        </telerik:RadGrid>
    </div>
    <input ID="btnPrint" runat="server" type="button"   onclick="PrintRadGrid();" value="Print Grid Data5" />
    </form>
</body>
</html>


this solution works in IE and Firefox but it does not work in chrome. The result is empty.
Do you have this problem in Chrome? Do you have a solution in chrome?

Pavlina
Telerik team
 answered on 12 Oct 2012
1 answer
116 views
Hello!

I am having a disagreement with a co-worker on the design of web pages that are using the RadGrid as the primary control. In his design he suggests that the grid should be build dynamically, adding columns and properties, etc. in the on_Init event. My suggested design is that the layout for the grid be done in the web page markup and using the page/grid events for only functionality and binding. The radgrid on the page needs to do some very complicated tasks and act like an excel spreadsheet. In our spreadsheet style control it will have a master/detail view and include custom filtering and incorporate event handling such as the double click event and right click event. Now, in my version of the design I plan to use the NeedDataSource to bind a datatable; however, he believes that the datafield can be set dynamically as well. Can you provide a brief list of pro's and con's for each of the two approaches to designing the webpage grid layouts?

Thanks,

Steve Holdorf
Maria Ilieva
Telerik team
 answered on 12 Oct 2012
1 answer
154 views
I have a user control which has a combobox and two label.  The user control will be created inside of RadContextMenu.  I like to access label witnin this user control from Javacript.  Can you help me point out how I can do this?

User Control Definition

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Sample_CheckComboBox.ascx.cs" Inherits="StoneHorse3.Controls.Sample_CheckComboBox" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<br />
<table cellpadding="0" cellspacing="1"  width="88">
    <tr>    
        <td>
            <telerik:RadButton ID="btnFilter" runat="server" Text="Apply" Width="39px" Height="25px" OnClick="btnFilter_Click" >
                <Image ImageUrl="~/Images/bloombergyellowsmall.png" IsBackgroundImage="true" />
            </telerik:RadButton>                           
        </td>       
        <td>
            <telerik:RadButton ID="btnClear" runat="server" Text="Clear" Width="39px" Height="25px" onclick="btnFilterClear_Click"  >
                <Image ImageUrl="~/Images/bloombergyellowsmall.png" IsBackgroundImage="true" />
            </telerik:RadButton> 
        </td>
    </tr>
    <tr >
        <asp:Label ID="Label1" runat="server" Text=" "></asp:Label>
    </tr>       
    <tr>
        <th colspan="2">
            <telerik:RadComboBox ID="cmbFieldList" runat="server" AutoPostBack="true"
            OnItemDataBound="cmbFieldList_ItemDataBound" Style="z-index: 9000"
            OnClientDropDownClosing="radComboBox_OnClientDropDownClosing" OnClientDropDownOpening="radComboBox_OnClientDropDownOpening"
            >
            </telerik:RadComboBox>                   
            <asp:Label ID="lblFieldName" runat="server" Text="" ></asp:Label>
            <asp:Label ID="lblSectorID" runat="server" Text="" ></asp:Label>
        </th>                     
    </tr>
</table>
<br />

the label I like to gain access to are "lblFieldName" and "lblSectionID"

In Javascript I want to assign colUniqueName and sectorid to each of these two labels.

var filteredColId = "";
function showMenu(event, colUniqueName, filtertype, sectorid) {
            $find("<%=rcmCheckCombo.ClientID%>").show(event);
            ???lblFieldName= colUniqueName;
            ???lblSectorID= sectorid;
    }
}
How can I do something like this?  what would be the proper syntax? 

Thanks

Mark
Boyan Dimitrov
Telerik team
 answered on 12 Oct 2012
7 answers
263 views
Hi,

Is there any way to have a "Show all" option on the pager for the Grid?

Thanks,
Dewang
Rohan
Top achievements
Rank 1
 answered on 12 Oct 2012
1 answer
145 views
I 'm facing with the problem of PageIndex change doesn't work in my grid.I try to research with another Radgrid view's page index is working well.Could u pls check below grid?

          <telerik:RadGrid ID="RadGrid2" runat="server"  
                            AllowPaging="true"
                          GridLines="Horizontal" AutoGenerateColumns="False" 
                            onitemcommand="Edit_Command">
                            <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True">
                                <Selecting AllowRowSelect="True" />
                            </ClientSettings>
                            <MasterTableView DataKeyNames="ID" AllowMultiColumnSorting="True">
                                <CommandItemSettings ExportToPdfText="Export to PDF" />
                                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" 
                                    Visible="True">
                                    <HeaderStyle Width="20px" />
                                </RowIndicatorColumn>
                                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" 
                                    Visible="True">
                                    <HeaderStyle Width="20px" />
                                </ExpandCollapseColumn>
                                <Columns>
                                    <telerik:GridBoundColumn DataField="ID" FilterControlAltText="Filter ID column" 
                                        HeaderText="ID" SortExpression="ID" UniqueName="ID" Visible="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="DOID" 
                                        FilterControlAltText="Filter DOID column" HeaderText="Ref No" 
                                        SortExpression="DOID" UniqueName="DOID">
                                    </telerik:GridBoundColumn>
                                  <%--  <telerik:GridBoundColumn DataField="DeliveryDate" DataType="System.DateTime" DataFormatString="{0:dd/MM/yyyy}"
                                        FilterControlAltText="Filter DeliveryDate column" HeaderText="DeliveryDate" 
                                        SortExpression="DeliveryDate" UniqueName="DeliveryDate">
                                    </telerik:GridBoundColumn>--%>
                                    <telerik:GridBoundColumn DataField="ExpectedDate" DataType="System.DateTime" DataFormatString="{0:dd/MM/yyyy}"
                                        FilterControlAltText="Filter ExpectedDate column" HeaderText="ExpectedDate" 
                                        SortExpression="ExpectedDate" UniqueName="ExpectedDate">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="ConsignmentType" 
                                        FilterControlAltText="Filter ConsignmentType column" 
                                        HeaderText="ConsignmentType" SortExpression="ConsignmentType" 
                                        UniqueName="ConsignmentType">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Reason" 
                                        FilterControlAltText="Filter Reason column" HeaderText="Reason" 
                                        SortExpression="Reason" UniqueName="Reason">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Status" 
                                        FilterControlAltText="Filter Status column" HeaderText="Status" 
                                        SortExpression="Status" UniqueName="Status">
                                    </telerik:GridBoundColumn>
                                   <telerik:GridEditCommandColumn ButtonType="ImageButton"
                                UniqueName="EditCommandColumn">
                            </telerik:GridEditCommandColumn>
                                </Columns>
                                <EditFormSettings>
                                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                    </EditColumn>
                                </EditFormSettings>
                            </MasterTableView>
                            <FilterMenu EnableImageSprites="False">
                            </FilterMenu>
                        </telerik:RadGrid>

I do appreciate every suggestion.Thanks.
Andrey
Telerik team
 answered on 12 Oct 2012
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?