Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
90 views
I have a RadDockLayout and RadDockZone in the markup and I'm dynamically add RadDock controls from code behind to RadDockZone. And the intended drag and drop behavior of Dock items within the Zone is working fine in IE and Chrome, but not in Firefox. In Firefox when I click on the Title area of the RadDock item (which is the drag handler) the Dock item detached from the list and from the Zone and goes far top of the page from the cursor or just disappear. So far what I have found is this;

The RadDockZone is placed in bottom of the long page (with browser scrolled to bottom). The RadDock item does not take the scroll height into account when it's position is calculated.

Im using latest version of Firefox (v17) and other browsers (IE v9, Chome v23)

Is there a fix for this ? need help.
Slav
Telerik team
 answered on 17 Sep 2013
1 answer
136 views
Hi,
The result set from database comes back as the following data. It is parent child relation. TransactionID 1009 has 3 child records in the database with 3 accounts. The total transaction amount is $12/- (3 + 4+5).
So parent table has ID and other data. Child table has Account#, AccountName, Amount, parentID and some other fields.
  
  
ID  Name    Account#    AccountName Amount
1007    Sam 31747   a   1
1008    Sam 31748   av  2
1009    Sam 31797   ab  3
1009    Sam 31798   ac  4
1009    Sam 31799   ad  5
  
  
  
When it is displayed in the radgrid, we are showing it like this:
  
ID  Name    AccountNum  AccountName Amount
1007    Sam 31747            a        1
1008    Sam 31748            av       2
1009    Sam 31797            Ab ($3)  12
            31798            Ac ($4)
            31799            Ad ($5) 
  
We are achieving this by doing this logic:
While (reader.Read())
{
     //logic to check old transaction or new transaction by comparing ID
         If (newID != oldID)
        {
                //new transaction. So do the code
        }
        Else
        {
        //still previous transaction. So concatenate account numbers
        accountNum += "<br/>" + reader.GetString(reader.GetOrdinal("AccountNumber"));
             accountName += "<br/>" + reader.GetString(reader.GetOrdinal("AccountName"));
             amount += reader.GetDecimal(reader.GetOrdinal("Amount"));
}
}
  
I want this grid data to be exported to BIFF format excel like this:
ID  Name    Account#    AccountName Amount
1007    Sam                            1
            31747         a   
1008    Sam                            2
             31748        av  
1009    Sam                            12
             31797        Ab ($3)     
             31798        Ac ($4) 
             31799        Ad ($5) 
  
  
I tried using ExportInfrastructure and shiftingRowsDown method in a loop, it works for only 1007 and 1008 rows. But not to 1009. I understand why. That has been treated as 1 row eventhough there are multiple accounts. The account# column is just string concatenation. So, when I am exporting looks like I need to use my original dataset. 
  
I tried to create another radgrid programmatically and assign original result set. We have a btn upon clicking it, I export data to excel like this:
  
protected void btnExport_Click(object sender, EventArgs e)
        {
            radGrid.Page.Response.ClearHeaders();
            radGrid.Page.Response.Cache.SetCacheability(HttpCacheability.Private);
            radGrid.MasterTableView.ExportToExcel();
        }
  
protected void rgdChecks_BiffExporting(object sender, Telerik.Web.UI.GridBiffExportingEventArgs e)
 {
      
}
  
Where should I programmatically create radgrid and do customize data to look like above.
We do not want to use hierarchical grid.
  
Please let me know how to get this kind of output?
Thanks,
Prathiba.
Kostadin
Telerik team
 answered on 17 Sep 2013
1 answer
205 views
HI,
Below is my requirement,
Need to attach Rad context Menu on right click in side an asp.net text-box control.

I have used context menu example given in
http://demos.telerik.com/aspnet-ajax/menu/examples/contextmenu/default/defaultcs.aspx

