Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
99 views

Hello Telerik team!
I use the example for load on demand my orgchart, but, not sure how work, because in the example, data is load one time, but i need get data from database and create new nodes from the node selected.

I tried to create nodes but did not succeed.
Annex example.

 

Thank you vey much.

Atte.:Charly.

Veselin Tsvetanov
Telerik team
 answered on 13 Jun 2016
3 answers
58 views

I am using the built-in Export to Excel and Refresh buttons. Strangely when deployed to local and remote environment the layout differs - DIV at local and Table TR for remote, out of the same code base. The left aligned layout, one shown in the first screen capture, is the desired outcome. Can confirm this absurd behaviour is only present on IE (Same browser configuration on different terminals used to test both environments and had consistent results) - Chrome and Firefox have been tested to be rendering the desired layout on both environment.

Here is my RadGrid markup:

<asp:Panel ID="pnlMainReport" runat="server">
               <telerik:RadGrid ID="rgRecReport" runat="server" DataSourceID="dsRec" AllowAutomaticUpdates="False" 
                   RenderMode="Lightweight" AllowMultiRowSelection="false"
                   Skin="Metro"  AllowPaging="true"
                  OnItemDataBound="rgRecReport_ItemDataBound"
                   CssClass="RemoveBorders">
                   <ClientSettings EnableAlternatingItems="false" EnableRowHoverStyle="true">
                       <Selecting AllowRowSelect="true" />
                       <ClientEvents OnRowClick="ReportContextMenu" OnRowContextMenu="ReportContextMenu" />
                   </ClientSettings>
                   <MasterTableView AutoGenerateColumns="False" DataSourceID="dsRec" DataKeyNames="ResultTableName"   PageSize="100"  
                       CommandItemDisplay="Top"  CommandItemSettings-ShowExportToExcelButton="true" CommandItemSettings-ExportToExcelImageUrl="~/images/excel.png" CommandItemSettings-ShowAddNewRecordButton="false">

HTML of the incorrect layout on IE:

<tr>
                                    <td align="left"> </td><td align="right"><input name="rgRecReport$ctl00$ctl02$ctl00$RefreshButton" title="Refresh" class="rgRefresh" id="rgRecReport_ctl00_ctl02_ctl00_RefreshButton" onclick="javascript:__doPostBack('rgRecReport$ctl00$ctl02$ctl00$RefreshButton','')" type="button" value=" "><a id="rgRecReport_ctl00_ctl02_ctl00_RebindGridButton" href="javascript:__doPostBack('rgRecReport$ctl00$ctl02$ctl00$RebindGridButton','')">Refresh</a>   |   <a id="rgRecReport_ctl00_ctl02_ctl00_ExportToExcelButton" href="javascript:__doPostBack('rgRecReport$ctl00$ctl02$ctl00$ExportToExcelButton','')"><img style="border: 0px currentColor; border-image: none;" alt="" src="/images/excel.png"> Export to Excel</a>  </td>
                                </tr>

Maria Ilieva
Telerik team
 answered on 13 Jun 2016
5 answers
284 views
I have a telerik datagrid and I would like to hide the collapse button when there are no childs available. It does not work as I would aspect.
This is my code :

<telerik:RadGrid ID="grdTest" runat="server" AutoGenerateColumns="false" PageSize="20" AllowSorting="true" AllowPaging="true" ShowGroupPanel="true" ShowFooter="true"
 MasterTableView-HierarchyDefaultExpanded="true"
 OnNeedDataSource="grdTest_NeedDataSource" OnItemCreated="grdTest_ItemCreated" OnPreRender="grdTest_PreRender" >
 
 <MasterTableView AllowSorting="true" DataKeyNames="TicketID, TopTicketID" Width="100%" HierarchyLoadMode="ServerBind">
 <SelfHierarchySettings ParentKeyName="TopTicketID" KeyName="TicketID" />
 <Columns>
 <telerik:GridBoundColumn SortExpression="TicketID" HeaderText="Ticket" HeaderButtonType="TextButton" DataField="TicketID" UniqueName="TicketID"></telerik:GridBoundColumn>
  </Columns>
 </MasterTableView>
 <ClientSettings AllowExpandCollapse="true"></ClientSettings>
 </telerik:RadGrid>

my C# code behind :

protected void grdTest_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
         {
            grdTest.DataSource = BLogic.ITTickets.GetStructure(null, null, 0);
         }
 
  protected void grdTest_PreRender(object sender, EventArgs e)
        {
            HideExpandColumnRecursive(grdTest.MasterTableView);
        }
        public void HideExpandColumnRecursive(GridTableView tableView)
        {
            GridItem[] nestedViewItems = tableView.GetItems(GridItemType.NestedView);
            foreach (GridNestedViewItem nestedViewItem in nestedViewItems)
            {
                foreach (GridTableView nestedView in nestedViewItem.NestedTableViews)
                {
                    if (nestedView.Items.Count == 0)
                    {
                        TableCell cell = nestedView.ParentItem["ExpandColumn"];
                        cell.Controls[0].Visible = false;
                        cell.Text = " ";
                        nestedViewItem.Visible = false;
                    }
                    if (nestedView.HasDetailTables)
                    {
                        HideExpandColumnRecursive(nestedView);
                    }
                }
            }
        }

