Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
173 views
Hi Telerik Team,

I think I've discovered a bug:

I have a RadPanelBar inside a GridTemplateColumn of a RadGrid, which is itself inside another RadPanelBar, which is inside the NestedViewTemplate of a containing RadGrid's MasterTableView.

Background

I used the NestedViewTemplate of a RadGrid to contain another RadGrid to show child records, because Telerik's default child record view implementation was very difficult to follow for my end users. This was because all the tables at a level were visible at the same time. So I embedded a RadPanelBar inside the NestedViewTemplate of the master RadGrid so that they would only see one RadGrid at a time by expanding/collapsing the RadPanelBar items for each child RadGrid in the NestedViewTemplate. This works beautifully.

Problem

One of the child RadGrids in the RadPanelBar in the NestedViewTemplate has a GridTemplateColumn. This GridTemplate column has a RadPanelBar. The RadPanelBar only has one item in it. It will neither expand nor collapse by clicking on the item header. It will however do so if you click the arrow for the item. Also, an attached OnItemClicked event does not fire.

If I move the RadPanelBar up one level (i.e. outside of the NestedViewTemplate, into a GridTemplateColumn of the master RadGrid), it will expand and collapse normally with only one RadPanelItem in the RadPanelBar. The OnItemClicked event also fires.

The bug (i.e. refusal to expand/collapse & no OnItemClicked event fire) only seems to appear when the RadPanelBar is inside a GridTemplateColumn of a RadGrid that is inside another RadPanelBar that is inside a NestedViewTemplate of a master RadGrid and it only has one RadPanelItem.

...I hope you are following me so far. If not, here's a sample code mockup:

<telerik:RadGrid ID="MasterRadGrid" runat="server">
   <MasterTableView CommandItemDisplay="Bottom">
      <NestedViewTemplate>
         <telerik:RadPanelBar ID="RadPanelBar1" runat="server">
            <Items>
               <telerik:RadPanelItem runat="server" Owner="RadPanelBar1" Text="Child Table 1">
                  <ContentTemplate>
                     <telerik:RadGrid ID="ChildRadGrid1" runat="server">
                        <MasterTableView runat="Server" CommandItemDisplay="Bottom">
                           <Columns>
                              <telerik:GridTemplateColumn HeaderText="Column" UniqueName="Column">
                                 <EditItemTemplate>
                                    <telerik:RadPanelBar ID="RpbColumn" runat="server">
                                       <Items>
                                          <telerik:RadPanelItem runat="server" Owner="RpbColumn">
                                             <!-- Assorted controls. This RadPanelItem won't expand here, unless in MasterRadGrid -->
                                          </telerik:RadPanelItem>
                                       </Items>
                                    </telerik:RadPanelBar>
                                 </EditItemTemplate>
                              </telerik:GridTemplateColumn>
                           </Columns>
                        </MasterTableView>
                     </telerik:RadGrid>
                  </ContentTemplate>
               </telerik:RadPanelItem>
               <telerik:RadPanelItem runat="server" Owner="RadPanelBar1" Text="Child Table 2">
                  <!--- Another RadGrid -->
               </telerik:RadPanelItem>
               <telerik:RadPanelItem runat="server" Owner="RadPanelBar1" Text="Child Table 3">
                  <!--- Another RadGrid -->
               </telerik:RadPanelItem>
            </Items>
         </telerik:RadPanelBar>
      </NestedViewTemplate>
   </MasterTableView>
</telerik:RadGrid >

If I add another RadPanelItem to the deeply nested RadPanelBar (ID = "RpbColumn" in the above example) and set its ExpandMode = "SinglePanelItem", it will expand & collapse normally. I'm using Telerik v. 2011.3.1115.40.

Can someone please confirm that this is indeed a bug? Thanks in advance.
Denny
Top achievements
Rank 1
 answered on 12 Aug 2015
1 answer
105 views

I am using RadFilter on a page connected to a RadGrid in the simplest way.  The RadGrid built in filter generates a correct filterexpression for use in dynamic linq.  However the RadFilter gets everything correct except for the fact that the field names are prefixed with "it."  

I also decompiled the RadFilter and related code and came across the following code in which it appears that the "it" prefix is very intentional and also very hard-coded.  This is forcing me to put in an event handler to search for the prepended 'it' and remove it.  What is happening here?

 

:

public string FormatFieldName(string fieldName, Type dataType, bool isCaseSensitive)
{
dataType = RadFilterTypeHelper.GetNonNullableType(dataType);
if (dataType == typeof (string))
{
string str = isCaseSensitive ? "" : ".ToUpper()";
return string.Format("iif(it.{0}==null,\"\",it.{0}).ToString(){1}", (object) fieldName, (object) str);
}
if (!(dataType == typeof (char)))
return string.Format("it.{0}", (object) fieldName);
string str1 = isCaseSensitive ? "" : ".ToUpper()";
return string.Format("Char(iif(it.{0}==null,'''',it.{0})).ToString(){1}", (object) fieldName, (object) str1);
}

