Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
90 views
Hello everyone,
I have a RadTextbox and a RadButton in NestedViewTemplate, How can I get RadTextbox's value when I click RadButton?
My code's below:
<MasterTableView  AutoGenerateColumns="false" GridLines="None" >
      <NestedViewTemplate>
          <table>
            <tr>
                <td><telerik:RadTextBox ID="RadTextbox1" runat="server">
                        </telerik:RadTextBox>
                </td>
            </tr>
            <tr>
                <td><telerik:RadButton ID="RadButton1" Text="Confirm" runat="server"
                                                      OnClick="btn_Click">
                        </telerik:RadButton>
                </td>
            </tr>
         </table>
     </NestedViewTemplate>
</MasterTableView>
 Thanks,
    -Tan-



Tan
Top achievements
Rank 1
 answered on 18 Feb 2013
5 answers
144 views
Hi,

I don't understand why the designer became so slow after adding a control.
I'm working with VS 2010 and Windows Seven 64 bit on a Icore 7-960 and 12Go RAM. (and i Have thes latest release of telerik RadAjax ASP)
Eg. I put 2 RadTab controls like bellow and my designer is very very slow (If I add a Radgrid it become more slow)


<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
  
<!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>
    <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <%--Needed for JavaScript IntelliSense in VS2010--%>
            <%--For VS2008 replace RadScriptManager with ScriptManager--%>
            <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">
        //Put your JavaScript code here.
    </script>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
   
    <telerik:RadSkinManager ID="RadSkinManager1" Runat="server" Skin="WebBlue">
    </telerik:RadSkinManager>
  
    <telerik:RadTabStrip ID="RadTabStrip1" runat="server" Align="Justify" 
        SelectedIndex="12" Width="655px">
        <Tabs>
            <telerik:RadTab runat="server" Owner="RadTabStrip1" Text="BERIM">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Owner="RadTabStrip1" Text="AGI2D">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Owner="RadTabStrip1" Text="LOGHABAT">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Owner="RadTabStrip1" Text="ORGECO">
            </telerik:RadTab>
            <telerik:RadTab runat="server" IsBreak="True" Owner="RadTabStrip1" Text="SOREC">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Owner="RadTabStrip1" Text="Bastia">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Owner="RadTabStrip1" Text="Douai">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Owner="RadTabStrip1" Text="Martigues">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Owner="RadTabStrip1" 
                Text="Montpellier">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Owner="RadTabStrip1" Text="Nantes">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Owner="RadTabStrip1" Text="Pantin">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Owner="RadTabStrip1" Text="Toulouse">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Owner="RadTabStrip1" Text="Venissieux" 
                Selected="True">
            </telerik:RadTab>
        </Tabs>
    </telerik:RadTabStrip>
    <telerik:RadTabStrip ID="RadTabStrip2" runat="server" Align="Justify" 
        SelectedIndex="23" Width="655px">
        <Tabs>
            <telerik:RadTab runat="server" Text="*" Owner="RadTabStrip2">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Text="A" Owner="RadTabStrip2">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Text="B" Owner="RadTabStrip2">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Text="C" Owner="RadTabStrip2">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Text="D" Owner="RadTabStrip2">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Text="E" Owner="RadTabStrip2">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Text="F" Owner="RadTabStrip2">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Selected="True" Text="G" Owner="RadTabStrip2">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Text="H" Owner="RadTabStrip2">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Text="I" Owner="RadTabStrip2">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Text="J" Owner="RadTabStrip2">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Text="K" Owner="RadTabStrip2">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Text="L" Owner="RadTabStrip2">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Text="M" Owner="RadTabStrip2">
            </telerik:RadTab>
            <telerik:RadTab runat="server" IsBreak="True" Text="N" Owner="RadTabStrip2">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Text="O" Owner="RadTabStrip2">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Text="P" Owner="RadTabStrip2">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Text="Q" Owner="RadTabStrip2">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Text="R" Owner="RadTabStrip2">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Text="S" Owner="RadTabStrip2">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Text="T" Owner="RadTabStrip2">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Text="U" Owner="RadTabStrip2">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Text="V" Owner="RadTabStrip2">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Text="W" Owner="RadTabStrip2">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Text="X" Owner="RadTabStrip2">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Text="Y" Owner="RadTabStrip2">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Text="Z" Owner="RadTabStrip2">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Text="Num. Spéciaux" Owner="RadTabStrip2">
            </telerik:RadTab>
        </Tabs>
    </telerik:RadTabStrip>
    </form>
