Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
456 views
 Hey I have two details tables in my rad Grid . Now what I have to do is to check/uncheck all the checkboxes of the current detail table only. on checking/unchecking the header checkbox. and also want to check the header checkbox of current detail table only. when I have  checked each checkbox of the same detail table



<%@ Page Language="C#" AutoEventWireup="true" CodeFile="RadGridHierarchyCheckbox.aspx.cs" Inherits="RadGridHierarchyCheckbox" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
            </Scripts>
        </telerik:RadScriptManager>
        <script type="text/javascript">
           function SetHeaderCheckBox(checkbox)
  {
  //Select or deselect header check box
  }
   function SelectAllCheckBox(checkbox)
  {
  //Select or deselect Detail Table CheckBOXes
  }
        </script>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        </telerik:RadAjaxManager>
        <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" CellSpacing="0" AutoGenerateColumns="False"
            GridLines="None" Width="800px" OnNeedDataSource="RadGrid1_NeedDataSource" OnDetailTableDataBind="RadGrid1_DetailTableDataBind">
           
            <MasterTableView DataKeyNames="OrderID" HierarchyDefaultExpanded="true" CommandItemDisplay="Top">
             
                <DetailTables>
                    <telerik:GridTableView DataKeyNames="OrderID" PageSize="3" Name="DetailViewTest">
                        <Columns>
                            <telerik:GridBoundColumn DataField="OrderID" DataType="System.Int32"
                                FilterControlAltText="Filter OrderID column" HeaderText="OrderID"
                                ReadOnly="True" SortExpression="OrderID" UniqueName="OrderID">
                            </telerik:GridBoundColumn>
                            <telerik:GridDateTimeColumn DataField="OrderDate" DataType="System.DateTime"
                                FilterControlAltText="Filter OrderDate column" HeaderText="OrderDate"
                                SortExpression="OrderDate" UniqueName="OrderDate">
                            </telerik:GridDateTimeColumn>
                            <telerik:GridNumericColumn DataField="Freight" DataType="System.Decimal"
                                FilterControlAltText="Filter Freight column" HeaderText="Freight"
                                SortExpression="Freight" UniqueName="Freight">
                            </telerik:GridNumericColumn>
                            <telerik:GridBoundColumn DataField="ShipName"
                                FilterControlAltText="Filter ShipName column" HeaderText="ShipName"
                                SortExpression="ShipName" UniqueName="ShipName">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="ShipCountry"
                                FilterControlAltText="Filter ShipCountry column" HeaderText="ShipCountry"
                                SortExpression="ShipCountry" UniqueName="ShipCountry">
                            </telerik:GridBoundColumn>
                        </Columns>
                    </telerik:GridTableView>
 <DetailTables>
                    <telerik:GridTableView DataKeyNames="OrderID" PageSize="3" Name="DetailViewTest">
                        <Columns>