The BLogic.ITTickets.GetStructure(null, null, 0);  calls a stored procedure on sql server that gives me back the list with the data.

Can anyone please tell me what I do wrong?

Kind regards

Suzy

Konstantin Dikov
Telerik team
 answered on 13 Jun 2016
4 answers
310 views

Hi!

   I have a radGrid on the page, which has a [AddNew] button that will trigger a <EditFormSettings> popup window. 

Also, when users click on the Edit button on each row, I also have a code-behind ImgBtn.Attributes.Add("onclick", sb.ToString()) that will popup a window for users to edit data. 

   My problem now is when I click on the Edit button of the gridrow, both windows popup.

It was fine before I add DetailWin.focus to bring the popup to front.   How can I fix this?

Attached is my code, thanks in advaned.

SH.

 

(aspx)
<telerik:RadGrid ID="RadGd1" AutoGenerateColumns="false" PageSize="10" AllowPaging="true" ShowFooter="true" AllowSorting="true"
            ShowStatusBar="true" AutoGenerateDeleteColumn="false" AllowAutomaticInserts="false"
            OnItemCreated ="RadGd1_ItemCreated" OnNeedDataSource="RadGd1_NeedDataSource"
            OnItemDataBound="RadGd1_ItemDataBound"
            Width="90%" Skin="Simple" runat="server">
            <MasterTableView DataKeyNames="FormId" CommandItemDisplay="Top" CommandItemSettings-AddNewRecordText="Add New">
                <CommandItemTemplate>
                    <asp:LinkButton ID="lkBtnAdd" runat="server" CommandName="InitInsert" Visible='<%# !RadGd1.MasterTableView.IsItemInserted %>'>
                        <img style="border:0px;vertical-align:bottom; height:16px; margin-top:6px;position:relative; float:left" alt="Add New" src="../images/document_add.png"/>新增
                    </asp:LinkButton>  
                     
                                             
                    <div style="padding-left:20px"></div>
                </CommandItemTemplate>
                                                 
                <Columns>
                    <telerik:GridEditCommandColumn UniqueName="EditCmdCol" ButtonType="ImageButton" ItemStyle-CssClass="" ColumnGroupName="cmdGroup"
                    EditImageUrl="~/images/edit_data_20x19.png" ItemStyle-Width="20" ItemStyle-Height="19">
                        <HeaderStyle />
                    </telerik:GridEditCommandColumn>
 
                    <telerik:GridButtonColumn UniqueName="SaveAsDocCmdCol" ButtonType="ImageButton" ItemStyle-CssClass="" ColumnGroupName="cmdGroup"
                    ImageUrl="~/images/doc_save_as.png" ItemStyle-Width="16" ItemStyle-Height="16">
                    </telerik:GridButtonColumn>
 
                    <telerik:GridButtonColumn UniqueName="SaveAsPdfCmdCol" ButtonType="ImageButton" ItemStyle-CssClass="" ColumnGroupName="cmdGroup"
                    ImageUrl="~/images/pdfDownload_4.png" ItemStyle-Width="16" ItemStyle-Height="16">
                    </telerik:GridButtonColumn>
 
                                                     
                    <telerik:GridBoundColumn HeaderText="CustomerName" DataField="CustomerName" UniqueName="CustomerName" ItemStyle-Width="70px"></telerik:GridBoundColumn>                   
                    <telerik:GridBoundColumn HeaderText="Created Time" DataField="CreateDT" UniqueName="CreateDT" ItemStyle-Width="100px"></telerik:GridBoundColumn>                   
                    <telerik:GridBoundColumn HeaderText="Updated Time" DataField="SentDT" UniqueName="SentDT" ItemStyle-Width="100px"></telerik:GridBoundColumn>
                </Columns>
                <EditFormSettings UserControlName="../UserControl/UCNewCSDetail.ascx" EditFormType="WebUserControl" PopUpSettings-Height="600px" PopUpSettings-Width="800px"
                    PopUpSettings-ScrollBars="Vertical" PopUpSettings-Modal="true" >
                    <EditColumn UniqueName="EditCmdFrm"></EditColumn>
                </EditFormSettings>
                                                
            </MasterTableView>
            <ClientSettings>
                <ClientEvents OnPopUpShowing="PopUpShowing" />
            </ClientSettings>
        </telerik:RadGrid>