</body>
</html>

I made the test on 2 PC. This is alway so slow.

Can you made the test and explain to me wath is wrong, and give a solution ?

Thanks
Ian
Top achievements
Rank 1
 answered on 18 Feb 2013
7 answers
166 views
Colleagues,

Who knows if there is a lower limit for RowHeight parameter in the RadScheduler?

I noticed that if I set RowHeight to a value smaller the 16px, the appointment rectangles start arbitrary change their sizes after I resize them with a mouse. 

For example, I can choose an appointment for 1:00PM-2:00PM and enlarge it to 1:00PM-3:00PM dragging its bottom side with a mouse. After I release the mouse its bottom side jumps back to approximately 2:45PM, while the END TIME of the appointment still stands 3:00PM.

As I said, this behaviour is noticed only when RowHeight is set relatively small...

- Stepan.
Plamen
Telerik team
 answered on 18 Feb 2013
2 answers
78 views
I've got a web page in my system that pops up when I double-click on a RadGrid row.   This has been working fine.

This is based mainly on these examples:  
http://www.telerik.com/community/forums/aspnet-ajax/window/customization-of-radwindow-through-clientside-javascript.aspx
and here:
http://demos.telerik.com/aspnet-ajax/window/examples/radopen/defaultvb.aspx

The JavaScript is called by the RadGrid in the client events, OnRowDblClick.  

Now, what I'd like is to have a similar screen called by a button in the grid row.  (For test purposes I am calling the same screen and JavaScript function.)  To this end I have added a GridButtonColumn, ImageButton type, to the grid.  In the C# code, in the ItemDataBound event, I have added the following code.  
if (e.Item is GridDataItem)
 {
    GridDataItem item = (GridDataItem)e.Item;
    ((ImageButton)item["PrintDoc"].Controls[0]).Attributes.Add("onclick", "printDoc(this," + item["Id"].Text + ");");                              
 } 

The JavaScript code is as follows:

  function printDoc(sender, Id) {
       var oWnd = window.radopen("PrintDoc.aspx?Id=" + Id, "Print Doc");
       oWnd.SetWidth(600);
       oWnd.SetHeight(400);
       oWnd.set_behaviors(Telerik.Web.UI.WindowBehaviors.Move +
                          Telerik.Web.UI.WindowBehaviors.Close +
                          Telerik.Web.UI.WindowBehaviors.Resize); 
       oWnd.show();
 }

The Javascript code is getting called and receiving the correct data.  The problem is that when called from the button, the window is just flickering on the screen for an instant before vanishing.  

Suggestions?
Boris
Top achievements
Rank 1
 answered on 18 Feb 2013
2 answers
116 views
I've already successfully implemented a ToolTipManager popup on a RadGrid, based on your examples using the RadToolTipManager and a custom control.  (And the OnAjaxUpdate and OnClientHide events.)

The problem is that my current version pops up on the entire row.  

I need to limit the popup to a single column.

Is this possible?  Any way to detect which cell the mouse is over?

Boris
Top achievements
Rank 1
 answered on 18 Feb 2013
