Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
219 views

I'm experiencing an odd formatting issue when using the RadAjaxManager to make a TabContainer visible. Once the TabContainer is visible, the content of the first tab (which is the one specified by the ActiveTabIndex) appears above the content for the second tab. Additionally, the second tab is selected rather than the first one (which, again, is the one specified by the ActiveTabIndex). I've included a screenshot of what this looks like, along with the code below. If I click on the first tab, and then go back to the second tab, everything is displayed correctly and I can move between tabs without any further issues. If I replace the RadAjaxManager with a regular UpdatePanel then the tabs are rendered correctly. Any assistance you can provide will be helpful - thanks!

 

<telerik:RadAjaxManager ID="ram" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="btn">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="tc" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
<asp:Button ID="btn" runat="server" Text="Press Me" OnClick="btn_Click" />
<ajax:TabContainer ID="tc" runat="server" ActiveTabIndex="0" Visible="false">
    <ajax:TabPanel ID="tp1" runat="server" HeaderText="Tab 1">
        <ContentTemplate>
            Tab 1 Content
        </ContentTemplate>
    </ajax:TabPanel>
    <ajax:TabPanel ID="tp2" runat="server" HeaderText="Tab 2">
        <ContentTemplate>
            Tab 2 Content
        </ContentTemplate>
    </ajax:TabPanel>
</ajax:TabContainer>

protected void btn_Click(object sender, EventArgs e)
{
    tc.Visible = true;
}
Maria Ilieva
Telerik team
 answered on 06 Apr 2016
9 answers
377 views
Hello
I can create this RadTreeList with a parent and child key from a table.
However I have the following structure --
Table 1
-----------
ParentId_1    SomeData
1                       <abc>
2                       <abc>

Table 2
-----------------
ParentId_2     ParentId_1       Child_Id
Null                  1                      2147
2147                 1                      2176
2176                  1                     2179
2176                   1                    2180
Null                      2                    5283
5283                     2                    20131 etc.

I need a result that looks like --
> 1
         > 2147   
                        > 2176
                                          >2179
                                           >2180
>2
                > 5283
                            >20131

What I am getting is this--
> 1
         > 2147   
                        > 2176
                                          >2179
                                           >2180
                > 5283
                            >20131
> 2
         > 2147   
                        > 2176
                                          >2179
                                           >2180
                > 5283
                            >20131

Is it possible to get the result that I want with data separated in two tables?
If not, can you suggest an alternative?

Thanks
Raka
Kostadin
Telerik team
 answered on 06 Apr 2016
2 answers
142 views

Hello guys,

My problem is kind complicated, i'm trying to pass a DataSource to an RadComboBox (List<> provided by wcf service)

my problem is, i'm using the automated Insert button from the radgrid and it pop's up the Add new window

Follow the front end code 