<telerik:GridTemplateColumn UniqueName="SelectItemCheckBoxColumn" Resizable="false" Reorderable="false">
                                                                <ItemTemplate>
                                                                    <asp:CheckBox ID="SelectItemCheckBox" runat="server" onclick="return SetHeaderCheckBox(this);" />
                                                                 
                                                                </ItemTemplate>
                                                                <HeaderTemplate>
                                                                    <asp:CheckBox ID="SelectHeaderCheckBox" runat="server" onclick="return SelectAllCheckBox(this);" />
                                                                  
                                                                </HeaderTemplate>
                                                            </telerik:GridTemplateColumn>
                            <telerik:GridBoundColumn DataField="OrderID" DataType="System.Int32"
                                FilterControlAltText="Filter OrderID column" HeaderText="OrderID"
                                ReadOnly="True" SortExpression="OrderID" UniqueName="OrderID">
                            </telerik:GridBoundColumn>
                            <telerik:GridDateTimeColumn DataField="OrderDate" DataType="System.DateTime"
                                FilterControlAltText="Filter OrderDate column" HeaderText="OrderDate"
                                SortExpression="OrderDate" UniqueName="OrderDate">
                            </telerik:GridDateTimeColumn>
                            <telerik:GridNumericColumn DataField="Freight" DataType="System.Decimal"
                                FilterControlAltText="Filter Freight column" HeaderText="Freight"
                                SortExpression="Freight" UniqueName="Freight">
                            </telerik:GridNumericColumn>
                            <telerik:GridBoundColumn DataField="ShipName"
                                FilterControlAltText="Filter ShipName column" HeaderText="ShipName"
                                SortExpression="ShipName" UniqueName="ShipName">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="ShipCountry"
                                FilterControlAltText="Filter ShipCountry column" HeaderText="ShipCountry"
                                SortExpression="ShipCountry" UniqueName="ShipCountry">
                            </telerik:GridBoundColumn>
                        </Columns>
                    </telerik:GridTableView>
                </DetailTables>
                </DetailTables>
                <Columns>
                    <telerik:GridBoundColumn DataField="OrderID" DataType="System.Int32"
                        FilterControlAltText="Filter OrderID column" HeaderText="OrderID"
                        ReadOnly="True" SortExpression="OrderID" UniqueName="OrderID">
                    </telerik:GridBoundColumn>
                    <telerik:GridDateTimeColumn DataField="OrderDate" DataType="System.DateTime"
                        FilterControlAltText="Filter OrderDate column" HeaderText="OrderDate"
                        SortExpression="OrderDate" UniqueName="OrderDate">
                    </telerik:GridDateTimeColumn>
                    <telerik:GridNumericColumn DataField="Freight" DataType="System.Decimal"
                        FilterControlAltText="Filter Freight column" HeaderText="Freight"
                        SortExpression="Freight" UniqueName="Freight">
                    </telerik:GridNumericColumn>
                    <telerik:GridBoundColumn DataField="ShipName"
                        FilterControlAltText="Filter ShipName column" HeaderText="ShipName"
                        SortExpression="ShipName" UniqueName="ShipName">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="ShipCountry"
                        FilterControlAltText="Filter ShipCountry column" HeaderText="ShipCountry"
                        SortExpression="ShipCountry" UniqueName="ShipCountry">
                    </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
    </form>
</body>
</html>
Kostadin
Telerik team
 answered on 02 Jan 2014
1 answer
195 views
Hi,
How to open a window on button click?
Princy
Top achievements
Rank 2
 answered on 02 Jan 2014
5 answers
189 views
Greetings,

I have a sever problem with template columns when on batch mode. To see and reproduce the problem I made a web page that can be downloaded from here.
Please download and run the referenced website with the latest version of RadControls. Do the following to produce the error:
  1. Click the "add new record" button
  2. Then click on any of the other closed rows

What happens is that the newly added row cells are all closed except the template column cell (the one with the search box).
I dug into the client side code, and noticed that for the template column there are two editor DIVs. One is inserted to the edited row while the other stays as is. One of the DIVs corresponds to the edit template while the other to the insert template.

Am I doing something wrong? How to combine the two editor DIVs into one?
I tried creating an inherited GridTemplateColumnEditor but found that the column doesn't use it.

Konstantin Dikov
Telerik team
 answered on 02 Jan 2014
3 answers
557 views
i am experiencing a problem while downloading files  through rad controls

okai i have a button that is called generate presentation , the button is inside rad ajax panel  , so when the button is pressed  an asynchronous post back goes to server   and the uploading panel becomes visible .  on server  i use  the following  code to  transmit the file to the user who can then download it

 string fileNameToDisplay =  TrimNonCompliantStrings();
               
                   string virtualPath = @"~\" + newPresentationDoc.Replace(HttpContext.Current.Request.PhysicalApplicationPath, String.Empty);
             //   Response.End();

                   RadAjaxPanel1.ResponseScripts.Add(String.Format(@"window.location.href = ""{0}"";", virtualPath));

but nothing really happens when the response is sent from the server  it just closes the update panel and no download dialog is shown  previously before ajaxifying  i was using the  following appraoch ,  and it was working fine


    Response.ContentType = "application/octet-stream";
                 Response.AppendHeader("Content-Disposition", "attachment;filename=" +fileNameToDisplay );   //+ ".pptx"
                   Response.AppendHeader("Content-Disposition", "attachment;filename=" + "babe" + ".pptx");  
    Response.TransmitFile(virtualPath);
      Response.End();

i know a workaround where i can disable ajax request by replacing it with a full blown request to download the file , but by that i l loose the upload panels preloader ....  , How can i resolve this issue 


here is the markup

 <telerik:AjaxSetting AjaxControlID="btn_Generate">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadAjaxPanel1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    
                </UpdatedControls>
            </telerik:AjaxSetting>
               
  <telerik:AjaxSetting AjaxControlID="btnPublish">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadAjaxPanel1" LoadingPanelID="RadAjaxLoadingPanel1"  />
                    
                </UpdatedControls>
            </telerik:AjaxSetting>
    </AjaxSettings>




                

  
 
      

             
               
