Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
519 views
How can I scroll to bottom RadGrid from Client side.
Please help
Akshit
Top achievements
Rank 1
 answered on 13 Jun 2016
2 answers
364 views

Hi,

I have a radgrid with the following settings

  <ExportSettings IgnorePaging="true" OpenInNewWindow="true" HideStructureColumns="true">
                                                                    <Excel Format="Xlsx" DefaultCellAlignment="Left" />                                                                    
  </ExportSettings>    

<CommandItemTemplate>
                                                                        <asp:Button ID="btnShowAll" runat="server" Text="Clear Filter" CssClass="fa fa-refresh"
                                                                            AlternateText="Show All" ToolTip="Clear filters" CommandName="InitShowAll" />
                                                                        <asp:Button ID="btnExport" runat="server" Text="Export" CssClass="fa fa-refresh"
                                                                            AlternateText="Export" ToolTip="Export" CommandName="InitExport" />
  </CommandItemTemplate>

The issue is, I couldn't remove the filter row from the exported xlsx file. Even with ExportOnlyData = true the filter row data is visible. 

I also tried filterItem.Visible = false. Sill no luck.

Subhashini
Top achievements
Rank 1
 answered on 13 Jun 2016
6 answers
485 views
Hi,
 I have downloaded latest trial version of RadControls for ASP.NET.

I am just trying to use the RadEditor in my asp.net mvc view.
I tried http://www.telerik.com/help/aspnet-ajax/editor-getting-started.html
and
http://www.telerik.com/help/aspnet-ajax/mvc-using-editor.html

I just placed the editor on my view, no coding, nothing, but still i am getting the following error message in execution -
The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

I have looked various forums on telerik but doesn't found appropriate one to get the answer.
So finally requesting the support.

I have also created support ticket (523566) for this issue.

Please find the attached code i have tried.
Please help me resolve this issue.

Thanks and regards
Irfan Sheikh
Suresh
Top achievements
Rank 1
 answered on 13 Jun 2016
12 answers
324 views

Is it possible to toggle Full Screen mode on the sever-side for the RadImageGallery control?

I have a RadImageGallery (inside a RadAjaxPanel), based on a users permissions and other variables (defined on the server-side), I want to be able to toggle whether or not the Gallery is displayed in Full Screen initially or not.

 

Thanks in advance!

Jon
Top achievements
Rank 1
 answered on 13 Jun 2016
23 answers
325 views
Hi --
I'm trying to find out if Telerik or anyone else has created a plugin/extension for Microsoft Visual Studio 2010 that will allow Microsoft's Coded UI Test builder/runner to access all properties of Telerik's ASP.NET AJAX RadControls such as RadComboBox.

For background on my question, please see this article http://blogs.msdn.com/b/mathew_aniyan/archive/2011/03/28/visual-studio-ui-test-extensibility-scenarios-amp-guiding-principles.aspx which says 
"Microsoft encourages third party custom UI framework vendors, such as, ComponentOne, DevExpress, Infragistics and Telerik to build and support UI Testing for their custom UI frameworks."

I know that Telerik sells a Test Studio application that has translators for the RadControls, and Telerik offers a free test framework with wrappers for RadControls.  But my company is already using Microsoft Visual Studio 2010 and Microsoft Test Manager for test automation, and the Microsoft test tools currently have limited awareness of RadControl properties on web pages.  I don't want to replace the Microsoft test tools and start using Telerik's Test Studio at this point; I want to extend the Microsoft tools with help from Telerik or the developer community.

PS: Maybe another alternative is for Telerik ASP.NET AJAX RadControls to be compliant with Microsoft Active Accessibility (MSAA)?  Apparently that has been done for Telerik WinForms controls http://www.telerik.com/products/winforms/whats-new-full-story.aspx, but I don't know if that has been (or can be) done for Telerik ASP.NET AJAX RadControls.

Thanks,
Kevin

Misho
Telerik team
 answered on 13 Jun 2016
1 answer
192 views

I am plotting WeekNumber of the year on X-axis, and Number of Requests of a particular school on to Y-axis of a Line Series.

Results of a Stored Procedure are assigned to a List of section-requests, by passing School ID, and a date range.

The output of Stored procedure gives: Number of Requests per week, Created Date, Week Number (of the Year), School Name.

Code calls stored procedure 5 times, and stores the results in 5 individual Lists. Code loops through an array of 5 Lists (section-requests) .

By using the LineSeries, AxisItem, and CategorySeriesItem , I have created a Multi-Line chart. 

My issues are:
(1) Once the first List plots on the first LineChart, because of the looping as individual Lists, the Week Number of the second List is starting from where the Week Number of the first List ended.  Is there a way that I can group all the Lists with the LineSeries, and plot only one set of Week Numbers (X axis) and related LineSeries (Y axis) for each individual school?  Please take a look at the Line chart in the attached file

(2) If there is no section-request in a particular week, I need logic to treat “Number of Requests per week” as zero.

For Loop Code:

for (int i = 0; i < arrMasterList.Length; i++)
{
    int intCount = arrMasterList[i].Count;

    foreach (var sectionRequest in arrMasterList[i])
    {
        intSecReqs = sectionRequest.NumberOfRequestsPerWeek;

        if (intSecReqs >= 0)
        {
            AxisItem item = new AxisItem();
            item.LabelText = "Wk: " + sectionRequest.WeekNumber;
            LineChart.PlotArea.XAxis.Items.Add(item);

            CategorySeriesItem categorySeriesItem = new CategorySeriesItem();
            categorySeriesItem.Y = intSecReqs;
            arrLineSeries[i].SeriesItems.Add(categorySeriesItem);
            lstSecReqs.Add(intSecReqs);
        }

        LineChart.PlotArea.Series.Add(arrLineSeries[i]);
      }
   }

   intMaxValueReqs = lstSecReqs.Max();

   LineChart.PlotArea.YAxis.MinValue = 0;
   LineChart.PlotArea.YAxis.MaxValue = intMaxValueReqs + 10;
   LineChart.PlotArea.YAxis.MinorGridLines.Color = Color.White;
   LineChart.PlotArea.XAxis.MajorGridLines.Color = Color.White; 
   LineChart.PlotArea.XAxis.TitleAppearance.Text = "Week number";


Danail Vasilev
Telerik team
 answered on 13 Jun 2016
2 answers
86 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
50 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
263 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
297 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?