--------------------------------------------------------
(aspx.cs)
protected void RadGd1_ItemCreated(object sender, GridItemEventArgs e)
        {
             
            if (e.Item is GridDataItem)
            {
                GridDataItem oItem = (GridDataItem)e.Item;
                string strFormId = RadGd1.MasterTableView.DataKeyValues[e.Item.ItemIndex]["FormId"].ToString();
 
                StringBuilder sb = new StringBuilder();
                sb.Append("var DetailWin = window.open");
                sb.Append("('");
                sb.Append("CSDetail.aspx?FormId=" + strFormId);
                sb.Append("',");
                sb.Append("'NewWindow',");
                sb.Append("'scrollbars=yes,status=no,location=no,resizable=yes,Height=650,Width=1000,top=80,left=200'");
                sb.AppendLine("); ");   //return false;
                sb.AppendLine("DetailWin.focus();");
                 
                 
                ImageButton elemImgBtn = (ImageButton)oItem["EditCmdCol"].Controls[0];
                elemImgBtn.Attributes.Add("href", "javscript:void(0);");
                elemImgBtn.Attributes.Add("onclick", sb.ToString());
                                 
            }
    }

 

sharon
Top achievements
Rank 1
 answered on 13 Jun 2016
1 answer
113 views

Suppose I have a radgrid that displays records from a database table. The radgrid has an edit template, for editing these records. Inside the edit template is a user control. The user control has a textbox.

The question: How can I examine the contents of the textbox in the user control from the main page, client side? By main page, I mean the page that contains the radgrid. Is this even possible?

I've not been able to figure it out so far.

Eyup
Telerik team
 answered on 13 Jun 2016
1 answer
81 views

Hello,

I need move production website from one server to another. I'm not developer and I can see JavaScript throws error "Telerik not defined" on line below. I moved all bin folders etc. GAC does not have those assemblies. I can see Telerik.Web.UI.dll in BIN folder. Original web.config in place as well. Is it license issue or what do I do? Entries in web.config are below

 

<httpHandlers>
<add path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" validate="false" />
<add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false" />
<add path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler, Telerik.Web.UI, Version=2008.3.1314.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4" verb="*" validate="false" />
<add path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler, Telerik.Web.UI, Version=2008.3.1314.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4" verb="*" validate="false" />
</httpHandlers>

 

<add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" />
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule" scriptProcessor="" resourceType="Either" requireAccess="Read" />

<add name="Telerik_Web_UI_SpellCheckHandler_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler, Telerik.Web.UI, Version=2008.3.1125.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" />
<add name="Telerik_Web_UI_DialogHandler_aspx" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler, Telerik.Web.UI, Version=2008.3.1125.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" />

 

 

 

 

WebForm_InitCallback();Sys.Application.add_init(function() {
    $create(Telerik.Web.UI.RadComboBox, {"_dropDownW

Marin Bratanov
Telerik team
 answered on 13 Jun 2016
29 answers
1.2K+ views
hi,
i am getting this error when i add prometheus ajax manager
" the control with id'radajaxmanager1' requires a script manager on the page. the script manager must appear before any element that need it."

telerik.web.i added the ajax script manager and it is working fine with it's update panel and controls on page, add to that i get Ambiguous referenceui.radajaxmanager.

what am i missing here ?

Eyup
Telerik team
 answered on 13 Jun 2016
3 answers
205 views
How can I loop through all the items of the listview on the clientside to find a control in the item template?
Eyup
Telerik team
 answered on 13 Jun 2016
1 answer
76 views
Hi,
I have a radbutton, which when clicked does some processing.  I use a radprogress area to show the progress.  So far this works ok.
I have since enabled the ‘single click’ functionality.  This gives the impression that its working ok, as it becomes greyed out, however if a user clicks it still works?
I’m pretty sure it’s something to do with progress area as if I remove this it works ok?

Any ideas?
Stanimir
Telerik team
 answered on 13 Jun 2016
1 answer
212 views

Hi Guys,

I have used RadGrid with batchupdate. I have datalist, When I choose one item from DataList (Product code, Name, Quantity, Quom..), I want to add a new row into Radgrid and auto fill product code, name, quantity.. that I had chossen from Datalist.

I have function below:

I$("[id*=btnAddNewD]").live("click", function () {
            var prdccode = $("[id*=lblPrdcCode]", $(this).closest("table")).html();            
            var prdcname = $(this).parent().parent().parent().find("input[type=hidden]").val();                    
            addNewItem(prdccode, prdcname);
            return false;
        });
        function addNewItem(prdccode, prdcname) {
            var grid = $find('<%=RadGrid1.ClientID%>');
            var grid_master = grid.get_masterTableView()
            var grid_batchmanager = grid.get_batchEditingManager()
            grid_batchmanager.addNewRecord(grid_master);

            var newItem = grid_master.get_dataItems()[0]
            var v_prdccode = newItem.get_cell("PrdcCode");

            var newItem1 = grid_master.get_dataItems()[0]
            var v_prdcname = newItem1.get_cell("MPrdcNme");

            setTimeout(function () {
                grid.get_batchEditingManager().changeCellValue(v_prdccode, prdccode); => change
                grid.get_batchEditingManager().changeCellValue(v_prdcname, prdcname); => Not change
            }, 0);                        
        }

...but only first column was changed value. please help me. 

Thanks.

Eyup
Telerik team
 answered on 13 Jun 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?