Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
186 views

Hi,

I am trying to get single hierarchy expand in radgrid but I am unable to achieve it.

Below is my aspx code

<telerik:RadGrid RenderMode="Lightweight" Skin="Outlook" ID="RadGrid1"  OnDetailTableDataBind="RadGrid1_DetailTableDataBind" OnNeedDataSource="RadGrid1_NeedDataSource"
          OnPreRender="RadGrid1_PreRender"   runat="server" AutoGenerateColumns="false" PageSize="10" AllowPaging="True" HierarchyLoadMode="ServerBind">

             <MasterTableView DataKeyNames="TrackID" AllowMultiColumnSorting="True">
                <DetailTables>
                    <telerik:GridTableView DataKeyNames="TrackID" Name="coms_opportunities" Width="100%">
                                 <Columns>
                                    <telerik:GridBoundColumn SortExpression="SvcTag" HeaderText="Svc tag" HeaderButtonType="TextButton"
                                        DataField="SvcTag">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn SortExpression="FiscalQuarter" HeaderText="Fiscal Quarter" HeaderButtonType="TextButton"
                                        DataField="FiscalQuarter">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn SortExpression="Region" HeaderText="Region" HeaderButtonType="TextButton"
                                        DataField="Region">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn SortExpression="SubRegion" HeaderText="Sub Region" HeaderButtonType="TextButton"
                                        DataField="SubRegion">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn SortExpression="Country" HeaderText="Country" HeaderButtonType="TextButton"
                                        DataField="Country">
                                    </telerik:GridBoundColumn>
                                </Columns>
                        </telerik:GridTableView>
                        </DetailTables>
                         <Columns>
                    <telerik:GridBoundColumn SortExpression="COMSTtackerID" HeaderText="COMSTtackerID" HeaderButtonType="TextButton"
                        DataField="COMSTtackerID">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="OpptyName" HeaderText="Oppty Name" HeaderButtonType="TextButton"
                        DataField="OpptyName">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="CustomerName" HeaderText="Customer Name" HeaderButtonType="TextButton"
                        DataField="CustomerName">
                    </telerik:GridBoundColumn>
                     <telerik:GridBoundColumn SortExpression="PartnerName" HeaderText="Partner Name" HeaderButtonType="TextButton"
                        DataField="PartnerName">
                    </telerik:GridBoundColumn>
                      <telerik:GridBoundColumn SortExpression="ForecastAmtUSD" HeaderText="Forecast Amt USD" HeaderButtonType="TextButton"
                        DataField="ForecastAmtUSD">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="ForecastStatus" HeaderText="Forecast Status" HeaderButtonType="TextButton"
                        DataField="ForecastStatus">
                    </telerik:GridBoundColumn>
                     <telerik:GridBoundColumn SortExpression="ExpectedCloseDate" HeaderText="Expected Close Date" HeaderButtonType="TextButton"
                        DataField="ExpectedCloseDate">
                    </telerik:GridBoundColumn>
                     <telerik:GridBoundColumn SortExpression="TagsCount" HeaderText="Tags Count" HeaderButtonType="TextButton"
                        DataField="TagsCount">
                    </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
            </telerik:RadGrid>

.cs file:

   protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
    {
        if (!e.IsFromDetailTable)
        {
            RadGrid1.DataSource = GetOppty();
        }
    }  protected void RadGrid1_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
    {
        GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;

        {


                        string TrackID = dataItem.GetDataKeyValue("TrackID").ToString();
                        e.DetailTableView.DataSource = GetTags("@Ctr");
          
        }
    }
 protected void RadGrid1_PreRender(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            RadGrid1.MasterTableView.Items[0].Expanded = true;
           // RadGrid1.MasterTableView.Items[0].ChildItem.NestedTableViews[0].Items[0].Expanded = true;
        }
    }
}
Shweta
Top achievements
Rank 1
 asked on 20 Aug 2021
1 answer
178 views

Hi,

I have a modal RadWindow, whose content page contains a RadEditor.   When an editor dialog is opened, it's position and movement is limited to the content area of the RadWindow.  Is there a way to have the editor dialogs open modal, but relative to the browser?  Thus allowing the editor dialog to be positioned overlapping or even outside of the RadWindow.

Thanks,

Dave

 

Vessy
Telerik team
 answered on 19 Aug 2021
1 answer
194 views
Is it possible to change the DateInput-Label for my RadDatePicker using javascript?
Vessy
Telerik team
 answered on 19 Aug 2021