This is working on a normal asp.net web page, but when ever I use master page context menu is not working any more. Below is the aspx page code
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="TestPageWithMasterPage.aspx.cs" Inherits="TestPageWithMasterPage" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <telerik:RadContextMenu runat="server" ID="ChooseDesktopImage"
          EnableRoundedCorners="true" EnableShadows="true" OnClientItemClicked="chooseDesktopImageItemClicked">
                    <Targets>
                        <telerik:ContextMenuElementTarget ElementID="desktop" />
                    </Targets>
                    <Items>
                        <telerik:RadMenuItem Text="Beach" Value="Beach" />
                        <telerik:RadMenuItem Text="Field" Value="Field" />
                        <telerik:RadMenuItem Text="House" Value="House" />
                    </Items>
     </telerik:RadContextMenu>
        <asp:TextBox ID="desktop" runat="server"></asp:TextBox>
 
         <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
          <script type="text/javascript">
              function showingSetAsDesktop(sender, args) {
                  //Disable the setAsDesktop menu on the desktop image
                  if (args.get_targetElement().id == "desktop") {
                      args.set_cancel(true);
                  }
              }
 
              function chooseDesktopImageItemClicked(sender, args) {
                  $get("desktop").value = args.get_item().get_value();
              }
          </script>
     </telerik:RadScriptBlock>
</asp:Content>


Thanks,
Nabarun.
Kate
Telerik team
 answered on 17 Sep 2013
1 answer
116 views
i have a couple of RadComboboxs inside a GridView.
inside the RowDataBound Event of the GridView, I am doing the following:


Dim cmbDispenseSize As RadComboBox = CType(e.Row.FindControl("cmbDispenseSizeAdd"), RadComboBox)
 
 
bindIngredient(CType(cmbIngredient, RadComboBox), 0) 'fill the combobox with initial data
 
 
 AddHandler cmbDispenseSize.ItemsRequested, AddressOf cmbDispense_ItemsRequested 'add handler for ItemsReqested event


Private Sub cmbDispense_ItemsRequested(sender As Object, e As RadComboBoxItemsRequestedEventArgs)
 
 
 
       If Not e.Context("IngredientAddID").ToString() = "" Then
           Dim IngredientAddID As Integer = CInt(e.Context("IngredientAddID").ToString())
           ViewState("IngredientAddID") = CInt(e.Context("IngredientAddID").ToString())
           getRequestedItems(e, CType(sender, RadComboBox), 0, IngredientAddID)
       End If
 
   End Sub


Private Sub getRequestedItems(ByRef e As RadComboBoxItemsRequestedEventArgs, ByRef sender As RadComboBox, ByVal cmbType As Integer, Optional ByVal IngredientID As Integer = 0)
 
 
      Dim dt As DataTable
      If cmbType = 0 Then
          dt = _recipe.getDispenseSize(_security.UserID, IngredientID, e.Text.ToUpper)
 
          loadRequestedItems(e, "DispenseSizeName", "DispenseSizeID", dt, sender)
      ElseIf cmbType = 1 Then
          dt = _recipe.getStockItems(_security.UserID, _security.DivisionId, _recipeId, e.Text.ToUpper)
 
          loadRequestedItems(e, "StockItemName", "StockItemID", dt, sender)
 
      End If
 
  End Sub

i'm having trouble getting the ItemsRequested working. it all works fine if i run GridView.DataBind on page_load and have page_load run everytime something is typed into the combobox. unfortunately the GridView takes about 4 seconds to load, so the combobox ItemsRequested looks really slow.

if i ont GridView.DataBind in the Page_Load - and therefore, it doesn't run everytime something is typed into the combobox - the ItemsRequested Event does not run. (no doubt due to the fact my AddHandler is inside the RowDataBond event)



are there any examples you could show me where a RadCombobox is inside a GridView and is being created programatically within the RowDataBound event?

thank you for your help
David
Top achievements
Rank 1
 answered on 17 Sep 2013
1 answer
404 views
I have a button on the page, by default, when I click, it's automatically leaving the current page and transfer to new page. Then if I set its Target = "_blank", it will open a new tab (Firefox) and switch to that new tab immediately.

I would like to know how to set it so that it will open the new tab, but won't switch to that new tab and remain on the current page?