2 answers
333 views
I know what the problem is but do not know how to fix it as I have never run into doin git this way.  i have a global boolean variable Fillgrid that is set to true when they click on a view button that allows the grid to be show and rebind.  But when i click on the edit link to show the inline edit form, the grid disappears but if I click on the view button agian it appears with the inline editing open.  It has to do with the edit button but dont know where to put the show fillgrid boolean statement.
<telerik:GridEditCommandColumn UniqueName="UpdateCommandName" ButtonType="ImageButton" EditImageUrl="../Images/edit_icon.png"></telerik:GridEditCommandColumn>
 
 
<EditFormSettings EditFormType="Template" FormMainTableStyle-HorizontalAlign="Center" FormCaptionStyle-BorderColor="Black" FormMainTableStyle-BackColor="#B0C4DE">
 
<FormTemplate>
     <table class="GridEdittemplate">

 

Protected Sub myRadGrid_NeedDataSource(sender As Object, e As GridNeedDataSourceEventArgs) Handles myRadGrid.NeedDataSource
       Dim UserLogon As String = Split(Current.User.Identity.Name, "\")(1)
       Dim sqlWhere As String = ""
       Dim name As String = HFID.Value.ToString
       Dim Counter As Integer = 0
 
       If FillGrid = True Then
             FILL radgrid with sql statement
            myRadGrid.DataSource = getdata(sql)
        end if

So my problem is when I click on teh edit button it blanks out the grid and it becomes invisible and it has to do with posting back and showing the edit form but how can i pass in teh fillgrid boolean statement.

Andrey
Telerik team
 answered on 18 Feb 2013
2 answers
285 views
Hi,

I am using RadPanelBar, My requirement is to  have some label in header and it can fill text by codebehind and the header  should be collapsible that other content can show after expanded.

There is an issue with arrow icon is not displaying if I take HeaderTemplate otherwise displaying fine.

I have done with collapsible/Expanded that is working fine to me.

Please help me how can I show arrow icon on header if i have some server controls like labels on header.

Please see the attached screen. I want arrow icon in second panel bar.

Please have a look on my attached code that I have create for sample.


Thanks.

---------------------

<telerik:RadPanelBar ID="RadPanelBar1" runat="server" Width="104.1%" ExpandAnimation-Type="InCubic">
        <Items>
            <telerik:RadPanelItem Text="Search" Enabled="true" runat="server" Expanded="false" Font-Bold="true" Width="100%">
                <Items>
                    <telerik:RadPanelItem Value="AdvanceSearch">
                        <ItemTemplate>
                            <table width="100%" border="0" cellspacing="1" cellpadding="1">
                                <tr>
                                    <td style="width: 11.1%" >
                                        Test
                                    </td>
                                </tr>
                            </table>
                        </ItemTemplate>
                    </telerik:RadPanelItem>
                </Items>
            </telerik:RadPanelItem>
        </Items>
    </telerik:RadPanelBar>
    <br />
    <telerik:RadPanelBar ID="RadPanelBar2" runat="server" Width="100%" ExpandAnimation-Type="InCubic">
        <Items>
            <telerik:RadPanelItem Enabled="true" runat="server" Expanded="false" Font-Bold="true" Width="100%">
                <HeaderTemplate>
                    <table width="100%" border="0">
                        <tr>
                            <td style="width: 10%">
                                <asp:Label ID="Lb1" Text="T2456" runat="server"></asp:Label>
                            </td>
                            <td style="width: 10%">
                                <asp:Label ID="Lb2" Text="Jack" runat="server"></asp:Label>
                            </td>
                            <td align="right" style="width: 10%">
                                <asp:Label ID="LbAge" Text="Age:" runat="server"></asp:Label>
                            </td>
                            <td align="left">
                                <asp:Label ID="Lb3" Text="46" runat="server"></asp:Label>
                            </td>
                        </tr>
                    </table>
                </HeaderTemplate>
                <Items>
                    <telerik:RadPanelItem Value="Preview">
                        <ItemTemplate>
                            <table>
                                <tr>
                                    <td style="width: 10%">
                                        <asp:Label ID="Lb3" Text="User name" runat="server"></asp:Label>
                                    </td>
                                    <td align="left">
                                        <asp:TextBox runat="server" ID="Txt1">
                                        </asp:TextBox>
                                    </td>
                                </tr>
                            </table>
                        </ItemTemplate>
                    </telerik:RadPanelItem>
                </Items>
            </telerik:RadPanelItem>
        </Items>
    </telerik:RadPanelBar>
Jaichand
Top achievements
Rank 1
 answered on 18 Feb 2013
2 answers
143 views
Hi,
Is it possible to create an AutoCompleteBox with a detailed drop-down? I have attached a sample one I found where all the details associated with a person's name is listed within the drop-down.

Thank you,
Henry.
Henry
Top achievements
Rank 1
 answered on 18 Feb 2013
2 answers
115 views
I have a RadGrid and when I try to insert, update, or delete, the event fires and it moves into the code behind, but it stops executing the code before actually performing the action and reloads the page. My code behind is below. _config.Values is a DataTable. Filtering and sorting work fine.

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Linq.Dynamic;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Telerik.Web.UI;
 
namespace WeightWatchers.EnvironmentConfig
{
    public partial class _Default : System.Web.UI.Page
    {
        private WeightWatchers.EnvironmentConfig.EnvironmentConfig _config;
        protected void Page_Load(object sender, EventArgs e)
        {
             
        }
 
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
 
            RadGrid1.NeedDataSource += (s, a) =>
            {
                _config = new EnvironmentConfig.EnvironmentConfig(MapPath(@".\App_Data\environment.config.csv"));
                if (RadGrid1.MasterTableView.SortExpressions.Count > 0)
                    RadGrid1.DataSource = GetEntities(RadGrid1.MasterTableView.FilterExpression,
                       RadGrid1.MasterTableView.SortExpressions[0].FieldName + " " + RadGrid1.MasterTableView.SortExpressions[0].SortOrderAsString());
                else
                    RadGrid1.DataSource = GetEntities(RadGrid1.MasterTableView.FilterExpression, "");
            };
 
            RadGrid1.UpdateCommand += (s, a) =>
            {
                //Get the GridEditableItem of the RadGrid    
                GridEditableItem editedItem = a.Item as GridEditableItem;
                string Name = editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["Name"].ToString();
                try
                {
                    if (this.Validate(Name, true, editedItem))
                    {
                        this.UpdateAddRow(editedItem, true);
                        RadGrid1.DataSource = null;
                    }
                }
                catch (Exception ex)
                {
                    RadGrid1.Controls.Add(new LiteralControl("Unable to update Shippers. Reason: " + ex.Message));
                    a.Canceled = true;
                }
 
            };
 
            RadGrid1.InsertCommand += (s, a) =>
            {
                //Get the GridEditableItem of the RadGrid    
                GridEditableItem newItem = a.Item as GridEditableItem;
                string Name = (newItem["Name"].Controls[0] as TextBox).Text;
 
                try
                {
                    if (this.Validate(Name, false, newItem))
                    {
                        if (this.Validate(Name, true, newItem))
                        {
                            this.UpdateAddRow(newItem, false);
                            RadGrid1.DataSource = null;
                        }
                    }
                }
                catch (Exception ex)
                {
                    RadGrid1.Controls.Add(new LiteralControl("Unable to insert Shipper. Reason: " + ex.Message));
                    a.Canceled = true;
                }
 
            };
 
             
            RadGrid1.DeleteCommand += (s, a) =>
            {
                //Get the GridDataItem of the RadGrid    
                GridDataItem item = (GridDataItem)a.Item;
 
                //Get the primary key value using the DataKeyValue.    
                string name = item.OwnerTableView.DataKeyValues[item.ItemIndex]["Name"].ToString();
                try
                {
                    _config.Values.Rows.Remove(_config.Values.AsEnumerable()
                      .AsQueryable()
                      .Where(String.Format("(it[\"Name\"].ToString().ToUpper().Contains(\"{0}\".ToUpper()))", name))
                      .CopyToDataTable().Rows[0]);
                    RadGrid1.DataSource = null;
 
                }
                catch (Exception ex)
                {
                    RadGrid1.Controls.Add(new LiteralControl("Unable to delete Entry. Reason: " + ex.Message));
                    a.Canceled = true;
                }
         
            };
        }
 
        protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
        {
            if (e.CommandName == "Filter" || e.CommandName == "Sort")
            {
                RadGrid1.DataSource = null;
            }
        }
 
        private DataTable GetEntities(string filterExpression, string sortExpression)
        {
            foreach (GridColumn col in RadGrid1.Columns)
            {
                col.AutoPostBackOnFilter = true;
            }
            var dt = _config.Values;
            if (!String.IsNullOrEmpty(filterExpression))
            {
                IQueryable<DataRow> rows = dt.AsEnumerable()
                 .AsQueryable()
                 .Where(filterExpression);
                 if (rows.Count<DataRow>() > 0)
                 {
                    dt = rows.CopyToDataTable();
                 }
                 else
                 {
                     dt.Clear();
                 }
            }
            if (!String.IsNullOrEmpty(sortExpression))
            {
                IQueryable<DataRow> rows = dt.AsEnumerable()
                 .AsQueryable()
                 .Where(sortExpression);
                if (rows.Count<DataRow>() > 0)
                {
                    dt = rows.CopyToDataTable();
                }
                else
                {
                    dt.Clear();
                }
            }
            return dt;
        }
 
        public void UpdateAddRow(GridEditableItem editedItem, bool update)
        {
            String[] cells = new String[_config.Values.Columns.Count];
            for (int i = 1; i < _config.Values.Columns.Count; i++)
            {
                cells[i]= (editedItem[_config.Values.Columns[i].ColumnName].Controls[0] as TextBox).Text;
            }
             
            if (update)
            {
                string Name = editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["Name"].ToString();
 
                DataRow[] rows = _config.Values.Select(String.Format("Name = '{0}'", Name));
                var row = rows[0];
                for (int i = 1; i < _config.Values.Columns.Count; i++)
                {
                    row[_config.Values.Columns[i].ColumnName] = cells[i];
                }
 
            }
            else
            {
                cells[0] = (editedItem["Name"].Controls[0] as TextBox).Text;
                var row = _config.Values.NewRow();
                for (int i = 1; i < _config.Values.Columns.Count; i++)
                {
                    row[_config.Values.Columns[i].ColumnName] = cells[i];
                }
 
                _config.Values.Rows.Add(row);
            }
            RadGrid1.DataSource = null;
        }
 
        public bool Validate(string name, bool placeholder, GridEditableItem editedItem)
        {
            bool valid = true;
            //if (placeholder)
            //{
            //    string pattern = "";
            //    foreach (TableCell item in editedItem.Cells)
            //    {
            //        if (System.Text.RegularExpressions.Regex.IsMatch(item.Text, pattern, System.Text.RegularExpressions.RegexOptions.IgnoreCase))
            //        {
            //            if (!item.ID.Equals("Name"))
            //            {
            //                valid = _config.Validate(item.Text, placeholder);
            //            }
            //        }
            //    }
            //}
            //else
            //{
            //    valid = _config.Validate(name, placeholder);
            //}
            return valid;
        }
    }
}
Angel Petrov
Telerik team
 answered on 18 Feb 2013
1 answer
57 views
Hi ,
I am facing problem while click on header of Radgrid.
I am having a page which includes two drop down box and Radgrid control which is filled from code behind by using

DataBind() and rebind() methods which works properly fine. While filling with data i refine the no. of rows based on filter condtion , provide RadGrid1.MasterTableView.FilterExpression and rebind the grid.

It works properly in web browser when i click on any column for sort but when i check this scenario in mobile browser it completely by pass the complete filter contion and reload the grid with all data and make drop down empty .

can anybody help to get rid from this error on mobile browser. 

Marin
Telerik team
 answered on 18 Feb 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
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?