1 answer
199 views
I'm using Q2 2015 (2015.2.826.45). My web form has RadCombobox with "CheckBoxes" set to true. I want SelectedIndexChanged fired only when the selected (checked) items are changed. However, I found when multiple items (3 or above) are selected, the SelectedIndexChanged event are always fired after postback. I think this is a bug. Please advise.
Sheng
Top achievements
Rank 1
Iron
Iron
 answered on 18 Aug 2021
1 answer
191 views
I'm pretty sure that this functionality hasn't been implemented by Telerik with the Kendo UI Diagram control.
Anybody out there got any ideas how to implement this - I've experimented with Select and had a look at the Range methods but nothing seems to cater for selecting any number of shapes and then arranging them equidistant apart.
Any pointers appreciated.
Vessy
Telerik team
 answered on 18 Aug 2021
1 answer
474 views

Hello,  

I am new to a team of developers and one of our tasks is maintaining an older website that uses Telerik Rad controls.

I would like to identify if we need to upgrade the existing controls for security patches etc.

What is best way to determine what version of controls we have and how to update them if necessary ?

 

Thanks

 

Rumen
Telerik team
 answered on 17 Aug 2021
1 answer
130 views

Hi,

I'm using the Image Editor and setting the image url during page load. The image size is 5mb and the dimensions are 6000x4000

We are also making use of CanvasMode="On" which is causing the image quality to drop quite a lot.

Is there any additional settings that will enable us not to lose quality if Canvas is enabled.

Kind Regards,

 

Rumen
Telerik team
 answered on 17 Aug 2021
1 answer
219 views

I have al ListView with an internal datasource defined as:

                           <telerik:RadListView ID="fileList" runat="server" ItemPlaceholderID="FileInfoPlaceHolder"
                              Width="100%" EnableEmbeddedSkins="false" AllowMultiFieldSorting="False" AllowPaging="true" PageSize="50">

                              <LayoutTemplate>
                                 <div style="width: 100%">
                                    <table>
                                       <thead>
                                          <tr>
                                             <td class="lvtop">
                                                <img alt="" src="assets/spacer.gif" height="1" width="400" /></td>
                                             <td class="lvtop">
                                                <img alt="" src="assets/spacer.gif" height="1" width="120" /></td>
                                             <td class="lvtop lvtopr">
                                                <img alt="" src="assets/spacer.gif" height="1" width="90" /></td>
                                          </tr>
                                          <tr>
                                             <td class="lvhead" style="white-space: nowrap">Datei</td>
                                             <td class="lvhead" style="white-space: nowrap">Aktion</td>
                                             <td class="lvhead lvheadr" style="text-align: center; width: 80px; white-space: nowrap">Start</td>
                                          </tr>
                                          <tr>
                                             <td class="lvhead">
                                                <img alt="" src="assets/spacer.gif" height="1" width="400" /></td>
                                             <td class="lvhead">
                                                <img alt="" src="assets/spacer.gif" height="1" width="120" /></td>
                                             <td class="lvhead lvheadr">
                                                <img alt="" src="assets/spacer.gif" height="1" width="90" /></td>
                                          </tr>
                                          <tr>
                                             <td colspan="3" style="text-align: center">
                                                <telerik:RadDataPager ID="fileList_pagetop" runat="server" Culture="de-DE" SEOPagingQueryPageKey="" CssClass="lvhead" PagedControlID="artList" Skin="Outlook" PageSize="50"
                                                   BackColor="#F0F0F0" BorderColor="#D0D0D0" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana, Arial, Sans serif" ForeColor="#0456a8" Font-Size="11px">
                                                   <Fields>
                                                      <telerik:RadDataPagerButtonField FieldType="FirstPrev" FirstButtonText="Erste" LastButtonText="Zurück" />
                                                      <telerik:RadDataPagerGoToPageField CurrentPageText="Seite" TotalPageText="von" SubmitButtonText="Zeigen" TextBoxWidth="40" />
                                                      <telerik:RadDataPagerButtonField FieldType="NextLast" NextButtonText="Nächste" LastButtonText="Letzte" />
                                                      <telerik:RadDataPagerPageSizeField PageSizeText="Dateien pro Seite:" PageSizeControlType="RadDropDownList" HorizontalPosition="RightFloat" PageSizes="10,20,50" />
                                                   </Fields>
                                                </telerik:RadDataPager>
                                             </td>
                                          </tr>
                                       </thead>
                                       <tbody>
                                          <tr id="FileInfoPlaceHolder" runat="server">
                                          </tr>
                                       </tbody>
                                       <tfoot>
                                          <tr>
                                             <td colspan="3" style="text-align: center">
                                                <telerik:RadDataPager ID="fileList_pagebottom" runat="server" Culture="de-DE" SEOPagingQueryPageKey="" CssClass="lvhead" PagedControlID="artList" Skin="Outlook" PageSize="50"
                                                   BackColor="#F0F0F0" BorderColor="#D0D0D0" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana, Arial, Sans serif" ForeColor="#0456a8" Font-Size="11px">
                                                   <Fields>
                                                      <telerik:RadDataPagerButtonField FieldType="FirstPrev" FirstButtonText="Erste" LastButtonText="Zurück" />
                                                      <telerik:RadDataPagerGoToPageField CurrentPageText="Seite" TotalPageText="von" SubmitButtonText="Zeigen" TextBoxWidth="40" />
                                                      <telerik:RadDataPagerButtonField FieldType="NextLast" NextButtonText="Nächste" LastButtonText="Letzte" />
                                                      <telerik:RadDataPagerPageSizeField PageSizeText="Dateien pro Seite:" PageSizeControlType="RadDropDownList" HorizontalPosition="RightFloat" PageSizes="10,20,50" />
                                                   </Fields>
                                                </telerik:RadDataPager>
                                             </td>
                                          </tr>
                                       </tfoot>
                                    </table>
                                 </div>
                              </LayoutTemplate>

                              <ItemTemplate>
                                 <tr>
                                    <td class="lvcell">
                                       <%# Container.DataItem %>
                                    </td>
                                    <td class="lvcell"></td>
                                    <td class="lvcell lvcellr" style="text-align: justify; width: 90px; white-space: nowrap">
                                       <asp:ImageButton ID="GotoButton" CommandName="Goto" CommandArgument="goto" runat="server" ImageUrl='~/assets/moveright.gif' Width="25" Height="25" ImageAlign="AbsMiddle" ToolTip="Gehe zur Produktanzeige der E-ISBN" />
                                    </td>

                                 </tr>
                              </ItemTemplate>

                              <EmptyDataTemplate>
                                 <table style="width: 70%">
                                    <tr>
                                       <td class="labelcol"><i>Keine Dateien im Verzeichnis gefunden</i></td>
                                    </tr>
                                 </table>
                              </EmptyDataTemplate>

                              <ValidationSettings EnableModelValidation="False" EnableValidation="False" />

                           </telerik:RadListView>