Thanks All.
Danail Vasilev
Telerik team
 answered on 17 Sep 2013
0 answers
81 views
您好:
請問如何設定ReportFilterField 的值,我希望可以設定日期的區間,如下表,請設定成2013-01-01 ~ 2013-01-31

Hello:
How to set up ReportFilterField value, I wish to set the date range, the following table, set to 2013-01-01 ~ 2013-01-31
Fu
Top achievements
Rank 1
 asked on 17 Sep 2013
3 answers
108 views
Hi everyone,

I don't know if this is a feature or a bug, but in my Multicolumn RadMenus not all the rendered columns have the same number of items (please see may attachment). This can be also reproduced with the demo samples from Telerik (http://demos.telerik.com/aspnet-ajax/menu/examples/multicolumnmenu/defaultcs.aspx) if the column number of columns is set to 3 (the submenues of "Support", "Community" and "Company").

In my oppinion the correct layout should provide equal column heights (as number of items per column) and only the last column can have fewer items.

Here is my code:

<t

 

 

elerik:radmenu runat="server" ID="RadMenu1" EnableRoundedCorners="true" EnableShadows="true" Skin="Sitefinity"> 

 

<DefaultGroupSettings RepeatColumns="5" RepeatDirection="Vertical" />  

 

<Items> 

 

<telerik:RadMenuItem Text="Blablabla" NavigateUrl="Default.aspx">  

 

<Items>
<telerik:RadMenuItem BackColor="Red" runat="server" Text="Company1"></telerik:RadMenuItem> <telerik:RadMenuItem runat="server" Text="Services2"></telerik:RadMenuItem>
<telerik:RadMenuItem runat="server" Text="Services3"></telerik:RadMenuItem>
<telerik:RadMenuItem runat="server" Text="Partners4"></telerik:RadMenuItem>
<telerik:RadMenuItem runat="server" Text="Contacts5"></telerik:RadMenuItem> 

 

<telerik:RadMenuItem BackColor="Red" runat="server" Text="Company"></telerik:RadMenuItem>
<telerik:RadMenuItem runat="server" Text="Services"></telerik:RadMenuItem> 

<telerik:RadMenuItem runat="server" Text="Partners"></telerik:RadMenuItem>
<telerik:RadMenuItem runat="server" Text="Contacts"></telerik:RadMenuItem>
<telerik:RadMenuItem runat="server" Text="Company"></telerik:RadMenuItem> 

<telerik:RadMenuItem BackColor="Red" runat="server" Text="Services"></telerik:RadMenuItem> 

<telerik:RadMenuItem runat="server" Text="Partners"></telerik:RadMenuItem>
<telerik:RadMenuItem runat="server" Text="Contacts"></telerik:RadMenuItem>
<telerik:RadMenuItem runat="server" Text="Company"></telerik:RadMenuItem>
<telerik:RadMenuItem BackColor="Red" runat="server" Text="Services"></telerik:RadMenuItem>
<telerik:RadMenuItem runat="server" Text="Partners"></telerik:RadMenuItem> 

<telerik:RadMenuItem runat="server" Text="Contacts"></telerik:RadMenuItem>
</Items>
</telerik:RadMenuItem> 

 

<telerik:RadMenuItem Text="Test" NavigateUrl="Default.aspx"></telerik:RadMenuItem> 

 

</Items>
</telerik:radmenu>

 

 

 

 

How can I achieve such a layout (having all the columns equal - except the last one if is necesary)?

Thanks!
Kate
Telerik team
 answered on 17 Sep 2013