Konstantin Dikov
Telerik team
 answered on 02 Jan 2014
2 answers
122 views
I have a radgrid that has virtualization enabled. The problem I run into is that after the grid pages forward, my ClientDataKey values are null. If I try to get the values server side, I get a row from the first page instead of the row that I selected. This makes my two options to fail miserably since there are no DataKeys, or send the user to a page based on incorrect data. I created a small sample application that demonstrates this problem. 

Basically, if you double click a row on the page that loads. The Order and Item have values in the alert that pops up. Scroll down for a few pages and double click another row. The datakey values are undefined (null). This is not ok.

If you want the zipped project file, let me know where to send it.

Aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="TelerikIE11._default" MasterPageFile="~/Site1.Master" %>
 
<asp:Content ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript">
        var RadGrid1;
 
        function GetGridObject(sender, eventArgs) {
            RadGrid1 = sender;
        }
 
        function ColumnChecked(sender, eventArgs) {
            var item = eventArgs.get_item();
            var checked = item.get_checked();
            var value = item.get_value();
            if (checked) {
                RadGrid1.get_masterTableView().showColumn(value);
                RadGrid1.MasterTableViewHeader.ColGroup.Cols[value].style.display = "";
            }
            else {
                RadGrid1.get_masterTableView().hideColumn(value);
                RadGrid1.MasterTableViewHeader.ColGroup.Cols[value].style.display = "none";
            }
        }
 
        function OnRowMouseOver(sender, args) {
            $('Order').text(args.getDataKeyValue("OrderID"));
            $('Item').text(args.getDataKeyValue("OrderItemID"));
        }
 
        function OnRowDblClick(sender, args) {
            var order = args.getDataKeyValue("OrderID");
            var item = args.getDataKeyValue("OrderItemID");
            var id = args.get_id();
            //var itemIndex = args.get_itemIndexHeirarchical();
            //var dataItem = args.getGridDataItem();
            alert('Order:'+ order + ' Item:' + item + ' ID:' + id);
        }
    </script>
    <telerik:RadAjaxManager ID="RadAjaxManager" runat="server" UpdatePanelsRenderMode="Inline">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="button">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <div>
        <button runat="server" onclick="PopulateGrid" id="button">Populate</button>
    </div>
    <div id="radGridPaneNav" class="radPaneNav">
        <telerik:RadComboBox ID="ColumnListBox" runat="server" Width="300px" CheckBoxes="true" OnClientItemChecked="ColumnChecked">
            <Items>
                <telerik:RadComboBoxItem Text="Reserved By" Value="3" Checked="true" />
                <telerik:RadComboBoxItem Text="Client" Value="4" Checked="true" />
                <telerik:RadComboBoxItem Text="Loan Number" Value="5" Checked="true" />
                <telerik:RadComboBoxItem Text="Product" Value="6" Checked="true" />
                <telerik:RadComboBoxItem Text="Vendor Name" Value="7" Checked="true" />
                <telerik:RadComboBoxItem Text="Property Address" Value="8" Checked="true" />
                <telerik:RadComboBoxItem Text="City" Value="9" Checked="true" />
                <telerik:RadComboBoxItem Text="County" Value="10" Checked="true" />
                <telerik:RadComboBoxItem Text="State" Value="11" Checked="true" />
                <telerik:RadComboBoxItem Text="Borrower" Value="12" Checked="true" />
                <telerik:RadComboBoxItem Text="Order Date" Value="13" Checked="true" />
                <telerik:RadComboBoxItem Text="Due Date" Value="14" Checked="true" />
                <telerik:RadComboBoxItem Text="Updated Date" Value="15" Checked="true" />
                <telerik:RadComboBoxItem Text="Last Status" Value="16" Checked="true" />
                <telerik:RadComboBoxItem Text="Hold Reason" Value="17" Checked="true" />
                <telerik:RadComboBoxItem Text="Supervisory Review Reason" Value="18" Checked="true" />
            </Items>
        </telerik:RadComboBox>
 
        <span class="pull-right col-lg-1">Order:<label id="Order"></label>
             Item:<label id="Item"></label></span>
    </div>
    <div id="radGridPane" class="radGridPane">
        <telerik:RadGrid ID="RadGrid" runat="server" AllowSorting="true" AllowFilteringByColumn="true" AllowPaging="true" AllowCustomPaging="true" PageSize="100"
            GridLines="None" Style="font-weight: normal; font-size: 10pt; font-family: Calibri, Verdana, Arial" OnNeedDataSource="RadGrid_NeedDataSource"
            AutoGenerateColumns="false" GroupingEnabled="False" Width="100%" Height="1000px">
            <MasterTableView ClientDataKeyNames="OrderID,OrderItemID" TableLayout="Fixed">
                <Columns>
                    <telerik:GridImageColumn DataType="System.String" DataImageUrlFields="Overdue" DataImageUrlFormatString="images/{0}.gif"
                        ImageAlign="Middle" AllowFiltering="false" HeaderStyle-Width="30px" ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle" ItemStyle-Width="30px" />
                    <telerik:GridImageColumn DataType="System.String" DataImageUrlFields="UnhandledComment" DataImageUrlFormatString="images/{0}.gif"
                        ImageAlign="Middle" AllowFiltering="false" HeaderStyle-Width="30px" ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle" ItemStyle-Width="30px" />
                    <telerik:GridBoundColumn DataField="OrderKey" HeaderText="ID" FilterControlWidth="60px">
                        <HeaderStyle Width="100px" HorizontalAlign="Center" Font-Bold="true" Font-Size="Smaller" />
                        <ItemStyle HorizontalAlign="Center" Font-Size="Smaller" Width="100px" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="ReservedUserName" HeaderText="Reserved By" FilterControlWidth="110px">
                        <HeaderStyle Width="150px" Font-Bold="true" Font-Size="Smaller" />
                        <ItemStyle Font-Size="Smaller" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Client" HeaderText="Client" UniqueName="Client" FilterControlWidth="200px">
                        <HeaderStyle Font-Bold="true" Width="240px" Font-Size="Smaller" />
                        <ItemStyle Font-Size="Smaller" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="LoanNumber" HeaderText="Loan Number" FilterControlWidth="85px">
                        <HeaderStyle Width="125px" Font-Bold="true" Font-Size="Smaller" />
                        <ItemStyle Font-Size="Smaller" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Product" HeaderText="Product" UniqueName="Product" FilterControlWidth="100px">
                        <HeaderStyle Width="140px" Font-Bold="true" Font-Size="Smaller" />
                        <ItemStyle Font-Size="Smaller" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="VendorName" HeaderText="Vendor" FilterControlWidth="100px">
                        <HeaderStyle Width="140px" Font-Bold="true" Font-Size="Smaller" />
                        <ItemStyle Font-Size="Smaller" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Address1" HeaderText="Property Address" FilterControlWidth="130px">
                        <HeaderStyle Width="170px" Font-Bold="true" Font-Size="Smaller" />
                        <ItemStyle Font-Size="Smaller" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="City" HeaderText="City" FilterControlWidth="100px">
                        <HeaderStyle Width="140px" Font-Bold="true" Font-Size="Smaller" />
                        <ItemStyle Font-Size="Smaller" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="CountyName" HeaderText="County" FilterControlWidth="100px">
                        <HeaderStyle Width="140px" Font-Bold="true" Font-Size="Smaller" />
                        <ItemStyle Font-Size="Smaller" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="State" HeaderText="State" FilterControlWidth="25px">
                        <HeaderStyle Width="65px" HorizontalAlign="Center" Font-Bold="true" Font-Size="Smaller" />
                        <ItemStyle HorizontalAlign="Center" Font-Size="Smaller" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Borrower" HeaderText="Borrower" FilterControlWidth="135px">
                        <HeaderStyle Width="175px" Font-Bold="true" Font-Size="Smaller" />
                        <ItemStyle Font-Size="Smaller" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="OrderDate" HeaderText="Ordered" DataFormatString="{0:MM-dd-yyyy}" FilterControlWidth="55px">
                        <HeaderStyle Width="95px" Font-Bold="true" Font-Size="Smaller" />
                        <ItemStyle Font-Size="Smaller" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="RequiredByDate" HeaderText="Due" UniqueName="RequiredByDate" FilterControlWidth="55px" DataFormatString="{0:MM-dd-yyyy}">
                        <HeaderStyle Width="95px" Font-Bold="true" Font-Size="Smaller" />
                        <ItemStyle Font-Size="Smaller" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="LastUpdatedDate" HeaderText="Updated" UniqueName="LastUpdatedDate" DataFormatString="{0:MM-dd-yyyy 'at' h:mm tt}">
                        <HeaderStyle Width="130px" Font-Bold="true" Font-Size="Smaller" />
                        <ItemStyle Font-Size="Smaller" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="LastStatus" HeaderText="Last Status" UniqueName="Status" FilterControlWidth="135px">
                        <HeaderStyle Width="175px" Font-Bold="true" Font-Size="Smaller" />
                        <ItemStyle Font-Size="Smaller" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="OnHoldReason" HeaderText="Hold Reason" FilterControlWidth="125px">
                        <HeaderStyle Width="165px" Font-Bold="true" Font-Size="Smaller" />
                        <ItemStyle Font-Size="Smaller" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="SupervisoryReviewReason" HeaderText="Review Reason" FilterControlWidth="125px">
                        <HeaderStyle Width="165px" Font-Bold="true" Font-Size="Smaller" />
                        <ItemStyle Font-Size="Smaller" />
                    </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
            <ClientSettings AllowKeyboardNavigation="false" EnableRowHoverStyle="true" AllowColumnHide="true">
                <Virtualization EnableVirtualization="true" InitiallyCachedItemsCount="1000" ItemsPerView="100" />
                <Scrolling AllowScroll="true" UseStaticHeaders="true" EnableVirtualScrollPaging="true" />
                <Selecting AllowRowSelect="true" EnableDragToSelectRows="false" />
                <ClientEvents OnRowMouseOver="OnRowMouseOver" OnRowDblClick="OnRowDblClick" />
            </ClientSettings>
            <PagerStyle Mode="NextPrevAndNumeric" Position="Bottom" PageSizeControlType="None" AlwaysVisible="false" Visible="false" />
        </telerik:RadGrid>
    </div>
