Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
119 views
I am using radgrid with client side binding and virtual scrolling enabled. I am facing an issue when user scrolls and he is in the middle of the page, the grid displays empty elements. I would like to render next page records when user scrolls and display it instead of displaying empty rows. The behavior is same in the demo "http://demos.telerik.com/aspnet-ajax/grid/examples/client/virtualscrollpagingclientbinding/defaultcs.aspx". Please find attach image for more information.
Maria Ilieva
Telerik team
 answered on 21 Feb 2012
1 answer
86 views
I am trying to use the following code from your demo to try and use the windows control:

function openRadWin() {
        radopen("http://www.telerik.com", "RadWindow1");
    }

<telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true">
    <Windows>
        <telerik:RadWindow ID="RadWindow1" runat="server" ShowContentDuringLoad="false" Width="400px"
            Height="400px" Title="Telerik RadWindow" Behaviors="Default">
        </telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager>

<button style="width: 150px; margin-bottom: 3px;" onclick="openRadWin(); return false;">open RadWindow</button>

I get an error, screen capture attached. 

Marin Bratanov
Telerik team
 answered on 21 Feb 2012
1 answer
66 views

Team

 

I am using radalert in my application.

I have a requirement to close radalert box on ESC key press.

I have done some search & found the following link

http://www.telerik.com/community/forums/aspnet-ajax/window/using-radalert-as-server-side-quot-messagebox-quot.aspx

Is it available in DLL V2011.3.1115.40?

Can you please let me know whether it is possible or not & if yes then please let me know How I can implement this?

Marin Bratanov
Telerik team
 answered on 21 Feb 2012
6 answers
125 views
Hi Team,

          May i know can we install different version in same PC. Currently i'm installed Ver. 2010.3 1317 Jan 17, 2011  on my developing pc. It's not integrate  project template in VS2010 professional (not sure express). Ver 2011.3 1115 Nov 16, 2011 is support for that (not sure express). Now i need to develope new project with VS2010. All of my projects are used Ver. 2010.3 1317 Jan 17, 2011 and VS2005. So my question are