3 answers
492 views
First Row in the Grid always invoke OnRowClick event even if row is double clicked. For other rows it works max time but for few instances they also don't work. Please let me know how to resolve.
<telerik:RadGrid ID="grdMain" runat="server" AutoGenerateColumns="false" AllowSorting="True"
                               GridLines="None" CellSpacing="0" OnPreRender="grdMain_PreRender" OnSortCommand="grdMain_SortCommand"
                               OnNeedDataSource="grdMain_NeedDataSource" ClientSettings-ColumnsReorderMethod="Reorder"
                               ClientSettings-ReorderColumnsOnClient="true" PagerStyle-AlwaysVisible="true"
                               EnableHeaderContextMenu="true" PageSize="25" Width="100%" AllowPaging="true"
                               PagerStyle-Position="Top" PagerStyle-Mode="NextPrevNumericAndAdvanced" Height="100%">
                               <MasterTableView DataKeyNames="GridNbr" AutoGenerateColumns="false" EnableColumnsViewState="true"
                                   ClientDataKeyNames="GridNbr" TableLayout="Auto" Width="100%">
                                   <Columns>
                                       <telerik:GridBoundColumn UniqueName="GridNbr" SortExpression="GridNbr" HeaderText="GridNbr"
                                           DataField="GridNbr" DataFormatString="{0}">
                                       </telerik:GridBoundColumn>
                                       <telerik:GridBoundColumn UniqueName="Department" SortExpression="Department" HeaderText="Department"
                                           DataField="Department" Resizable="true" DataFormatString="<nobr>{0}</nobr>">
                                       </telerik:GridBoundColumn>
                                       <telerik:GridBoundColumn UniqueName="Product" SortExpression="Product" HeaderText="Product"
                                           DataField="Product" Resizable="true" DataFormatString="<nobr>{0}</nobr>">
                                       </telerik:GridBoundColumn>
                                       <telerik:GridBoundColumn UniqueName="Program" SortExpression="Program" HeaderText="Program"
                                           DataField="Program" Resizable="true" DataFormatString="<nobr>{0}</nobr>">
                                       </telerik:GridBoundColumn>
                                       <telerik:GridBoundColumn UniqueName="MarketingName" SortExpression="MarketingName"
                                           HeaderText="MarketingName" DataField="MarketingName" Resizable="true" DataFormatString="<nobr>{0}</nobr>">
                                       </telerik:GridBoundColumn>
                                       <telerik:GridBoundColumn UniqueName="Effort" SortExpression="Effort" HeaderText="Effort"
                                           DataField="Effort" Resizable="true" DataFormatString="<nobr>{0}</nobr>">
                                       </telerik:GridBoundColumn>
                                       <telerik:GridBoundColumn UniqueName="Campaigndate" SortExpression="Campaigndate"
                                           HeaderText="CampaignDate" DataField="Campaigndate" Resizable="true" DataFormatString="<nobr>{0}</nobr>">
                                       </telerik:GridBoundColumn>
                                       <telerik:GridBoundColumn UniqueName="Project" SortExpression="Project" HeaderText="Project"
                                           DataField="Project" Resizable="true" DataFormatString="<nobr>{0}</nobr>">
                                       </telerik:GridBoundColumn>
                                       <telerik:GridBoundColumn UniqueName="ControlDesc" SortExpression="ControlDesc" HeaderText="Control Description"
                                           DataField="ControlDesc" Resizable="true" DataFormatString="<nobr>{0}</nobr>">
                                       </telerik:GridBoundColumn>
                                       <telerik:GridBoundColumn UniqueName="Offer" SortExpression="Offer" HeaderText="Offer"
                                           DataField="Offer" Resizable="true" DataFormatString="<nobr>{0}</nobr>">
                                       </telerik:GridBoundColumn>
                                       <telerik:GridBoundColumn UniqueName="Revision" SortExpression="Revision" HeaderText="Revision#"
                                           DataField="Revision" Resizable="true" DataFormatString="<nobr>{0}</nobr>">
                                       </telerik:GridBoundColumn>
                                       <telerik:GridBoundColumn UniqueName="DBMProjectID" SortExpression="DBMProjectID"
                                           HeaderText="DBMProjectID" DataField="DBMProjectID" Resizable="true" DataFormatString="<nobr>{0}</nobr>">
                                       </telerik:GridBoundColumn>
                                       <%-- <telerik:GridBoundColumn UniqueName="DBMContact" SortExpression="DBMContact" HeaderText="DBMContact"
                                       DataField="DBMContact" Resizable="true" DataFormatString="<nobr>{0}</nobr>">
                                   </telerik:GridBoundColumn>--%>
                                       <telerik:GridBoundColumn UniqueName="Blank" SortExpression="Blank" HeaderText=" "
                                           DataField="Blank" Resizable="true">
                                       </telerik:GridBoundColumn>
                                   </Columns>
                               </MasterTableView>
                               <ClientSettings AllowColumnsReorder="true" Selecting-AllowRowSelect="true" EnableRowHoverStyle="true"
                                   EnablePostBackOnRowClick="false">
                                   <Selecting AllowRowSelect="true" />
                                   <ClientEvents OnRowClick="RowClick" OnRowDblClick="RowDblClick" OnColumnShown="RefreshGrid"
                                       OnColumnHidden="RefreshGrid"></ClientEvents>
                                   <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true" ScrollHeight="90%" />
                                   <%--<Scrolling AllowScroll="True" UseStaticHeaders="false" ScrollHeight="370px" />--%>
                                   <Resizing AllowRowResize="false" EnableRealTimeResize="false" ResizeGridOnColumnResize="false"
                                       AllowColumnResize="True" ClipCellContentOnResize="false" AllowResizeToFit="true">
                                   </Resizing>
                               </ClientSettings>
                           </telerik:RadGrid>
 
