Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
110 views
Hi Telerik.

I would like to hear if you have support for Publisher Policy Assembly? We have upgraded our Telerik components a couple of times, and it would be a great way for us to minimize the upgrade process instead of updating the web.confing with assembly redirects.

Best regards

Klaus
Stanimir
Telerik team
 answered on 14 Apr 2010
1 answer
153 views

Hi,

I am using the self-referencing hierarchy and dynamically assigning datasource (via dataset). I followed the demo code to implement my grid. Depending the value of a dropdownlist on the page, the datasource for the radgrid is different so I set AutoGenerateColumns="True". The problem that I'm having is that when a different value is selected from the dropdown, the mastertableview binds fine and the new columns are rendered but the detail views in the grid still retains the columns from a previous binding which results in the detail views having blank rows and mis-aligned with the parent table.

Any help is greatly appreciated.

Here's my aspx definition,

<telerik:RadGrid  
                                                                            ID="grdVwDashBoard"   
                                                                            runat="server"   
                                                                            AutoGenerateColumns="True" 
                                                                            onitemdatabound="grdVwDashBoard_ItemDataBound"   
                                                                                OnColumnCreated="grdVwDashBoard_ColumnCreated"   
                                                                                OnItemCreated="grdVwDashBoard_ItemCreated" Width="750px" Skin="Vista"   
                                                                                EnableLinqExpressions="false" > 
                                                                                <ClientSettings AllowExpandCollapse="True">  
                                                                                    <Scrolling UseStaticHeaders="true" AllowScroll="true" FrozenColumnsCount="0" SaveScrollPosition="true" /> 
                                                                                </ClientSettings> 
                                                                                <MasterTableView HeaderStyle-CssClass="gridHeaders" EnableNoRecordsTemplate="true" CommandItemDisplay="None" ItemStyle-CssClass="gridrowstyle" ShowHeadersWhenNoRecords="false" HierarchyDefaultExpanded="false" HierarchyLoadMode="Client" DataKeyNames="MetricID, ParentMetricID, metricname" FilterExpression="ParentMetricID is NULL" Width="100%">   
                                      <NoRecordsTemplate> 
                                      <span class="emptyDataStyle">Please select a dashboard from the menu above.</span>              
                                      </NoRecordsTemplate>     
                                      <SelfHierarchySettings MaximumDepth="5" KeyName="MetricID" ParentKeyName="ParentMetricID" /> 
                                      <CommandItemSettings ShowExportToCsvButton="true" ShowAddNewRecordButton="false" ShowRefreshButton="false" ExportToCsvImageUrl="images/xlsx.gif" ExportToCsvText="Export to Excel" /> 
                                      <HeaderStyle CssClass="gridHeaders" Wrap="false" /> 
                                      <ItemStyle CssClass="gridrowstyle" /> 
                                                                                </MasterTableView> 
                                                                                <ExportSettings ExportOnlyData="true" OpenInNewWindow="true"></ExportSettings> 
                                                                            </telerik:RadGrid> 
 

 

 

 