1. Can i install new version 2011.3 1115 Nov 16, 2011 on my developing pc?
2. If i can install, what is my old project control it will be change to new version (i don't want to upgrade).
3. Any documentation for that?

Noted: Question for RadControls for ASP.NET AJAX

Regards,
Alex
ALEX
Top achievements
Rank 1
 answered on 21 Feb 2012
2 answers
122 views
I am building a radfilter control from code and added field editors like this:

RadFilterTextFieldEditor textFieldEditor13 = new RadFilterTextFieldEditor();
RadFilter1.FieldEditors.Add(textFieldEditor13);
textFieldEditor13.DisplayName = "Display";
textFieldEditor13.FieldName = "Table.Fieldname";

I need to validate the RadFilterTextFieldEditor above (and any other fields I choose) by having the user enter only integer values.  How does one accomplish this?
Laura
Top achievements
Rank 1
 answered on 21 Feb 2012
9 answers
179 views
Hi Team,

    I'm facing with grid edit mode(InPlace or Popup or EditForm) is always auto fire when i press enter key in search text box. My grid is using OnNeedDataSource property. Problem is become from "RadAjaxManager". If i set setting at ajamanager
<telerik:AjaxSetting AjaxControlID="_btnSearch" EventName="OnClick" >
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1"/>
                        </UpdatedControls>
                    </telerik:AjaxSetting>
RadGrid Edit Form is auto fired. If i remove it, it's ok.

Code Aspx.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server" autocomplete="false">
        <div>
            <telerik:RadScriptManager ID="RadScriptManager" runat="server">
            </telerik:RadScriptManager>
            <!-- content start -->
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="_btnSearch" EventName="OnClick" >
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1"/>
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="RadGrid1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">
            </telerik:RadAjaxLoadingPanel>
            <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="100%" Width="300px" OnLoad="RadAjaxPanel1_Load"
             >
                <table>
                    <tr>
                        <td style="width: 150px;">
                            Search By</td>
                        <td style="width: 5px;">
                            :</td>
                        <td style="width: 150px;">
                            <asp:DropDownList ID="_cboSearchBy" runat="server" Width="150px">
                            </asp:DropDownList>
                        </td>
                        <td style="width: 25px">
                            <asp:TextBox ID="_txtPrefix" runat="server" Width="25px" AutoPostBack="false" AutoCompleteType="none"></asp:TextBox></td>
                        <td style="width: 200px;">
                            <asp:TextBox ID="_txtFind" runat="server" Width="200px" AutoPostBack="false" AutoCompleteType="none"></asp:TextBox></td>
                        <td style="width: 25px">
                            <asp:TextBox ID="_txtSuffix" runat="server" Width="25px" AutoPostBack="false" AutoCompleteType="none"></asp:TextBox></td>
                        <td style="width: 50px">
                            <asp:Button ID="_btnSearch" runat="server" Text="Search" Width="50px" OnClick="_btnSearch_Click" />
                        </td>
                    </tr>
                </table>
            </telerik:RadAjaxPanel>
            <telerik:RadGrid ID="RadGrid1" Width="97%" AllowPaging="True" PageSize="15" runat="server"
                AllowSorting="true" OnNeedDataSource="RadGrid1_NeedDataSource" GridLines="None" OnItemCommand="RadGrid1_ItemCommand">
                <MasterTableView Width="100%" EditMode="" AllowAutomaticUpdates="false">
                    <Columns>
                        <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn"
                            EditText="Edit" HeaderStyle-Width="30" ItemStyle-Width="30" HeaderStyle-HorizontalAlign="center"
                            ItemStyle-HorizontalAlign="center">
                        </telerik:GridEditCommandColumn>
                    </Columns>
                </MasterTableView>
                <PagerStyle Mode="NextPrevAndNumeric" />
                <FilterMenu EnableTheming="True">
                    <CollapseAnimation Duration="200" Type="OutQuint" />
                </FilterMenu>
            </telerik:RadGrid>
            <!-- content end -->
        </div>
    </form>
</body>
</html>

Code Behind

public DataTable GetDataTable(string query)
 {
     String ConnString = ConfigurationManager.ConnectionStrings["NorthwindConnectionString"].ConnectionString;
     SqlConnection conn = new SqlConnection(ConnString);
     SqlDataAdapter adapter = new SqlDataAdapter();
     adapter.SelectCommand = new SqlCommand(query, conn);
 
     DataTable myDataTable = new DataTable();
 
     conn.Open();
     try
     {
         adapter.Fill(myDataTable);
     }
     finally
     {
         conn.Close();
     }
 
     return myDataTable;
 }
 
 protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
 {
     RadGrid1.DataSource = GetDataTable("SELECT CustomerID, CompanyName, ContactName, ContactTitle, Address, PostalCode FROM Customers");
 }
  
 protected void _btnSearch_Click(object sender, EventArgs e)
 {
     if (_txtFind.Text.Trim()!="")
         RadGrid1.DataSource = GetDataTable("SELECT CustomerID, CompanyName, ContactName, ContactTitle, Address, PostalCode FROM Customers where CustomerID='" + _txtFind.Text.Trim() + "'");
     else
         RadGrid1.DataSource = GetDataTable("SELECT CustomerID, CompanyName, ContactName, ContactTitle, Address, PostalCode FROM Customers");
     RadGrid1.Rebind();
 }
  
 protected void RadAjaxPanel1_Load(object sender, EventArgs e)
 {
 }
  
 protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
 {
     //e.Canceled = true;
 }


Anything wrong at my code. . Kindly please reply to me. Sorry! my title is wrong! Problem is "GridEditCommandColumn auto fire".

sample lnk :Sample Code

Regards,
ALEX
Top achievements
Rank 1
 answered on 21 Feb 2012
1 answer
171 views
Hi,

I'm trying to use RadGrid inside RadMultiPage and noticed the problem with selecting grid rows on the client side.

Sometimes the get_selectedItems() method returns the array with valid number of items, but the items are undefined.

Please see the attached code.

Test scenario:

1. Start application, Data1 tab is activated.

2. Click checkbox inside GridClientSelectColumn header to select all rows.

3. Click [Test selected rows] button.

---> Problem: returned items are empty. Close the message box.

4. Click the row with ID=5 to select only this row.

5. Click [Test selected rows] button. 

---> Works fine. Close the message box. 

6: Click checkbox inside GridClientSelectColumn header to select all rows.

7. Click [Test selected rows] button.

---> Works fine. Close the message box. 

8. Click the row with ID=5 to select only this row.

6. Click tab [Data2] to change tab.

7. Click tab [Data1] to return to first tab. Row with ID=5 is selected.

8. Click [Test selected rows] button. 

 ---> Problem: returned item is empty. Close the message box. 

Code:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication4.Default" %>
  
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptBlock ID ="radScriptBlock" runat="server">
        <script type="text/javascript">
  
            function radTabStrip_TabSelecting(sender, args)
            {
                var tab = args.get_tab();
                var multiPage = $find(sender.get_multiPageID());
                var pageView = multiPage.findPageViewByID(tab.get_pageViewID());
  
                if(pageView.get_element())
                    tab.set_postBack(false);
            }
  
            function btnTestSelectedItems1_Clicked(sender, args)
            {
                TestSelectedItems('<%= grdData1.ClientID %>');
            }
  
            function btnTestSelectedItems2_Clicked(sender, args)
            {
                TestSelectedItems('<%= grdData2.ClientID %>');
            }
  
            function btnTestSelectedItems3_Clicked(sender, args)
            {
                TestSelectedItems('<%= grdData3.ClientID %>');
            }
  
            function TestSelectedItems(grd)
            {
                var items = $find(grd).get_selectedItems();
  
                var msg = "Number of selected items: " + items.length + "\n\n";
                for(var i = 0; i < items.length; i++)
                {
                    msg += "Item" + i + ": ";
                    var item = items[i];
                    if(item)
                        msg += "ID = " + item.getDataKeyValue("ID");
                    else
                        msg += "null";
                    msg += "\n"
                }
      
                alert(msg);
  
            }
  
        </script>
    </telerik:RadScriptBlock>
    <telerik:RadScriptManager ID="radScriptManager" runat="server" />
    <telerik:RadAjaxLoadingPanel ID="radLoadingPanel" runat="server" />
    <telerik:RadTabStrip ID="radTabStrip" runat="server" MultiPageID="radMultiPage" SelectedIndex="0" OnClientTabSelecting="radTabStrip_TabSelecting" OnTabClick="radTabStrip_TabClick">
        <Tabs>
            <telerik:RadTab Text="Data1" PageViewID="pagData1">
            </telerik:RadTab>
            <telerik:RadTab Text="Data2" PageViewID="pagData2">
            </telerik:RadTab>
            <telerik:RadTab Text="Data3" PageViewID="pagData3">
            </telerik:RadTab>
        </Tabs>
    </telerik:RadTabStrip>
    <telerik:RadMultiPage ID="radMultiPage" runat="server" SelectedIndex="0">
        <telerik:RadPageView ID="pagData1" runat="server" Visible="false">
            <telerik:RadGrid runat="server" ID="grdData1" AllowPaging="True" AllowSorting="True" AllowMultiRowSelection="True" ClientSettings-EnableRowHoverStyle="true" OnNeedDataSource="grdData_NeedDataSource">
                <MasterTableView ClientDataKeyNames="ID">
                    <Columns>
                        <telerik:GridClientSelectColumn />
                    </Columns>
                </MasterTableView>
                <ClientSettings EnableRowHoverStyle="true" Selecting-AllowRowSelect="true" />
            </telerik:RadGrid>
            <telerik:RadButton ID="btnTestSelectedItems1" runat="server" Text="Test selected rows" AutoPostBack="false" OnClientClicked="btnTestSelectedItems1_Clicked" />
        </telerik:RadPageView>
        <telerik:RadPageView ID="pagData2" runat="server" Visible="false">
            <telerik:RadGrid runat="server" ID="grdData2" AllowPaging="True" AllowSorting="True" AllowMultiRowSelection="True" ClientSettings-EnableRowHoverStyle="true" OnNeedDataSource="grdData_NeedDataSource">
                <MasterTableView ClientDataKeyNames="ID">
                    <Columns>
                        <telerik:GridClientSelectColumn />
                    </Columns>
                </MasterTableView>
                <ClientSettings EnableRowHoverStyle="true" Selecting-AllowRowSelect="true" />
            </telerik:RadGrid>
            <telerik:RadButton ID="btnTestSelectedItems2" runat="server" Text="Test selected rows" AutoPostBack="false" OnClientClicked="btnTestSelectedItems2_Clicked" />
        </telerik:RadPageView>
        <telerik:RadPageView ID="pagData3" runat="server" Visible="false">
            <telerik:RadGrid runat="server" ID="grdData3" AllowPaging="True" AllowSorting="True" AllowMultiRowSelection="True" ClientSettings-EnableRowHoverStyle="true" OnNeedDataSource="grdData_NeedDataSource">
                <MasterTableView ClientDataKeyNames="ID">
                    <Columns>
                        <telerik:GridClientSelectColumn />
                    </Columns>
                </MasterTableView>
                <ClientSettings EnableRowHoverStyle="true" Selecting-AllowRowSelect="true" />
            </telerik:RadGrid>
            <telerik:RadButton ID="btnTestSelectedItems3" runat="server" Text="Test selected rows" AutoPostBack="false" OnClientClicked="btnTestSelectedItems3_Clicked" />
        </telerik:RadPageView>
    </telerik:RadMultiPage>
    <telerik:RadAjaxManager runat="server" ID="radAjaxManager">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="radTabStrip">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="radTabStrip" />
                    <telerik:AjaxUpdatedControl ControlID="radMultiPage" LoadingPanelID="radLoadingPanel" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    </form>
</body>
</html>

using System;
using System.Data;
using System.Web.UI;
using Telerik.Web.UI;
  
namespace WebApplication4
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!this.IsPostBack)
                this.pagData1.Visible = true;
        }
          
        protected void radTabStrip_TabClick(object sender, Telerik.Web.UI.RadTabStripEventArgs e)
        {
            e.Tab.PageView.Visible = true;          
            e.Tab.PageView.Selected = true;
  
            foreach(Control control in e.Tab.PageView.Controls)
                if(control is RadGrid)
                    ((RadGrid)control).Rebind();
        }       
  
        protected void grdData_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            ((RadGrid)sender).DataSource = this.GetDataTable();
        }
  
        protected DataTable GetDataTable()
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("ID", typeof(int));
            dt.Columns.Add("Day", typeof(string));
            dt.Columns.Add("Date", typeof(DateTime));
  
            Random r = new Random();
            for(int i = 0; i < 100; i++)
            {
                DateTime dateTime = DateTime.Now.AddSeconds(-r.Next((int)TimeSpan.FromDays(365).TotalSeconds));
                dt.Rows.Add(i + 1, dateTime.DayOfWeek.ToString(), dateTime);
            }
  
            return dt;
        }
  
    }
}