Charles
Top achievements
Rank 1
 answered on 12 Aug 2015
20 answers
1.1K+ views
Hello!!

I need to allow exporting all the rows of my RadGrid to .CSV, however after i tested the exportToCSV button, it only exports the results of the first page(showed on the webpage).

It's possible to export all the GRID data ?? Can you tell me how?

Another thing I need to know, is how can i export only one column values to a pdf or excell..instead of all the collumns unformatted??
Jayesh Goyani
Top achievements
Rank 2
 answered on 12 Aug 2015
1 answer
187 views

Hey Guys,

So I setup a basic RadGrid (see below) with a few columns only to discover that both the GridEditCommandColumn, PerformInsertButton and CancelButton don't do anything when clicked. Any ideas?

 ASPX

<telerik:RadGrid ID="rgIssuers" runat="server" AutoGenerateColumns="False">
    <MasterTableView DataKeyNames="ID" EditMode="InPlace" CommandItemDisplay="Top">
        <CommandItemSettings
            ShowAddNewRecordButton="true"
            ShowRefreshButton="true"                        
            ShowExportToExcelButton="false"
            ShowExportToWordButton="false"
            ShowExportToPDFButton="false"
            ShowExportToCSVButton="false"
            AddNewRecordText="Add New Issuer" />
        <Columns>
 
            <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditColumn" >
                <ItemStyle HorizontalAlign="Center" />
                <HeaderStyle Width="35px" />
            </telerik:GridEditCommandColumn>
                     
            <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                UniqueName="DeleteColumn" ConfirmText="Delete this Issuer?" ConfirmDialogType="RadWindow"
                ConfirmTitle="Delete" >
                <ItemStyle HorizontalAlign="Center" />
                <HeaderStyle Width="35px" />
            </telerik:GridButtonColumn>
 
            <telerik:GridBoundColumn DataField="Name" UniqueName="Name" DataType="System.String" HeaderText="Name"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="AccessCode" UniqueName="AccessCode" DataType="System.String" HeaderText="Access Code"></telerik:GridBoundColumn>
            <telerik:GridTemplateColumn DataField="SupportedAssertions" UniqueName="SupportedAssertions" DataType="System.Int32" HeaderText="Supported Assertions">
                <ItemTemplate>
                    <asp:Label id="lblSupportedAssertions" runat="server"></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <telerik:RadListBox ID="lbSupportedAssertions" runat="server" SelectionMode="Multiple"></telerik:RadListBox>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn HeaderText="Target">
                <ItemTemplate>
                    <asp:Label id="lblTarget" runat="server"></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
 
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

ASPX.VB

Protected Sub rgIssuers_NeedDataSource(sender As Object, e As GridNeedDataSourceEventArgs) Handles rgIssuers.NeedDataSource
 
    'get our issuers
    rgIssuers.DataSource = Issuer.FindByCLC(_csAC, _strCLC)
 
End Sub

infoweshanney
Top achievements
Rank 2
 answered on 12 Aug 2015
5 answers
270 views

With version 2012.2.607.35 of the Telerik.Web.UI.dll

<td>
    <telerik:RadListBox runat="server" ID="RadListBoxF" Height="230px" Width="98%" ButtonSettings-AreaWidth="35px" CheckBoxes="true" EmptyMessage="No Key Sets Added">
    </telerik:RadListBox>
</td>

 

The ListBox was fixed at the height, and any extra height needed was got to by a scroll bar. Empty message appears in the center of the box.

With version 2014.3.1024.35 of the dll.

The list box is the height of the items, and keeps growing. the empty message is at the top (but this is the only item in the box).

This is on IE9.

Ivan Danchev
Telerik team
 answered on 12 Aug 2015
1 answer
98 views

Hello,

I have a RadTreeList cotrol. Within this is a TreeListTemplateColumn.
Inside this I have two DIVs and radbutton configured as a custom toggle.  What I’d like to do is is when the user clicks the toggle button the system hides one div and shows the other.

I’ve had a go at this with little success.  Here is the code for the buttons

 

<telerik:RadButton ID="RadButton2" runat="server" ButtonType="LinkButton" Checked="True"
        Skin="Metro" ToggleType="CustomToggle" OnClientToggleStateChanged="SetVisibility"
        AutoPostBack="False">
        <ToggleStates>
            <telerik:RadButtonToggleState PrimaryIconCssClass="rbToggleCheckboxChecked" Text="Existing" />
            <telerik:RadButtonToggleState PrimaryIconCssClass="rbToggleCheckbox" Text="New" />
        </ToggleStates>
    </telerik:RadButton>

 