<telerik:RadGrid ID="RadGrid1" runat="server" OnItemDataBound="RadGrid1_ItemDataBound" OnNeedDataSource="RadGrid1_NeedDataSource" OnInsertCommand="RadGrid1_InsertCommand" OnUpdateCommand="RadGrid1_UpdateCommand" ExportSettings-Word-Format="Docx"    AllowAutomaticDeletes="true"   OnDeleteCommand="RadGrid1_DeleteCommand" GroupPanelPosition="Top" AutoGenerateDeleteColumn="True" AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" ShowFooter="True" ShowGroupPanel="True" ShowStatusBar="True" Height="543px" ClientSettings-Scrolling-AllowScroll="true" AutoGenerateColumns="False" AutoGenerateEditColumn="True"
                        >
                        <GroupingSettings CollapseAllTooltip="Collapse all groups" />
                        <ExportSettings>
                            <Word Format="Docx" />
                        </ExportSettings>
                        <ClientSettings>
                            <Scrolling AllowScroll="True" />
                            <Selecting  AllowRowSelect="true" EnableDragToSelectRows="true" />
                        </ClientSettings>
                        <MasterTableView AutoGenerateColumns="false" DataKeyNames="ID"  CommandItemDisplay="top"  EditMode="PopUp"  >
                            <Columns>
                                <telerik:GridBoundColumn DataField="ProductID" DataType="System.Int32" FilterControlAltText="Filter ProductID column" HeaderText="ProductID" SortExpression="ProductID" UniqueName="ProductID">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="ID" DataType="System.Int32" FilterControlAltText="Filter ID column" HeaderText="ID" SortExpression="ID" UniqueName="ID" ReadOnly="True">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="Quantity" DataType="System.Int32" FilterControlAltText="Filter Quantity column" HeaderText="Quantity" SortExpression="Quantity" UniqueName="Quantity">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="EditDate" DataType="System.DateTime" FilterControlAltText="Filter EditDate column" HeaderText="EditDate" SortExpression="EditDate" UniqueName="EditDate">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="ProductName" FilterControlAltText="Filter Product column" HeaderText="Product" SortExpression="ProductName" UniqueName="ProductName">
                                </telerik:GridBoundColumn>
                            </Columns>
                            <EditFormSettings EditFormType="Template" >
                                <FormTemplate>
                                    Product:
                                    <telerik:RadComboBox
                                         ID="ddProductStock"  Runat="server"   AllowCustomText="True"  DataTextField="Product" DataValueField="ID" Filter="Contains" MarkFirstMatch="True" SelectedValue='<%# Bind("ProductID") %>'  >
                                    </telerik:RadComboBox>
 
                                  
 
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="ddProductStock" ErrorMessage="*Product cannot be empty!" Font-Bold="True" ForeColor="Red"></asp:RequiredFieldValidator>
 
                                    <br />
                                    Quantity:
                                    <telerik:RadNumericTextBox ID="txtQuantityAdd" Runat="server" LabelWidth="64px" Resize="None" Text='<%# Bind("Quantity", "{0:N}") %>' Width="160px" EmptyMessage="Type The Quantity" MinValue="0" MaxValue="99999999">
                                        <NumberFormat GroupSeparator="" DecimalDigits="0" ></NumberFormat>
                                    </telerik:RadNumericTextBox>
                                      
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtQuantityAdd" ErrorMessage="*Quantity cannot be empty!!" Font-Bold="True" ForeColor="Red"></asp:RequiredFieldValidator>
                                      
                                    <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:FinancialConnectionString %>" SelectCommand="SELECT [ID], [Product], [Description] FROM [AssetsProd]"></asp:SqlDataSource>
                                    <telerik:RadButton ID="btnUpdate" runat="server"  CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' >
                                        <Icon PrimaryIconCssClass="rbAdd" />
                                    </telerik:RadButton>
                                       
                                    <telerik:RadButton ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel">
                                        <Icon PrimaryIconCssClass="rbCancel" />
                                    </telerik:RadButton>
 
                                </FormTemplate>
                            </EditFormSettings>
                            <CommandItemSettings AddNewRecordText="Add Stock" AddNewRecordImageUrl="Resources/add-text-file.png"  ShowExportToWordButton="true"  ExportToCsvImageUrl="Resources/excel-fil.png" ExportToPdfImageUrl="Resources/pdf-file-format-symbol.png" ExportToWordImageUrl="Resources/docx-file-variant.png" ShowExportToCsvButton="true" ShowExportToPdfButton="true"/>
                        </MasterTableView>
 
                        <FilterItemStyle BackColor="#00CC66" />
                    </telerik:RadGrid>

this is an old code witch i;m updating to work on an API witch dont allow direct SQL connection, it must be provided by web service (the List<>)

But, i need to provide this DataSource to this RadComboBox when the Add new button is pressed to load the list of registered products.

I'm not able to do this right know

i already did to the radgrid1,  

protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
     {
        
 
         List<ServiceReference2.Stock> NewStock = new List<ServiceReference2.Stock>();
         NewStock = objServiceClientObjClient.SelectStock().ToList();
         RadGrid1.DataSource = NewStock;
 
   
       }

i tried so many things that i found here, but no one was far close to my problem.

 

thank you 

 

 

 

Murylo
Top achievements
Rank 1
 answered on 06 Apr 2016
1 answer
114 views
Hi,

Is there any way to put "date time" control in filters.

For example, I have a dimension called  "Sale Date", Having date and time.

I wants to display the records between specific date range.

Is there any possibility to do this?
Maria Ilieva
Telerik team
 answered on 06 Apr 2016
1 answer
162 views

Can I validate a toolip using Telerik Test Studio?

