Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
101 views
I have a grid that I am using custom paging on, the grid has a mastertable and a detailtable.

The grid has a autogenerated footer containing the number of pages, next, previous, etc...

When I expand a row and the detail tables is shown I get the exact same footer on the details table as on the grid. What option do I need for this not to happen.

The footer on the details table does not make sense as it's the information for the grid.

Thanks
Alex
Top achievements
Rank 2
 answered on 15 Feb 2012
2 answers
82 views
Is it possible to set a startup script for a Edit Form template of an RadGrid? If so how? 

I would like to set a javascript function for the ScriptManager.RegisterStartupScript() like I can do for a RadWindow in the Page_Load() event but I'm unable to locate anything on how to do it. I have the need to access specific html table cell styles to change the background color of the Edit Form template.

Any help would be appreciated.
-Richard
Richard
Top achievements
Rank 1
 answered on 14 Feb 2012
2 answers
93 views
Hello,

I have a RadFileExplorer with the standard buttons in the toolbar and also a couple of custom buttons.  I would like to move my custom buttons all the way to the right of my file explorer toolbar.  Is this possible?  Below is my style for the custom buttons:

<

 

 

style type="text/css">

 

 

 

/* Set the desired properties to the custom buttons */

 

 

 

a.adminLoginStyleClass.rtbWrap .rtbText

 

{

 

 

font-size: 12px;

 

 

 

background: url('./images/administration.png') no-repeat left center;

 

}

 

 

 

a.logoffStyleClass.rtbWrap .rtbText

 

{

 

 

font-size: 12px;

 

 

 

background: url('./images/logoff.png') no-repeat left center;

 

}

</

 

 

style>

 


Thanks,
Adam
Adam
Top achievements
Rank 1
 answered on 14 Feb 2012
15 answers
133 views
I'm binding a rad grid with a data table. Whenever I use the filter, I get no results back when I know I should be getting some. Any ideas why? The sorting works fine. Here's my code.

<telerik:RadGrid ID="RadGrid1" runat="server" GridLines="None" AllowPaging="True" AllowFilteringByColumn="true"
    AllowSorting="True" AutoGenerateColumns="false" PageSize="50" Height="410px" Skin="Hay">
    <MasterTableView DataKeyNames="customerId" AutoGenerateColumns="false">
         
        <Columns>
             <telerik:GridBoundColumn DataField="Edit" HeaderText="<span style='visibility: hidden;'>a</span>" SortExpression="Edit"
            UniqueName="Edit" HeaderStyle-Width="40px" AllowFiltering="false" AllowSorting="false">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="name" HeaderText="Name" SortExpression="name"
                UniqueName="name">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="address" HeaderText="Address" SortExpression="address"
                UniqueName="address">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="city" HeaderText="City" SortExpression="city"
                UniqueName="city">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="state" HeaderText="State" SortExpression="state"
            UniqueName="state">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="zip" HeaderText="Zip" SortExpression="zip"
                UniqueName="zip">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="phone" HeaderText="Phone" SortExpression="phone"
                UniqueName="phone">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="fax" HeaderText="Fax" SortExpression="fax"
                UniqueName="fax">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="email" HeaderText="Email" SortExpression="email"
                UniqueName="email">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="additional" HeaderText="Additional Info" SortExpression="additional"
                UniqueName="additional" ItemStyle-Width="200">
            </telerik:GridBoundColumn>
        </Columns>
    </MasterTableView>
    <HeaderStyle Width="120px" />
        <ClientSettings>
            <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True">
            </Scrolling>
        </ClientSettings>
</telerik:RadGrid>

   Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
       If Not (Page.IsPostBack) Then
           RadGrid1.DataSource = myFunctions.customerListTable()
           RadGrid1.DataBind()
       End If
        
   End Sub
 
   Protected Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource
       RadGrid1.DataSource = myFunctions.customerListTable()
   End Sub
 
 