var isDoubleClick = false;
                       var clickHandler = null;
                       var ClickedIndex = null; // newly added
 
                       // single click
                       function RowClick(sender, args) {
                           ClickedIndex = args._itemIndexHierarchical; // newly added
                           isDoubleClick = false;
                           if (clickHandler) {
                               window.clearTimeout(clickHandler);
                               clickHandler = null;
                           }
                           clickHandler = window.setTimeout(ActualClick, 200);
 
                       }
                       // Double click
                       function RowDblClick(sender, args) {
                           ClickedIndex = args._itemIndexHierarchical; // newly added
                           isDoubleClick = true;
                           if (clickHandler) {
                               window.clearTimeout(clickHandler);
                               clickHandler = null;
                           }
                           clickHandler = window.setTimeout(ActualClick, 200);
                       }
 
                       function ActualClick() {
                           if (isDoubleClick) {
                               var grid = $find("<%=grdMain.ClientID %>");
                               if (grid) {
                                   var MasterTable = grid.get_masterTableView();
                                   var GridNbr = MasterTable.get_selectedItems()[0].get_cell("GridNbr").innerText;
                                   var Mode = "Open";
                                   var oWnd = window.radopen("GridEntry.aspx?GridNbr=" + GridNbr + "&Mode=" + Mode, "RadWindow1");
 
                                   oWnd.SetSize(1200, 530);
                                   oWnd.set_visibleStatusbar(false);
                                   oWnd.center();
                                   return false;
                               }
                           }
                           else {
                               var radMgr = $find("<%=RadAjaxManager1.ClientID %>");
                               radMgr.ajaxRequest("RowClick");
                               return false;
                           }
                       }
Vasil
Telerik team
 answered on 17 Sep 2013
1 answer
166 views
I have specific folder names for each users, like, 1, 2, 3, 4, etc. I need to make this My Documents. Is it possible to just change it's directory name?
Ianko
Telerik team
 answered on 17 Sep 2013
22 answers
422 views
There is a stackoverflow question which hilights the exact issue im having problems with:
http://stackoverflow.com/questions/17486458/telerik-mastertableview-filterexpression-always-out-of-date#

Where I have a custom grid, and whenever I am doing a rebind I want to get the FilterExpression and pass it to my underlying linq queryable to add the filters to the existing query. However whenever I get the FilterExpression from the grid it is always displaying the previous filter state, not the most recent one.

If you read the scenarios in the stackoverflow post it hilights the exact scenarios in which this occurs, so is there any way round this issue, or to force the FilterExpression to be updated for use?
Kostadin
Telerik team
 answered on 17 Sep 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
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
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
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
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?