And here's the code,
 

 

 protected void grdVwDashBoard_ItemDataBound(object sender, GridItemEventArgs e)  
        {  
            if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem)  
            {  
                // loop through all measures and find out if the measure is integer type  
                // if interger type then format the value  
                int totalMeasuresCount = (int)Session["totalMeasuresCount"];  
 
                try 
                {  
                    for (int i = 0; i < e.Item.Cells.Count; i++)  
                    {  
                        int cellNo = 2;  
                        cellNo = i + cellNo;  
 
                        int num;  
                        bool measureVal = int.TryParse(e.Item.Cells[cellNo].Text.ToString(), out num);  
 
                        if (measureVal == true)  
                        {  
                            e.Item.Cells[cellNo].Text = int.Parse(e.Item.Cells[cellNo].Text).ToString("n0");  
                        }  
                    }  
 
                }  
                catch 
                {  
                }  
            }  
 
            CreateExpandCollapseButton(e.Item, "metricname");  
        }  
 
        public void Page_PreRenderComplete(object sender, EventArgs e)  
        {  
            HideExpandColumnRecursive(grdVwDashBoard.MasterTableView);  
            //HideExpandColumnRecursive(grid.MasterTableView);  
        }  
 
        private void HideExpandColumnRecursive(GridTableView tableView)  
        {  
            GridItem[] nestedViewItems = tableView.GetItems(GridItemType.NestedView);  
            foreach (GridNestedViewItem nestedViewItem in nestedViewItems)  
            {  
                foreach (GridTableView nestedView in nestedViewItem.NestedTableViews)  
                {  
                    nestedView.Style["border"] = "0";  
 
                    Button MyExpandCollapseButton = (Button)nestedView.ParentItem.FindControl("MyExpandCollapseButton");  
 
                    if (nestedView.Items.Count == 0)  
                    {  
                        if (MyExpandCollapseButton != null)  
                        {  
                            MyExpandCollapseButton.Style["visibility"] = "hidden";  
                        }  
 
                        nestedViewItem.Visible = false;  
                    }  
                    else 
                    {  
                        if (MyExpandCollapseButton != null)  
                        {  
                            MyExpandCollapseButton.Style.Remove("visibility");  
                        }  
                    }  
 
                    if (nestedView.HasDetailTables)  
                    {  
                        HideExpandColumnRecursive(nestedView);  
                    }  
                }  
            }  
        }  
 
        protected void grdVwDashBoard_ColumnCreated(object sender, GridColumnCreatedEventArgs e)  
        {  
            //e.OwnerTableView.CommandItemDisplay = GridCommandItemDisplay.None;  
 
            if (e.Column is GridExpandColumn)  
            {  
                e.Column.Visible = false;  
            }  
            else if (e.Column is GridBoundColumn)  
            {  
                GridBoundColumn column = e.Column as GridBoundColumn;  
                if (NO_DISPLAY_FIELDS.Any(a => a == column.DataField))  
                {  
                    e.Column.Visible = false;  
                }  
                else if (column.DataField == "metricname")  
                {  
                    e.Column.HeaderText = "Metric Name";  
                    e.Column.HeaderStyle.Width = Unit.Pixel(200);  
                }  
                else 
                {  
                    e.Column.HeaderStyle.Width = Unit.Pixel(100);  
                }  
            }  
        }  
 
        protected void grdVwDashBoard_ItemCreated(object sender, GridItemEventArgs e)  
        {  
            CreateExpandCollapseButton(e.Item, "metricname");  
 
            if (e.Item is GridHeaderItem && e.Item.OwnerTableView != grdVwDashBoard.MasterTableView)  
            {  
                //e.Item.Visible = false;  
                e.Item.Style["display"] = "none";  
            }  
 
            if (e.Item is GridNestedViewItem)  
            {  
                e.Item.Cells[0].Visible = false;  
            }  
        }  
 
        public void CreateExpandCollapseButton(GridItem item, string columnUniqueName)  
        {  
            if (item is GridDataItem)  
            {  
                if (item.FindControl("MyExpandCollapseButton") == null)  
                {  
                    Button button = new Button();  
                    button.Click += new EventHandler(button_Click);  
                    button.CommandName = "ExpandCollapse";  
                    button.CssClass = (item.Expanded) ? "rgCollapse" : "rgExpand";  
                    button.ID = "MyExpandCollapseButton";  
 
                    if (item.OwnerTableView.HierarchyLoadMode == GridChildLoadMode.Client)  
                    {  
                        string script = String.Format(@"$find(""{0}"")._toggleExpand(this, event); return false;", item.Parent.Parent.ClientID);  
 
                        button.OnClientClick = script;  
                    }  
 
                    int level = item.ItemIndexHierarchical.Split(':').Length;  
                    if (level > 1)  
                    {  
                        button.Style["margin-left"] = level + 10 + "px";  
                    }  
 
                    TableCell cell = ((GridDataItem)item)[columnUniqueName];  
                    cell.Controls.Add(button);  
                    cell.Controls.Add(new LiteralControl("&nbsp;"));  
                    cell.Controls.Add(new LiteralControl(((GridDataItem)item).GetDataKeyValue(columnUniqueName).ToString()));  
                }  
            }  
        }  
 
        void button_Click(object sender, EventArgs e)  
        {  
            ((Button)sender).CssClass = (((Button)sender).CssClass == "rgExpand") ? "rgCollapse" : "rgExpand";  
        } 

 

Veli
Telerik team
 answered on 14 Apr 2010
2 answers
135 views

Hi all,

I am wondering if anyone has any idea that writing a row header of compare list.
At the begining, i decided to make a listview to do this. 

              <LayoutTemplate> 
                <table id="Table1" runat="server" border="1"   
                    style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;font-family: Verdana, Arial, Helvetica, sans-serif;">  
                    <tr> 
                        <td>Happy</td> 
                        <%-- Goes here? --%> 
                        <asp:PlaceHolder ID="EmployeesContainer" runat="server" /> 
                    </tr> 
                    <tr> 
                        <td>Money</td> 
                    </tr> 
                    <tr> 
                        <td>Good</td> 
                    </tr> 
                 </table> 
            </LayoutTemplate> 
 
 
            <ItemTemplate> 
                <td> 
                    <asp:Label ID="YSE" runat="server"   
                        Text='<%# Eval("YES") %>' /> 
                    <%-- How about "Money" and "Good" column? --%>                  
                </td> 
            </ItemTemplate> 
 