'this function creates a data table for the customer list
   Public Shared Function customerListTable()
 
       Dim sql = "SELECT customerId, name, address, city, state, zip, phone, email, fax, additional FROM Customers" & _
                 " WHERE deleted = 'false' ORDER BY name"
       Dim conn As String = System.Configuration.ConfigurationManager.ConnectionStrings("connection").ToString
 
       Using myConn As New SqlConnection(conn)
 
           'create the table
           Dim myTable As New DataTable
           myTable.Columns.Add("customerId")
           myTable.Columns.Add("edit")
           myTable.Columns.Add("name")
           myTable.Columns.Add("address")
           myTable.Columns.Add("city")
           myTable.Columns.Add("state")
           myTable.Columns.Add("zip")
           myTable.Columns.Add("phone")
           myTable.Columns.Add("email")
           myTable.Columns.Add("fax")
           myTable.Columns.Add("additional")
 
           myConn.Open()
 
           Dim cmd As New SqlCommand(sql, myConn)
           Dim reader = cmd.ExecuteReader
 
 
           While reader.Read()
 
               myTable.Rows.Add(reader("customerId"), "<a href=""../Customers/EditCustomer.aspx?id" & reader("customerId") & """>Edit</a>", _
                                reader("name"), reader("address"), reader("city"), reader("state"), reader("zip"), _
                                reader("phone"), reader("email"), reader("fax"), reader("additional"))
 
           End While 'while reader.read
 
           myConn.Close()
 
           Return myTable
 
       End Using 'using myConn
 
   End Function 'customerListTable












Casey
Top achievements
Rank 1
 answered on 14 Feb 2012
1 answer
221 views
I have a bar chart that I have been able to succesfully databind. But there is one more part of the requirement. They want to be able to click on one of the pie pieces and go to a separate page which gives details of the segment selected.  Currently the pie piece has the number and the label has the category.  How can I on click of the segment determine which category I was on so I can build out the necessary url to redirect to?  Or do I need to do something on the prepaint event?
Richard
Top achievements
Rank 1
 answered on 14 Feb 2012
4 answers
170 views
Hi All,
I have simple calendar with Entity Framework data source. In design, all plays nicely but not after deployment:
- I cannot navigate between Month and Week, nor the popup calendar will work
- I cannot edit an appointment in advanced mode (edit in advanced mode is set to true)

any advice would be helpful.
Jack
Jack
Top achievements
Rank 1
 answered on 14 Feb 2012
12 answers
582 views
Hi,
I am using Hierachy Rad Grid and for editing the record I am using InPlace Editing mode.

When I have Parent Item and child item of some ther node in Edit mode and click on the update button it is giving me the error

Failed to load viewstate.  The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request.  For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request.




Secondly I am not able to have the hierachy grid where in only one row should be editable.

Please help it is urgent.

Kind Regards
Vishal Gupta
Pavlina
Telerik team
 answered on 14 Feb 2012
2 answers
145 views
I'm evaluating RadGrid as a possible replacement for custom grid work that we have been doing. We essentially want to use a few features at the same time but it seems that CustomPaging and DetailTables are not compatible. I keep getting "This method is supported only for pager mode NumericPages Source" errors. Is it possible to have CustomPaging and DetailTables at the same time? If I use NumericPages, detail works. When I hook in our custom paging dropdown, detail no longer works but custom paging works. I hope I'm just missing something!

Thanks!

/Rob

ASPX:

<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPlaceholder.master" AutoEventWireup="true" CodeFile="AccountsTest.aspx.cs" Inherits="Accounts_AccountsTest" %>
 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
 
    <!-- custom head section -->
    <style type="text/css">
            .GridPager_Default INPUT
            {
                border: 1px solid gray;
                height: 14px;
                font-size: 11px;
            }
            .CustomPagerHolder
            {
                float:left;
            }          
            .NumericPagerHolder
            {
                float:right;
            }
            </style>
    <!-- end of custom head section -->
 
     <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
 
        <!-- content start -->
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="DropDownList1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
 
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadGrid ID="RadGrid1" OnPreRender="RadGrid1_PreRender" ShowStatusBar="true"
            runat="server" AutoGenerateColumns="False" PageSize="10" AllowSorting="True" AllowMultiRowSelection="False"
            AllowPaging="True" GridLines="None"
            OnNeedDataSource="RadGrid1_NeedDataSource" OnItemCreated="RadGrid1_ItemCreated">
 
            <MasterTableView DataKeyNames="Account_ID" AllowMultiColumnSorting="True" DataMember="Accounts">
                <DetailTables>
                    <telerik:GridTableView DataKeyNames="Account_ID" Width="100%" DataMember="Detail"
                        runat="server">
                        <ParentTableRelation>
                            <telerik:GridRelationFields DetailKeyField="Account_ID" MasterKeyField="Account_ID" />
                        </ParentTableRelation>
                        <Columns>
                            <telerik:GridBoundColumn SortExpression="Legal_Name" HeaderText="Legal Name" HeaderButtonType="TextButton"
                                DataField="Legal_Name" UniqueName="LegalName">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn SortExpression="Current_Effective_Date" HeaderText="Current Effective Date" HeaderButtonType="TextButton"
                                DataField="Current_Effective_Date" UniqueName="CurrentEffectiveDate" DataFormatString="{0:D}">
                            </telerik:GridBoundColumn>
                        </Columns>
                    </telerik:GridTableView>
                </DetailTables>
                <Columns>
                    <telerik:GridBoundColumn SortExpression="Account_ID" HeaderText="AccountID" HeaderButtonType="TextButton"
                        DataField="Account_ID" UniqueName="AccountID">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="Account_Name" HeaderText="Account Name" HeaderButtonType="TextButton"
                        DataField="Account_Name" UniqueName="AccountName">
                    </telerik:GridBoundColumn>
                </Columns>
 
                <PagerStyle Mode="NumericPages" PageButtonCount="5" AlwaysVisible="true"></PagerStyle>
 
            </MasterTableView>
        </telerik:RadGrid>
 
</asp:Content>


ASPX.CS:

using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
 
using HealthConnect.DAL;
 
using Telerik.Web.UI;
 
 
public partial class Accounts_AccountsTest : HealthConnect.Web.AMS.AMSPage
{
 
    private DataSet getData()
    {
 
        {snip query setup}
 
        DataSet dataSet = db.ExecuteDataSet(dbCommand);
 
        dataSet.Tables[0].TableName = "Accounts";
        dataSet.Tables[1].TableName = "Paging";
        dataSet.Tables[2].TableName = "Detail";
 
        DataColumn[] quotedGridParentColumns = {
                dataSet.Tables["Accounts"].Columns["Account_ID"] };
 
        DataColumn[] planChildColumns = {
                dataSet.Tables["Detail"].Columns["Account_ID"] };
 
        DataRelation dr = new DataRelation("pkPlanDetail",
            quotedGridParentColumns, planChildColumns, false);
 
        dataSet.Relations.Add(dr);
 
        return dataSet;
 
    }
 
    protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
    {
        DataSet dataSet = getData();
        RadGrid1.DataSource = dataSet;
        ViewState["PagingInfo"] = dataSet.Tables[1];
        ViewState["CurrentPage"] = RadGrid1.CurrentPageIndex;
    }
 
     
 
    protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridPagerItem)
        {
        //
        // If this is uncommented detail doesn't work, if this is commented detail works.
        //
            //GridPagerItem item = (GridPagerItem)e.Item;
            //Control numericPager = item.GetNumericPager();
            //item.PagerContentCell.Controls.Clear();
 
            //Panel myPagerPanel = new Panel();
            //myPagerPanel.CssClass = "CustomPagerHolder";
 
            //myPagerPanel.Controls.Add(new MyPager(e.Item.OwnerTableView.PagingManager, e.Item.OwnerTableView, (DataTable)ViewState["PagingInfo"], (int)ViewState["CurrentPage"]));
            //item.PagerContentCell.Controls.Add(myPagerPanel);
 
        }
    }
 
    private class MyPager : Control
    {
        private GridPagingManager paging;
        private GridTableView tableView;
        private DataTable dataTable;
        private int currentPage = 0;
 
        DropDownList dropDownList;
 
        public MyPager(GridPagingManager paging, GridTableView tableView, DataTable dataTable, int currentPage)
        {
            this.paging = paging;
            this.tableView = tableView;
            this.dataTable = dataTable;
            this.currentPage = currentPage;
 
            this.EnsureChildControls();
        }
 
        protected override void CreateChildControls()
        {
            this.Controls.Add(new LiteralControl("Page: "));
 
            dropDownList = new DropDownList();
            dropDownList.ID = "DropDownList1";
 
            dropDownList.DataTextField = "Text";
            dropDownList.DataValueField = "Value";
 
            dropDownList.SelectedIndexChanged += new EventHandler(this.SelectedIndexChanged);
            dropDownList.AutoPostBack = true;
 
            this.Controls.Add(dropDownList);
        }
 
        protected override void OnPreRender(EventArgs e)
        {  
             
            dropDownList.DataSource = this.dataTable;
            dropDownList.DataBind();
 
            // This doesn't work, CurrentPageIndex is always 0
            //dropDownList.SelectedIndex = this.paging.CurrentPageIndex;
            dropDownList.SelectedIndex = currentPage;
 
            base.OnPreRender(e);
        }
 
        private void SelectedIndexChanged(object sender, EventArgs e)
        {
            this.tableView.CurrentPageIndex = dropDownList.SelectedIndex;
            this.tableView.Rebind();
        }
 
    }
 
 
}


Robert
Top achievements
Rank 1
 answered on 14 Feb 2012
3 answers
191 views
Hi,

I have a Rad Window which opens when a button is clicked.
While the page is loading, I want to display a loading image, to notify that something is happening.

Is there a way to display RadAjaxLoadingPanel every time a new rad window is being opened?

Thanks!
 
Pavlina
Telerik team
 answered on 14 Feb 2012
11 answers
151 views
Hi,

I am starting with Grid. I have a DropDownListColumn in Edit mode that I fill with a sql query in code. It show correctly the data that I want, but my data have 2 fields. One is a Number and the second is the Name corresponding to this number. I want to show these two fields in my DropDownList. Here is what I want:

What I currently have and What I want

Thanks
Jocelyn
Top achievements
Rank 1
 answered on 14 Feb 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?