</asp:Content>

CS:
using System;
using System.Data;
 
namespace TelerikIE11
{
    public partial class _default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {}
 
        protected void PopulateGrid(object sender, EventArgs e)
        {
            RadGrid_NeedDataSource(null, null);
        }
 
        protected void RadGrid_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            DataTable table = new DataTable();
            DataSet ds = new DataSet();
            DataRow row;
             
            ds.Tables.Add(table);
            ds.Tables[0].Columns.Add("Overdue");
            ds.Tables[0].Columns.Add("UnhandledComment");
            ds.Tables[0].Columns.Add("OrderID");
            ds.Tables[0].Columns.Add("OrderItemID");
            ds.Tables[0].Columns.Add("ReservedUserName");
            ds.Tables[0].Columns.Add("Client");
            ds.Tables[0].Columns.Add("LoanNumber");
            ds.Tables[0].Columns.Add("Product");
            ds.Tables[0].Columns.Add("VendorName");
            ds.Tables[0].Columns.Add("Address1");
            ds.Tables[0].Columns.Add("City");
            ds.Tables[0].Columns.Add("CountyName");
            ds.Tables[0].Columns.Add("State");
            ds.Tables[0].Columns.Add("Borrower");
            ds.Tables[0].Columns.Add("OrderDate", Type.GetType("System.DateTime"));
            ds.Tables[0].Columns.Add("RequiredByDate", Type.GetType("System.DateTime"));
            ds.Tables[0].Columns.Add("LastUpdatedDate", Type.GetType("System.DateTime"));
            ds.Tables[0].Columns.Add("LastStatus");
            ds.Tables[0].Columns.Add("OnHoldReason");
            ds.Tables[0].Columns.Add("SupervisoryReviewReason");
 