It is difficult to make a codeless listview but now I just want to achieve this with anyway.

 

As u can see the attachment, happy, money and good are columns. A, B, C... are data.
If this is impossible, then I will write a table for this. Thx!

louis chan
Top achievements
Rank 1
Iron
 answered on 14 Apr 2010
1 answer
181 views
Dear Support,

I find that the page that I am loading into my RadWindow doesn't apply the styles in the app_themes directory. 
All the css and skin files are not shown in the head tag for the IFRAME page, but rather there are three tags that look like the below tag.

<LINK class=Telerik_stylesheet rel=stylesheet type=text/css href="/MASTRR/WebResource.axd?d=v9c6FiMMBVCv_RS52za5rWMWEoR0I4urecGaHYdAaM66IofJWOuBO54LLe4t682T0&amp;t=633868167800000000">  
 
 

Is there a way to have the page within the IFRAME use the linked CSS that exists in the Parent Page?

Thanks for your anticipated help,
Josh
Georgi Tunev
Telerik team
 answered on 14 Apr 2010
1 answer
150 views

Dear Telerik,

                 Is there any way to bind the child (or) nested grid based on the corresponding tab selected?

Say example, if I select the first tab of the nested grid the respective grid need to be bind only that time rest of grids not need to bind. Suppose if I go to the second tab then the only that time the second grid need to bind mean while the first tab grid data need to be set nothing or clear.

 

Whether the above mentioned way would help to achieve the speed or performance of the grid. If so point out how we can achieve the scenario.

I used the below mentioned to bind the nested grid's already, but it leads to slow in loading the nested grid for each operations