Tsvetina
Telerik team
 answered on 21 Feb 2012
3 answers
351 views
Hi,

I have a grid with edit column button. What I want is when I am in edit mode and the user click on insert button in the grid, I want the editItem to be canceled and then the insert form to be show. So the user can't have an item in EditMode and being in InsertMode at the same time.

Thanks.
Jocelyn
Top achievements
Rank 1
 answered on 21 Feb 2012
1 answer
57 views
 Hi,

while upgrading to telerik latest verison which requires asp.net 3.5 the rad dock appearance becomes defective.
(pls see attached oic)

best,
elad
                    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel4" runat="server" Skin="Black" />  
    <telerik:RadAjaxPanel ClientEvents-OnRequestStart="OnRequestStart" ID="RadAjaxPanel5" runat="server" >
    <telerik:raddockzone runat="server" id="RadDockZone6" Orientation=Vertical style="float:right;background: white;min-height:50" Width="99%" height="420" Skin="Black">                      
    <telerik:raddock DefaultCommands=None OnCommand="RadDock_Command" EnableDrag=false runat="server" id="RadDock5" style="float:none;" title="" dockmode="Docked" Width="50%" Height="420" EnableAnimation="false" Skin="Black">
    </telerik:raddock>                          
</telerik:raddockzone>
</telerik:RadAjaxPanel>
Slav
Telerik team
 answered on 21 Feb 2012