            for (int i = 0; i < 10000; i++)
            {
                row = ds.Tables[0].NewRow();
                row["Overdue"] = i > 12 ? "Y" : "N";
                row["UnhandledComment"] = i < 5 ? "Y" : "N";
                row["OrderID"] = "1123" + i;
                row["OrderItemID"] = "1";
                row["ReservedUserName"] = "User " + i;
                row["Client"] = "Client " + i;
                row["LoanNumber"] = "Loan " + i;
                row["Product"] = "Product " + i;
                row["VendorName"] = "Vendor " + i;
                row["Address1"] = i + " Fake Street";
                row["City"] = "Random City";
                row["CountyName"] = "Random County";
                row["State"] = "CA";
                row["Borrower"] = i + "Borrower" + i;
                row["OrderDate"] = DateTime.Now.AddHours(-i);
                row["RequiredByDate"] = DateTime.Now.AddHours(i + i);
                row["LastUpdatedDate"] = DateTime.Now.AddMinutes(-i);
                row["LastStatus"] = "Status " + (i * 2);
                row["OnHoldReason"] = "Testing";
                row["SupervisoryReviewReason"] = "Broken";
                ds.Tables[0].Rows.Add(row);
            }
 
            ds.Tables[0].Columns.Add("OrderKey");
            foreach (DataRow dRow in ds.Tables[0].Rows)
            {
                dRow["OrderKey"] = string.Format("{0}.{1}", dRow["OrderID"], dRow["OrderItemID"]);
                dRow["Overdue"] = dRow["Overdue"].ToString().Equals("Y") ? "flag" : "blank";
                dRow["UnhandledComment"] = dRow["UnhandledComment"].ToString().Equals("Y") ? "comment" : "blank";
            }
 