And here is the associated JavaScript:

            function SetVisibility(sender, args)
    {
        switch (args.get_currentToggleState().get_text())
        {
            case "Existing":
                showstuff('existing');
                hidestuff('new');
                break;
            case "New":
                showstuff('new');
                hidestuff('existing');
                break;
            default:
                hidestuff('new');
                hidestuff('existing');
                break;
        }
    }
 
    function showstuff(boxid){
   document.getElementById(boxid).style.visibility="visible";
}
  
function hidestuff(boxid){
   document.getElementById(boxid).style.visibility="hidden";
}

 

The problem with this is that is doesn't matter which button (row) within the treelist you click, the only DIVs that get changed are those within the first row.
Any ideas how I can overcome this?

Eyup
Telerik team
 answered on 12 Aug 2015
2 answers
202 views
We have a scenario, with a batch-mode grid page, that is inserted into multiple pages (via an IFrame) on the site.  Depending upon the containing page, the grid will show different (but related) columns.  In most cases, we have the grid freeze the first three columns ​which works fine.  However, in a two cases, the frozen columns are hidden and horizontal scrolling is not necessary.  As such, we would like to simply remove the FrozenColumnsCount (or possibly just set it to 0?).  How can I do this using both client-side and code-behind code?
Eyup
Telerik team
 answered on 12 Aug 2015
2 answers
61 views

Hi,

I'm using this example - http://docs.telerik.com/devtools/aspnet-ajax/controls/scheduler/how-to/replace-the-edit-form

when the AppointmentEditing event fires the apt object is blank?

function AppointmentEditing(sender, eventArgs) {
        var apt = eventArgs.get_appointment();
        var oWindow = window.radopen("CalenderAdvancedForm.aspx?Mode=Edit&AppointmentID=" + apt.ID, "AdvancedForm");
        oWindow.Maximize();
        oWindow.SetTitle("Edit Appointment");
        oWindow.Center();
        eventArgs.set_cancel(true);
    }

<telerik:RadScheduler ID="RadScheduler1" runat="server" DataDescriptionField="Description" DataEndField="End" DataKeyField="ID" DataRecurrenceField="RecurrenceRule" DataRecurrenceParentKeyField="RecurrenceParentID" DataReminderField="Reminder" DataSourceID="SqlDataSource1" DataStartField="Start" DataSubjectField="Subject" Height="700px" SelectedView="WeekView" Skin="Metro" TimeZoneID="Central Standard Time" Width="990px" WorkDayEndTime="18:00:00" CustomAttributeNames="Type" EnableCustomAttributeEditing="True" TimeZoneOffset="-06:00:00" StartInsertingInAdvancedForm="false"
     OnClientAppointmentEditing="AppointmentEditing" 
     OnClientAppointmentInserting="AppointmentInserting" >

Ivan Danchev
Telerik team
 answered on 12 Aug 2015
3 answers
283 views

When the ZIndex property arrived (2015 Q1 release?) it caused my chart to render incorrectly as shown in image "1_2015_Q1_&_Q2_Default_ZIndexes". My chart plots both before and after values of a set of history data (databound from the server side).

To fix the rendered output (to that prior to the 2015 Q1 release), I manually set the ZIndex of each series so that the datapoint and line of the same series are on top. This is shown in image "2_2015_Q1_ZIndexes_Set".

This was fine (not ideal but it worked) until 2015 Q2 arrived (and has not been corrected in 2015 Q2 SP1 either). Image "3_2015_Q2_Manual_ZIndexes" shows the issue when hovering on a series ​below another- the series datapoint below doesn't show through the series datapoint on top any longer. Leaving the ZIndexes to default fixes this, but makes the chart render like in image "1_2015_Q1_&_Q2_Default_ZIndexes". This is a minor issue.

However, things get worse, for charts with missing values. This chart's series have MissingValues = HtmlChart.MissingValuesBehavior.Gap and manual ZIndexes set. If there are gaps in the plotted data, I receive a JavaScript error every time the chart is refreshed as shown in image "4_2015_Q2_ZIndexesSet_JS_Error". If I close the error popup and click a series in the legend, the chart renders until it is refreshed again. The JavaScript error does not appear if the plotted data is complete though.

Therefore can you please assist me to either of the following workarounds until the two bug fixes can be applied:

1. Go back to allowing default ZIndexes, but fix the chart rendering to be like in image "2_2015_Q1_ZIndexes_Set", where ZIndexes are set.

2. Avoid the JavaScript error for manually set ZIndexes and MissingValues = HtmlChart.MissingValuesBehavior.Gap somehow.