I need to validate the following:
A tooptip appears on screen when I hover mouse to a textbox, button, header, label, combo, etc. in the WebPage.
The tooltip meets specific styling-format conditions.
The tooltip displays for a specified amount of time.

Can Telerik Test Studio do this?

Joana
Telerik team
 answered on 06 Apr 2016
10 answers
1.2K+ views
Hi,

  We need a grid that does not have alternate row styling and the grid lines property needs to be set to both i.e. we need both horizontal and vertical gridlines. With the default skin though I set the gridlines= "Both", the lines are visible.

I have checked the skins available and none of them currently provides this. Can you please suggest us a skin which can be applied to acheive this look. Else please let us know how to change the CSS of the default skin.

We are currently in process of evaluating Radgrid for using in our project. Please do reply ASAP, it will help us in our decision making.

Thanks,
Maruti
Eyup
Telerik team
 answered on 06 Apr 2016
8 answers
429 views
I have a radhtmlchart with dynamic line series and column series and server side binding of series.My chart is not showing values of line charts if line chart is on column  chart.
Stamo Gochev
Telerik team
 answered on 06 Apr 2016
21 answers
1.1K+ views
Hello!

I have a RadGrid in my aspNET page where I put 4 export buttons (Excel, Word, PDF and CVS format).

Everything is working fine with EXCEL, WORD and CVS, but I can not get it work with PDF format.

It appears the dialog box but I get no data in the resulting pdf, just a "blank" document.

Is there any difference between the way to export differents formats that I can be missing?

Its strange for me because not only it is working with other formats, but it is also working with PDF in OTHERS pages we are developing.