            RadGrid.VirtualItemCount = ds.Tables[0].Rows.Count;
            RadGrid.DataSource = ds.Tables[0];
        }
    }
}

Master page:
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site1.master.cs" Inherits="TelerikIE11.Site1" %>
 
<!DOCTYPE html>
 
<html>
<head runat="server">
    <title></title>
    <asp:ContentPlaceHolder ID="head" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager" runat="server" />
        <div><asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server" /></div>
    </form>
</body>
<script src="js/jquery-1.10.2.min.js"></script>
</html>


Konstantin Dikov
Telerik team
 answered on 02 Jan 2014
5 answers
255 views

I have a RadGrid with the default setting of GroupLoadMode="Server".   When I click on a group, it collapses, but when I click on it again, it will not expand.  Am I missing some setting?

    <telerik:RadGrid ID="rgContacts" runat="server"   
        AllowSorting="True"   
        AllowFilteringByColumn="True"   
        AllowPaging="True" 
        EnableEmbeddedSkins="False" 
        EnableViewState="false" 
        GridLines="None"   
        PageSize="20" 
        Skin="IBMS" 
        ShowGroupPanel="True" 
        onprerender="rgContacts_PreRender" 
        oncolumncreated="rgContacts_ColumnCreated"   
        onitemdatabound="rgContacts_ItemDataBound"   
        OnItemCreated="rgContacts_ItemCreated" 
        OnNeedDataSource="rgContacts_NeedDataSource" 
        > 
          
        <GroupingSettings CaseSensitive="false" ShowUnGroupButton="true" /> 
 
        <ClientSettings   
            ReorderColumnsOnClient="True"   
            AllowDragToGroup="True"   
            AllowColumnsReorder="True" 
            >  
            <Scrolling   
                AllowScroll="True"   
                UseStaticHeaders="True"   
                FrozenColumnsCount="1"    
                EnableVirtualScrollPaging="false">  
            </Scrolling> 
            <Resizing   
                AllowRowResize="False"   
                AllowColumnResize="True">  
            </Resizing> 
        </ClientSettings> 
                          
        <HeaderContextMenu EnableEmbeddedSkins="False"></HeaderContextMenu> 
          
        <MasterTableView AllowMultiColumnSorting="true" CommandItemDisplay="Top" AutoGenerateColumns="false" GroupLoadMode="Server">  
              
            <CommandItemTemplate> 
                <div style="padding: 2px 2px;">  
                    <table width="100%">  
                        <tr> 
                            <td> 
                            <uc1:wucToolbarSave ID="wucToolbarSave" runat="server"   
                                                    OnToolbarSaveClick="ToolbarSave_Click" DisplayToolbar="true" 
                                                    VisibleView="false" VisibleCancel="false" VisibleDelete="false" VisibleEdit="false"                                                      VisibleReturn="false" VisibleSave="false" ViewAdd="true" ViewItem="true"/>  
                            </td> 
                            <td align="right">  
                                <uc2:wucToolbarGridSettings ID="wucToolbarGridSettings" runat="server" />                                                            </td> 
                        </tr> 
                    </table> 
                </div>   
            </CommandItemTemplate> 
 
            <RowIndicatorColumn> 
                <HeaderStyle Width="20px"></HeaderStyle> 
            </RowIndicatorColumn> 
 
            <ExpandCollapseColumn> 
                <HeaderStyle Width="20px"></HeaderStyle> 
            </ExpandCollapseColumn> 
              
            <Columns> 
                <telerik:GridTemplateColumn UniqueName="ViewCommand"   
                    AllowFiltering="false" Resizable="false" Reorderable="false"   
                    HeaderStyle-Width="36" ItemStyle-Width="36">  
                    <ItemTemplate> 
                        <asp:HyperLink ID="hlView" runat="server" NavigateUrl='<%# "~/ContactManagement/Contact" + Eval("PartyType") + ".aspx?id=" + Eval("PartyId") %>'>  
                            <asp:Image ID="imgView" runat="server" ToolTip='View Contact' ImageUrl='<%# "~/App_Themes/Standard/images/view.png" %>' /> 
                        </asp:HyperLink> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
                  
                <telerik:GridTemplateColumn UniqueName="PartyType" DataField="PartyType" SortExpression="PartyType" GroupByExpression="PartyType Group By PartyType" 
                     AllowFiltering="false" Resizable="false" Reorderable="true" Groupable="true"   
                    HeaderStyle-Width="48" ItemStyle-Width="48"  ItemStyle-HorizontalAlign="Center" HeaderText="Type">  
                    <ItemTemplate> 
                        <asp:Image ID="imgType" runat="server" ToolTip='<%# Eval("PartyType") %>' ImageUrl='<%# "~/App_Themes/Standard/images/" + Eval("PartyType") + ".png" %>' /> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn>     
                  
                <telerik:GridBoundColumn DataField="Code" Groupable="true"   
                    HeaderText="Code" SortExpression="Code" UniqueName="Code">  
                </telerik:GridBoundColumn> 
                               
                <telerik:GridBoundColumn DataField="Contact" Groupable="true"   
                    HeaderText="Contact" SortExpression="Contact" UniqueName="Contact">  
                </telerik:GridBoundColumn> 
 
                <telerik:GridBoundColumn DataField="Business_PhoneNumber" Groupable="true"   
                    HeaderText="Business Phone" SortExpression="Business_PhoneNumber" UniqueName="Business_PhoneNumber">  
                </telerik:GridBoundColumn> 
 
                <telerik:GridBoundColumn DataField="Business_CellNumber" Groupable="true"   
                    HeaderText="Business Cell" SortExpression="Business_CellNumber" UniqueName="Business_CellNumber">  
                </telerik:GridBoundColumn> 
                  
                <telerik:GridBoundColumn DataField="Business_Email" Groupable="true"   
                    HeaderText="Business Email" SortExpression="Business_Email" UniqueName="Business_Email">  
                </telerik:GridBoundColumn> 
                  
                <telerik:GridTemplateColumn DataField="Business_Address" Groupable="true"   
                    HeaderText="Business Address" SortExpression="Business_Address" UniqueName="Business_Address">  
                    <ItemTemplate> 
                        <asp:Literal ID="lblDisplayAs" runat="server" Text='<%# ConvertToHTML(Eval("Business_Address")) %>' /> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
 
                <telerik:GridBoundColumn DataField="Organization_Type" Groupable="true"   
                    HeaderText="Organization Type" SortExpression="Organization_Type" UniqueName="Organization_Type">  
                </telerik:GridBoundColumn> 
                  
            </Columns> 
                  
            <GroupByExpressions> 
                <telerik:GridGroupByExpression> 
                    <SelectFields> 
                        <telerik:GridGroupByField FieldName="PartyType" HeaderText="Type" FormatString="{0}" /> 
                    </SelectFields> 
                    <GroupByFields> 
                        <telerik:GridGroupByField FieldName="PartyType" HeaderText="Type" SortOrder="Descending" /> 
                    </GroupByFields> 
                </telerik:GridGroupByExpression> 
            </GroupByExpressions> 
             
        </MasterTableView> 
          
        <ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True" AllowGroupExpandCollapse="true">  
            <Selecting AllowRowSelect="True" /> 
        </ClientSettings> 
 
        <FilterMenu EnableEmbeddedSkins="False"></FilterMenu> 
     
    </telerik:RadGrid> 
 