protected void ParentGrid_PreRender(object sender, EventArgs e)     
{     
    foreach (GridDataItem item in ParentGrid.MasterTableView.Items)     
          {                   
                if (item.Expanded)     
                {     
                  //foreach (GridNestedViewItem item1 in RadFirmGrid.MasterTableView.GetItems(GridItemType.NestedView))     
                  //{     
                    GridNestedViewItem item1 = RadFirmGrid.MasterTableView.GetItems(GridItemType.NestedView)[item.ItemIndex] as GridNestedViewItem;     
                         
                    // Binding Cutomer grid         
                    RadGrid Child1 = (RadGrid)item1.FindControl("Customer");     
             
                    // Binding Products grid         
                    RadGrid Child2 = (RadGrid)item1.FindControl("Products");    

Looking forward for your guidance

-Thanks
Yavor
Telerik team
 answered on 14 Apr 2010
3 answers
84 views
Hi,

I have a radGrid that I am binding on a timer often (~10secs). I have resize/reorder columns, resize rows and select rows enabled. If while operating any of the resize/reorder commands the grid is rebound, the grid hangs. This is easiest replicated by making the timer 1 sec, and then dragging a column and not placing it right away, allowing the bind to occur during the control manipulation. The page shows a javascript error and the grid does not re-render (the outline if the column header is stuck). The Javascript error is: this.get_element() parentNode is Null or not an object. The little bit of Jscript in the markup is not the issue, I have commented it out and I still recieve the error. Also, my Script manager (using the radManager) is on the Master Page.

Regards

<%@ Page Language="vb" AutoEventWireup="false" EnableEventValidation="false" CodeBehind="radViewAlarms.aspx.vb" Inherits="ClientWebApp.radViewAlarms" MasterPageFile="~/radClientWebApp.Master"%> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
 
<asp:Content ContentPlaceHolderID="cphHeader" ID="cphBreadCrumbs" runat="server">  
<table class="PageHeader">  
 
<tr> 
<td> 
    <asp:Label ID="lblBreadCrumbs" runat="server" ></asp:Label> 
 
</td> 
 
</tr> 
</table> 
 
<table class="PageHeaderToolbar">  
    <tr> 
        <td> 
            <asp:ImageButton ID="imgbtnAck" runat="server" ToolTip="Click to acknowledge the selected alarm." ImageUrl="~/Style/Images/alarm_aknowlege.gif" /> 
            <asp:ImageButton ID="imgbtnDel" runat="server" ToolTip="Click to delete the selected alarm." ImageUrl="~/Style/Images/alarm_delete.gif" style="width: 16px" /> 
        </td> 
    </tr> 
</table> 
 
</asp:Content> 
<asp:Content ContentPlaceHolderID="ContentPlaceHolder1" ID="cphBody" runat="server">  
 
<script type="text/javascript">  
    var selected = {};  
    function RadGrid1_RowSelected(sender, args) {  
      
        var AlarmGUID = args.getDataKeyValue("AlarmGUID");  
        if (!selected[AlarmGUID]) {  
          
            selected[AlarmGUID] = true;  
            }  
       }  
       function RadGrid1_RowDeselected(sender, args) {  
           var AlarmGUID = args.getDataKeyValue("AlarmGUID");  
           if (selected[AlarmGUID]) {  
 
               selected[AlarmGUID] = null;  
           }  
       }  
       function RadGrid1_RowCreated(sender, args) {  
           var AlarmGUID = args.getDataKeyValue("AlarmGUID");  
           if (selected[AlarmGUID]) {  
 
               args.get_gridDataItem().set_selected(true);  
           }  
       }  
    </script> 
 
 
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" > 
 
            <telerik:RadGrid ID="RadGrid1" runat="server" AllowMultiRowSelection="true" 
                AllowSorting="True" AutoGenerateColumns="False" GridLines="Both"  Skin="Black" EnableAjaxSkinRendering="false" > 
             <MasterTableView ClientDataKeyNames="AlarmGUID"  RowIndicatorColumn-Display="false" TableLayout="Auto"  > 
             <Columns> 
                    <telerik:GridBoundColumn DataField="Severity"  HeaderText="Severity" SortExpression="Severity"  ItemStyle-BorderColor="Black" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Left"   />   
                    <telerik:GridBoundColumn  DataField="DisplayName" HeaderText="DisplayName" SortExpression="DisplayName" ItemStyle-BorderColor="Black" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Left"   />   
                    <telerik:GridBoundColumn  DataField="Description" HeaderText="Description" SortExpression="Description" ItemStyle-BorderColor="Black" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Left"  />   
                    <telerik:GridBoundColumn  DataField="TimeFirst" HeaderText="TimeFirst" SortExpression="TimeFirst" ItemStyle-BorderColor="Black" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Left" />   
                    <telerik:GridBoundColumn  DataField="TimeLast" HeaderText="TimeLast" SortExpression="TimeLast" ItemStyle-BorderColor="Black" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Left" />   
                    <telerik:GridBoundColumn  DataField="AlarmId" HeaderText="AlarmId" SortExpression="AlarmId" ItemStyle-BorderColor="Black" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Left" />   
                    <telerik:GridBoundColumn  DataField="AckedBy" HeaderText="AckedBy" SortExpression="AckedBy" ItemStyle-BorderColor="Black" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Left" EmptyDataText="UnAcked" />   
                    <telerik:GridBoundColumn  DataField="TimeAcked" HeaderText="TimeAcked" SortExpression="TimeAcked" ItemStyle-BorderColor="Black" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Left" EmptyDataText="UnAcked" />   
                    <telerik:GridBoundColumn  DataField="OccurrenceCount" HeaderText="OccurrenceCount" SortExpression="OccurrenceCount" ItemStyle-BorderColor="Black" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Left" />   
                    <telerik:GridBoundColumn  DataField="NewOccurrenceCount" HeaderText="OccurrenceCount" SortExpression="NewOccurrenceCount" ItemStyle-BorderColor="Black" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Left" />    
              </Columns> 
                    <RowIndicatorColumn> 
                        <HeaderStyle Width="20px" /> 
                    </RowIndicatorColumn> 
                    <ExpandCollapseColumn> 
                        <HeaderStyle Width="20px" /> 
                    </ExpandCollapseColumn> 
                </MasterTableView> 
                <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True">  
                    <Selecting AllowRowSelect="True" /> <Resizing AllowRowResize="True"/> <Resizing AllowColumnResize="True"/>   
<ClientEvents OnRowSelected="RadGrid1_RowSelected" OnRowDeSelected="RadGrid1_RowDeselected"  OnRowCreated="RadGrid1_RowCreated" /> 
                   </ClientSettings> 
                  
                 </telerik:RadGrid> 
                      
            <asp:Timer ID="Timer1" runat="server" Interval="1000">  
            </asp:Timer> 
       
        </telerik:RadAjaxPanel> 
      
</asp:Content> 
 

Iana Tsolova
Telerik team
 answered on 14 Apr 2010
1 answer
61 views
Hi,

I have a grid with client select column, and other columns which contains textboxes and check boxes. User can edit the row by checking or unchecking any checkbox in the grid, or changing the text in any textbox. 

For editing I am not using edit command or any other thing of Grid. User can directly change the values and hit Save.

I want to show a box when user tries to leave unsaved changes in grid. 

Can anyone help me on how to achieve this?

Thanks,

Jimmy.
Yavor
Telerik team
 answered on 14 Apr 2010
4 answers
230 views
Hi,
    I have a Radgrid where I have set 

AllowAutomaticUpdates

 

="false" and 

 

AllowAutomaticInserts

 

="True" and

<

 

telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">

 

 

<ItemStyle CssClass="MyImageButton" />

 

 

</telerik:GridEditCommandColumn>

 

as first column of the Grid.

    Even though i have set AllowAutomaticUpdates="false",  I am getting GridEditColumn with Edit Icon.
How to get rid of Edit Icon and have only Insert Operation.


Thanks.
Swapna M
Top achievements
Rank 1
 answered on 14 Apr 2010
2 answers
161 views
Hi,

I have noticed a performance issue with the RadListView and DataPager controls. I am seeing a noticable delay in moving to the next page in my RadListView which I think is due to the number of CSS calls being made. This only happens the first time i visit the page with the control on and click the "next page" button - afterwards, the css is cached so the performance is fine.

I am seeing 8 calls to CSS files from my WebResource.axd. These are for:

Telerik RadListView Common CSS
Telerik RadListView Default Skin
Telerik RadDataPager Common CSS
Telerik RadDataPager Default Skin

The calls all occur twice!

Is there a way to reduce these calls?
Here is my code:

<asp:UpdatePanel ID="upExpList" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false"> 
        <ContentTemplate>  
        <ul> 
                <telerik:RadListView OnPageIndexChanged="rlvExperiences_PageIndexChanged"  
                ItemPlaceholderID="ViewTitlePlaceholder" 
                    DataKeyNames="ExperienceId" ID="rlvExperienceTitles" 
                    runat="server" AllowPaging="true"> 
                    <LayoutTemplate> 
                        <li runat="server" id="ViewTitlePlaceholder" /> 
                        </li> 
                    </LayoutTemplate> 
                    <ItemTemplate> 
                        <li> 
                            //removed for brevity 
                        </li> 
                    </ItemTemplate> 
                </telerik:RadListView> 
            </ul> 
        </div> 
        </ContentTemplate> 
        <Triggers> 
        <asp:AsyncPostBackTrigger ControlID="dataPager" EventName="Command" /> 
        <asp:PostBackTrigger ControlID="rlvExperienceTitles" /> 
        </Triggers> 
        </asp:UpdatePanel> 
        <asp:UpdatePanel ID="upDataPager" runat="server" > 
        <ContentTemplate> 
           <telerik:RadDataPager BackColor="Transparent" BorderColor="Transparent"  
      Font-Size="Small" ID="dataPager" runat="server" PagedControlID="rlvExperienceTitles"  
      PageSize="20"> 
<Fields> 
                               <telerik:RadDataPagerButtonField FieldType="Prev" /> 
                               <telerik:RadDataPagerButtonField FieldType="Numeric" /> 
                               <telerik:RadDataPagerButtonField FieldType="Next" /> 
                             <telerik:RadDataPagerTemplatePageField> 
                                            <PagerTemplate> 
                                                <div style="float: right"> 
                                                     
                                                        <asp:Label runat="server" ID="CurrentPageLabel" Text="<%# Container.Owner.StartRowIndex+1%>" /> 
                                                        to 
                                                        <asp:Label runat="server" ID="TotalPagesLabel" Text="<%#CheckPagingTotal( Container.Owner.StartRowIndex+Container.Owner.PageSize) %>" /> 
                                                        of 
                                                        <asp:Label runat="server" ID="TotalItemsLabel" Text="<%# Container.Owner.TotalRowCount%>" /> 
                                                         
                                                    
                                                </div> 
                                            </PagerTemplate> 
                                        </telerik:RadDataPagerTemplatePageField> </Fields> 
                       </telerik:RadDataPager> 
        </ContentTemplate></asp:UpdatePanel> 

Thanks
Tom
Diane
Top achievements
Rank 1
 answered on 14 Apr 2010
1 answer
131 views
Is it possible to rename the WAV file to something other than RadCaptcha_Audio_xxxx?  ie. myAudio_xxxx

Thanks
Pero
Telerik team
 answered on 14 Apr 2010
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?