This is the code to set the datasource:

   Protected Sub fileList_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.RadListViewNeedDataSourceEventArgs) Handles fileList.NeedDataSource

      Dim filepath As String = appldata.getSYSTEMParam("ChapterUploadPath")
      Dim files As New ArrayList(Directory.GetFiles(filepath, "*.xlsx").Length)
      'Dim files As New List(Of String)

      For Each f As String In Directory.GetFiles(filepath, "*.xlsx")
         files.Add(Path.GetFileName(f))
      Next

      fileList.DataSource = files

      fileDirectory.Text = "Alle Dateien im Verzeichnis " & filepath & ":"

   End Sub

The effect is the same if I use list(of string) instead of arrayList.

The number of files read from the directory is 10. The ListView shows these then lines but indicates 1714 pages with 10 entries each. Paging is possible but only the page number changes, the list of 10 always shows in the same form.

How to reduce the listview to the real number of items present?

 

 

Doncho
Telerik team
 answered on 16 Aug 2021
1 answer
472 views

I'm using Version 2021.2.616.45 and attempting to detect Microsoft Edge.  When using Edge in Windows 10, Telerik.Web.Browser.edge is false, but shows chrome is true.  There are Telerik controls on the page, but I've also explicity added Telerik.Web.UI.Common.Core.js to the script manager.  I get that Edge is a chromium browser, but I need to detect Edge.

Am I missing something?

Thanks,

Dave

 

Rumen
Telerik team
 answered on 13 Aug 2021
1 answer
356 views

I have a RadBinaryImage in a RadGrid template column and I'm trying to account for situations where the value is null. In reviewing some of the posts, I saw the following solution.


<telerik:RadBinaryImage runat="server" ID="RadBinaryImage2" DataValue='<%# Eval("vSignature") Is DBNull ? null  Eval("vSignature") %>' AutoAdjustImageControlSize="false" Height="100px" Width="400px" ToolTip="Signature" AlternateText="Signature" />

However, I get a design-time error stating that...

DBNull is a class type and cannot be used as an expression.

I have seen examples of this, but this does not work for me in Visual Studio 2017, Asp.Net 4.6.

Any help on this is greatly appreciated!

Attila Antal
Telerik team
 answered on 13 Aug 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?