Rakesh
Top achievements
Rank 1
 answered on 02 Jan 2014
3 answers
191 views
Hi,

We have the RadGrid Hierarchical pattern implemented with server side data binding. The grid is 3 levels deep bound to 3 different tables. The Master Table Grid View will be updated at the client side as well the table data gets updated via jQuery AJAX call as a result of an user action.

After this, upon the Detail Table binding (Expanding/Collapsing any row hierarchy) we have the Master Table Grid View getting bounded to the old data, i.e., the master table grid view is not retaining the changes made at the client side rather getting bounded to the old data again there by losing client side updates to the Master Grid View!

Please suggest us the way to retain the client side updates to the Master Table Grid View upon expand/collapse or update Master Table Grid View data to the latest data from the source thereby not losing the row selection!

Thank you,
Eyup
Telerik team
 answered on 02 Jan 2014
4 answers
97 views
Hello,

I am working on a grid with some columns have the width automatically adjusted, some others adjusted by resizeToFit() and some other the width is fixed by HeaderStyle.Width.

If there is a column re sized by  resizeToFit(), all the following columns' width with HeaderStyle.Width are not respecting this parameter. The columns before the one re sized to fit work well.

Also if I use resizeToFit() and resizeColumn(index,width) (not using HeaderStyle.Width in this case), only resizeColumn is applied (placed after resizeToFit() in the script).