Thanks

Thanks

Danail Vasilev
Telerik team
 answered on 12 Aug 2015
1 answer
137 views

So, after google-ing for about 6 hours or so I finally gave up. Hope someone here can hook me up with advice.

I'm creating a dynamic function for all grids in my DNN module. ​When I double click on a row, I call the function editKey, which takes in parameter grid and fetches its ID (For now I only have two grids, but that is not the issue). ​Then it fetches all the information about that row​ and a new RadWindow opens up where the prefetched information can be seen and/or managed/deleted.
As I open a new window, I load a new <div> inside it which serves as a template for each grid. The strange thing is, when I add the div to the server (runat="server) I cant seem to find it with the $find('<% ​CodaEdit1  %>') call.

 I want to use all of my prefetched info and put it into this div. My first thought of accessing the divs elements was to use something like

document.getElementById("CodaEdit1").children[i].setAttribute("Text", info[i]);

But that does not do anything.
Neither can I access the first element in the div with

document.getElementById("FindMe");​

but

var re = $find('<%= FindMe.ClientID %>');
        re.set_value("this works");

Works perfectly. I can of course write the find function for each and every radtextbox that I have, but my code will look pretty ugly and scale terrible as my project grows.​

Here is the referenced code

 

<div id="CodaEdit1" style="display:none">
        <telerik:RadTextBox ID="FindMe" runat="server" Label="Rule" Text=""></telerik:RadTextBox>
         
</div>
 
<script type="text/javascript">
     
    var keySelected;
 
    function editKey(sender)
    {
        var whichLayout = windowLayout(sender);
        var grid, divinsert;
 
        switch(whichLayout)
        {
            case ("1"):
                grid = $find('<%= RadGrid1.ClientID %>');
                break;
            case ("2"):
                grid = $find('<%= RadGrid2.ClientID %>');
                break;
        }
        divinsert = $get("CodaEdit"+whichLayout);
 
        var masterTableView = grid.get_masterTableView();
        keySelected = rowInfo(masterTableView);
 
        //alert(document.getElementById("CodaEdit1").children[0]); <-- HTMLELEMENTSPAN
        document.getElementById("CodaEdit1").children[0].setAttribute("Text", "Goon"); <-- Does nothing
 
        var editWindow = GetRadWindowManager().open(null, null, divinsert, 1200, 200);//; 10, 10);
        editWindow.center();
 
//alert(document.getElementById("CodaEdit1").children[0].textContent); <-- finds the text content
 
 
        var re = $find('<%= FindMe.ClientID %>');
        re.set_value("#gfdgdfgsd");
         
 
    }
 
    function windowLayout(gridSender)
    {
        var layoutType = gridSender.get_id();
        return layoutType.charAt(layoutType.length - 1);
         
    }
 
    function rowInfo(aTableView)
    {
        var selectedItems = aTableView.get_selectedItems();
        var row = selectedItems[0];
         
        var columns = aTableView.get_columns();
        var resultArray = [];
        for (var i = 0; i < columns.length; i++)
        {
            var category = columns[i].get_uniqueName();
            var cellValue = $(row.get_cell(category)).text();
 
            resultArray.push(cellValue);
        }
        return resultArray;
    }
</script>

 

<telerik:RadGrid ID="RadGrid1"
        runat="server"
        AllowPaging="True"
        AllowSorting="True"
        DataSourceID="​blablablawooo"
        GroupPanelPosition="Top"
        ShowGroupPanel="True"
        EnableLinqExpressions="False"
        AllowFilteringByColumn="True"
        OnInit="RadGrid1_Init"
        OnItemCommand="RadGrid1_ItemCommand"
        OnPreRender="RadGrid1_PreRender"
        Height="600px">
        <ClientSettings AllowDragToGroup="True" AllowColumnsReorder="True" EnableRowHoverStyle="True">
            <Selecting AllowRowSelect="True" />
            <Scrolling AllowScroll="True" EnableVirtualScrollPaging="True" />
            <Resizing AllowColumnResize="True" />
            <ClientEvents OnFilterMenuShowing="filterMenuShowing" OnRowDblClick="editKey"/>
        </ClientSettings>

        <MasterTableView AutoGenerateColumns="False" DataKeyNames="RULE_ID" DataSourceID="its a secret yo">
            <Columns>
                <telerik:GridBoundColumn AllowFiltering="False" DataField="RULE_ID" DataType="System.Decimal" FilterControlAltText="Filter RULE_ID column" HeaderText="RULE ID" ReadOnly="True" SortExpression="RULE_ID" UniqueName="RULE_ID">
                </telerik:GridBoundColumn>

etcetc...​

IT-Fjárvakur
Top achievements
Rank 1
 answered on 12 Aug 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?