5 answers
727 views
I have a common function on the server that generates notification messages with RadNotification.  Some of them work correctly, and some of them do not work.  The ones that do not work show nothing - ever.  The notifications are all on the same page, all call the same function to generate the notification, and do not throw an exception afterwards.

Any ideas on why this might be occurring?

private void Notify(string strTitle, bool bsent = true)
{
    if (DevicesRadGrid.SelectedItems.Count > 1)
    {
        if (bsent)
            NotificationText.Text = String.Format("sent {0}", DevicesRadGrid.SelectedItems.Count);
        else
            NotificationText.Text = "fail"
    }
    else
    {
        if (bsent)
        {
            GridDataItem gdi = (GridDataItem)DevicesRadGrid.SelectedItems[0];
            NotificationText.Text = String.Format("sent to {0}, gdi["Client"].Text);
        }
        else
            NotificationText.Text = "fail";
    }
 
    NotificationWindow.Title = strTitle;
    NotificationWindow.Visible = true;
    NotificationWindow.VisibleOnPageLoad = true;
    NotificationWindow.VisibleTitlebar = true;
    NotificationWindow.TitleIcon = ResolveUrl("~/Images/status/statusInfo.png");
}
<telerik:RadNotification ID="NotificationWindow" VisibleOnPageLoad="false" Visible="false"
    Position="TopCenter" KeepOnMouseOver="true" runat="server" ShowCloseButton="true" AutoCloseDelay="5000"
    TitleIcon="~/Images/status/statusInfo.png" Width="300px">
    <NotificationMenu Visible="false"></NotificationMenu>
    <ContentTemplate>
        <asp:Label runat="server" Text="This is some display text" ID="NotificationText"></asp:Label>
    </ContentTemplate>
</telerik:RadNotification>
The RadNotification is just inside the outermost div of the control.
John
Top achievements
Rank 1
 answered on 21 Feb 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?