Could please explain how can they all get along together?
Thank you
Gregory


Antonio Stoilkov
Telerik team
 answered on 02 Jan 2014
5 answers
105 views
Only in Firefox, using getRadWindow().close(workLink); does not allow a OnClick call from an ASP:LinkButton to fire. There does not seem to be an issue with using a ASP:Button.

If I yank out the following, it fires.
console.log("begin trouble");
            workLink.pages = pageValue; //pages.value <-- just swapped out for pageValue variable;
            selectedText += ")</a>";
            workLink.selectedText = selectedText;
            getRadWindow().close(workLink); //use the close function of the getRadWindow to close the dialog and pass the arguments from the dialog to the callback function on the main page.  



Here's my code.


 
<asp:LinkButton ID="cmdUpdate" CssClass="dnnPrimaryAction" resourcekey="cmdUpdate" Text="Save and Exit" runat="server" OnClick="cmdUpdate_Click" OnClientClick="if(!insertLinkFromDB()){return false;};" UseSubmitBehavior="false" ></asp:LinkButton
 
 
if (window.attachEvent) {
            window.attachEvent("onload", initDialog);
        }
        else if (window.addEventListener) {
            window.addEventListener("load", initDialog, false);
        }
 
        var pages = document.getElementById("pages");
        var workLink = null;
 
        function getRadWindow() {
            if (window.radWindow) {
                return window.radWindow;
            }
 
            if (window.frameElement && window.frameElement.radWindow) {
                return window.frameElement.radWindow;
            }
 
            return null;
        }
 
        function initDialog() {
            var clientParameters = getRadWindow().ClientParameters; //return the arguments supplied from the parent page  
 
            pages.value = clientParameters.innerHTML;
            workLink = clientParameters;
        }
 
function insertLinkFromDB() //fires when the Insert Link button is clicked on the "New Item" Screen  
        {
            //create an object and set some custom properties to it
            var authorLastValue = $('#referenceAuthor').val();
            var dateValue = $('#referenceYear').val();
            var currentId = $('.highlighted').attr('id');
 
            var selectedText;
 
            selectedText = "<a href=\"#citation_" + currentId + "\">(" + authorLastValue + ", " + dateValue;
 
            var pageValue = $('#pages2').val();
            if (pageValue != "") {
                selectedText += " Pg " + pageValue;
            }
 
            console.log("begin trouble");
            workLink.pages = pageValue; //pages.value <-- just swapped out for pageValue variable;
            selectedText += ")</a>";
            workLink.selectedText = selectedText;
            getRadWindow().close(workLink); //use the close function of the getRadWindow to close the dialog and pass the arguments from the dialog to the callback function on the main page.  
 
            return true;
        }
 
//This is a radwindow workaround. Buttons call the closewindow function
        function closeWindow() {
            GetRadWindow().close();
        }
        function GetRadWindow() {
            var oWindow = null;
            if (window.radWindow)
                oWindow = window.radWindow;
            else if (window.frameElement.radWindow)
                oWindow = window.frameElement.radWindow;
            return oWindow;
        }
Stanimir
Telerik team
 answered on 02 Jan 2014
5 answers
138 views
Tested this on http://demos.telerik.com/aspnet-ajax/editor/examples/default/defaultcs.aspx with IE7:

1. Clear all text (in case this matters, I did CTRL+A followed by backspace)
2. Set font to Arial
3. Type some text
4. Set font size to 20px
5. Font changes back to Times New Roman
Stanimir
Telerik team
 answered on 02 Jan 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?