I do not know what it is wrong with this one :-(

Please let me know and if necessary I could copy a part of my code.

Thanks!
Christian
RJ
Top achievements
Rank 1
 answered on 06 Apr 2016
3 answers
167 views

Hello guys,

I have copied and pasted the example provided by the Telerik website almost verbatim - with exception to the implemented DataSource (which I'm doing programmatically for the sake of the example), and am getting problems. The website is here: Virtual Scrolling and Paging.

The problems are as follows:

  • When I scroll to the bottom of the list, the AJAX request runs properly (seen during debugging), but the grid does not update with more records. Also, all other attempts to scroll cause the loading animation to appear and simply hang on the screen so that the page must be reloaded
  • After clicking on either of the heading columns to sort, it's successful the 1st time, but afterwards it hangs, nothing is clickable, and the page must be reloaded

Please see the attached image 'ScrollingHangingIllustration.png'. Also, see below for the code. Please help!!

ASP.NET Markup:

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        function HandleScrolling(e) {
            var grid = $find("<%=RadGrid1.ClientID %>");
          var scrollArea = document.getElementById("<%= RadGrid1.ClientID %>" + "_GridData");
          if (IsScrolledToBottom(scrollArea)) {
              var currentlyDisplayedRecords = grid.get_masterTableView().get_pageSize() * (grid.get_masterTableView().get_currentPageIndex() + 1);
              //if the visible items are less than the entire record count      
              //trigger an ajax request to increase them   
              if (currentlyDisplayedRecords < 100)
              { $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("LoadMoreRecords"); }
      }
  }
  //calculate when the scroll bar is at the bottom   
  function IsScrolledToBottom(scrollArea) {
      var currentPosition = scrollArea.scrollTop + scrollArea.clientHeight;
      return currentPosition == scrollArea.scrollHeight;
  }
    </script>
  </telerik:RadCodeBlock>
  <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
    <AjaxSettings>
      <telerik:AjaxSetting AjaxControlID="RadGrid1">
        <UpdatedControls>
          <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
        </UpdatedControls>
      </telerik:AjaxSetting>
    </AjaxSettings>
  </telerik:RadAjaxManager>
  <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px"
    Width="75px" Transparency="25">
    <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>'
      style="border: 0;" /></telerik:RadAjaxLoadingPanel>
 
  <telerik:RadGrid ID="RadGrid1" runat="server" Skin="Silk" AllowSorting="True" AllowPaging="True" PageSize="15" Width="97%" AutoGenerateColumns="False" GridLines="None">
    <PagerStyle Visible="False" />
    <MasterTableView Width="99%" TableLayout="Fixed" CommandItemDisplay="None" CurrentResetPageIndexAction="SetPageIndexToFirst" PageSize="15">
        <SortExpressions>
            <telerik:GridSortExpression FieldName="CreateDate"
                                        SortOrder="Descending" />
        </SortExpressions>
        <Columns>
            <telerik:GridBoundColumn HeaderText="Code" DataField="ZipFileCode" UniqueName="ZipFileCode">
                <HeaderStyle Width="90px" />
            </telerik:GridBoundColumn>
                                     
            <telerik:GridBoundColumn HeaderText="Description" DataField="ZipFileDesc" UniqueName="ZipFileDesc">
            </telerik:GridBoundColumn>
                                     
            <telerik:GridBoundColumn HeaderText="Select/Omit" DataField="ZipType" UniqueName="ZipType">
                <HeaderStyle Width="100px" />
            </telerik:GridBoundColumn>
                                     
            <telerik:GridBoundColumn HeaderText="Create Date" DataField="CreateDate" UniqueName="CreateDate" DataType="System.DateTime" DataFormatString="{0:d}" ShowSortIcon="true">
                <HeaderStyle Width="100px" />
            </telerik:GridBoundColumn>
 
            <telerik:GridBoundColumn HeaderText="Company" DataField="Company" UniqueName="Company">
                <HeaderStyle Width="100px" />
            </telerik:GridBoundColumn>
        </Columns>                           
    </MasterTableView>
    <ClientSettings>
      <Scrolling AllowScroll="True" UseStaticHeaders="True" ScrollHeight="300px" />
      <ClientEvents OnScroll="HandleScrolling" />
    </ClientSettings>
  </telerik:RadGrid>

VB Code-Behind:

Protected Sub RadAjaxManager1_AjaxRequest(ByVal sender As Object, ByVal e As AjaxRequestEventArgs) Handles RadAjaxManager1.AjaxRequest
    RadGrid1.PageSize = 10 + RadGrid1.PageSize
    RadGrid1.Rebind()
End Sub
 
Public Function GetItemsTest(ByVal startRowIndex As Integer, ByVal maxRows As Integer) As DataSet
    Dim dt As DataTable = New DataTable("Sample")
    dt.Columns.Add("Company", System.Type.GetType("System.String"))
    dt.Columns.Add("ZipFileCode", System.Type.GetType("System.String"))
    dt.Columns.Add("ZipFileDesc", System.Type.GetType("System.String"))
    dt.Columns.Add("ZipType", System.Type.GetType("System.String"))
    dt.Columns.Add("CreateDate", System.Type.GetType("System.DateTime"))
    dt.Columns.Add("DeletedFile", System.Type.GetType("System.Boolean"))
    dt.Columns.Add("UploadedBy", System.Type.GetType("System.String"))
 
    Dim row As DataRow
    Dim dte As DateTime
    dte = DateTime.Now
 
    For i As Integer = 0 To maxRows
        row = dt.NewRow()
        row(0) = "Company" & i
        row(1) = "ZipFileCode" & i
        row(2) = "ZipFileDesc" & i
        row(3) = "ZipType" & i
        row(4) = dte
        row(5) = True
        row(6) = "UploadedBy" & i
        dt.Rows.Add(row)
    Next
 
    Dim ds As New DataSet("Sample")
    ds.Tables.Add(dt)
 
    Return ds
End Function
 
Private Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource
 
    RadGrid1.DataSource = GetItemsTest(0, RadGrid1.PageSize)
 
End Sub

Torrey
Top achievements
Rank 1
 answered on 05 Apr 2016
3 answers
189 views

Hi, sorry my english isn't very good, hope you understand.

I have a treeview with a contextMenu. In the contextMenu I have an item that needs some javascript to run and a confirmation to know if postback must be triggered.

Something like this :

- user right-click on a node (contextMenu appears)

- user select menu item

- javascript stop postback (I used "args.set_cancel(true);" in the javascript)

- javascript runs some functions then a "modal window" is displayed (this is not a window.confirm !!!) with a message like "Are you sure ?" and the usual buttons "yes/no"

My problem, how do I re-enable (or resume, or resend) the "postback" like if the menu item was clicked ?

I've already done something like this on a RadButton, and simply by using "sender.click()" in the javascript, the postback is "resumed". But there are no functions like this on a contextMenu I think...

 

Ivan Danchev
Telerik team
 answered on 05 Apr 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?