Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
269 views
Dear Sir/Madam,

I am using a multipageview control with tabstrip.
when i am giving the height of pageview in %it is not being equal to content page height.
and i have 5 pageviews associated with different tabs.
I am calling a web method on a pageview's content user control's pageLoad() in javascript.
but when i am going to select another tab and page goes to postback by firing any serverside event,
this web method is again being called.

Can we stop calling this method on each and every postback.

Does anyone know how to do this ? Please tell me.....
THanks & Regards
Brijendra pandey
Mr. Plinko
Top achievements
Rank 1
 answered on 07 Aug 2009
6 answers
350 views
Hi

I have a number of cases where I have used RadAjaxPanel populated with various controls. If the panel is visible when the page opens the combobox on the panel is enabled, however if the RadAjaxPanel is not visible when the page is loaded, is made visible by the click of a button, the RadComboBox is not enabled and does not respond to a click. Textbox and button controls work fine on the panel.

Hope you can help ... deadline looming :-(

Steve
Steve Todd
Top achievements
Rank 1
 answered on 07 Aug 2009
1 answer
207 views
Hi All. Is it possible to associate a label with RadEditor? Like <label for="mycontrol"> or <asp:Label ID="Label1" runat="server" Text="Label" AssociatedControlID="mycontrol">. I noticed the final rendered HTML of RadEditor is a TextArea.

Daniel
Tervel
Telerik team
 answered on 07 Aug 2009
4 answers
151 views
Hello,

I've the following strange problem:

On a page there is button, which makes a raddock visible when clicked.
Inside the raddock there is some text and a button which closes the raddock when clicked
The controls are ajaxified using Rad Ajax Manager.

OK Scenario: I click on the "show" button, raddock appears. I click on the "close" button, raddock disappears. Only asynchronyous postbacks take place. If i click "show" button once more, raddock reappears correctly.

Fail Scenario: I click on the "show" button, raddock appears. I move raddock on the screen. After that, when I click the 'close" button, full page postback occurs before radddock disappears. If after that, I click "show" button once more, raddock reappears without  title bar and all formatting seems to be lost.

Aspx file:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<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" /> 
        </Scripts> 
    </telerik:RadScriptManager> 
        &nbsp; 
    <div> 
        &nbsp;<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="rdTest"
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="btnShowDock" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
                <telerik:AjaxSetting AjaxControlID="btnShowDock"
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="rdTest" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
    </telerik:RadAjaxManager> 
        <telerik:RadDock ID="rdTest" runat="server" Visible="False" Width="300px"
        <ContentTemplate> 
            Test<br /> 
            <asp:Button ID="btnCloseDock" runat="server" OnClick="btnCloseDock_Click" Text="Close" /> 
            </ContentTemplate></telerik:RadDock> 
 
    </div> 
        <asp:Button ID="btnShowDock" runat="server" OnClick="btnShowDock_Click" Text="Show" /> 
    </form> 
</body> 
</html> 
 

CS file:

using System; 
using System.Web; 
using System.Web.UI; 
using System.Web.UI.WebControls; 
 
using System.Data; 
using System.Configuration; 
using System.Web.Security; 
using System.Web.UI.WebControls.WebParts; 
using System.Web.UI.HtmlControls; 
using Telerik.Web.UI; 
 
public partial class Default : System.Web.UI.Page  
    protected void Page_Load(object sender, EventArgs e) 
    { 
 
    } 
 
 
    protected void btnShowDock_Click(object sender, EventArgs e) 
    { 
        rdTest.Visible = true
        btnShowDock.Enabled = false
    } 
 
    protected void btnCloseDock_Click(object sender, EventArgs e) 
    { 
        rdTest.Visible = false
        btnShowDock.Enabled = true
    } 
 


Pero
Telerik team
 answered on 07 Aug 2009
0 answers
115 views
Hi

I want the same functionality in this demo
http://demos.telerik.com/aspnet-ajax/scheduler/examples/export/defaultcs.aspx.
My problem is how to exclude the control from Ajax here i have included this line
 _ScriptManager.RegisterPostBackControl(imgexport);
even i am geting this error
Sys.webforms.pagerequestmanager parserErrorexception The message received from server canot be parsed common cause for this error are when the response is modified by calls to Response.Write();

My hole code is here

 public class AppTemplate : ITemplate

    {
        private DataTable dtfinalResult = new DataTable();
        private ScriptManager _ScriptManager;
      
        public AppTemplate(DataTable dtResult, ScriptManager ScriptManager)
        {
            dtfinalResult = dtResult.Copy();
            _ScriptManager = ScriptManager;
        }
       
        public void InstantiateIn(Control container)
        {
            ImageButton imgexport = new ImageButton();
            imgexport.CommandName = "Export";
            imgexport.ImageUrl = "/_layouts/images/smallOutlook.gif";
            imgexport.Width = new Unit(20);
            //imgexport.ID="Export"+
            //Exclude from the Ajax
            _ScriptManager.RegisterPostBackControl(imgexport);
            //imgexport.Attributes.Add("onclick", string.Format("realPostBack(this, \"\"); return false;"));
            container.Controls.Add(imgexport);

            Literal subject = new Literal();           
            subject.DataBinding += subject_DataBinding;           
            container.Controls.Add(subject);
            CalendarPlus calendarplus = new CalendarPlus(); 
           
       
        }

        private void subject_DataBinding(object sender, EventArgs e)
        {
            Literal subject = (Literal)sender;
            IDataItemContainer aptContainer = (IDataItemContainer)subject.BindingContainer;

            //Access the appointment object and set its AllowEdit property:
            SchedulerAppointmentContainer aptCont = (SchedulerAppointmentContainer)subject.Parent;
            Appointment app = aptCont.Appointment;
            int APPID = int.Parse(app.ID.ToString());
            app.AllowEdit = false;          
            //app.CssClass = "MyCustomAppointmentStyle";
            DataView dvFinalresult = dtfinalResult.DefaultView;
            dvFinalresult.RowFilter = "FieldID=" + APPID;
            DataTable dtCurrentApp = dvFinalresult.ToTable();                      
            string strSubject = HttpUtility.HtmlEncode((string)DataBinder.Eval(aptContainer.DataItem, "Subject"));
            if (dtCurrentApp.Rows.Count > 0)
            {
               // app.BackColor =System.Drawing.Color.FromName(dtCurrentApp.Rows[0]["color"].ToString());
                string scolor = dtCurrentApp.Rows[0]["color"].ToString();
                app.CssClass = "rsCategoryYellow";
                    if (bool.Parse(dtCurrentApp.Rows[0]["IsEditListItem"].ToString()))
                        subject.Text = "<span id=\"spanID\" style=\"padding-top:4px;padding-left:1px;padding-right:1px;padding-right:3px;margin-top:2px;margin:bottom:2px;height:100%;width:100%\" curDivDate=\"" + dtCurrentApp.Rows[0]["RecurrenceID"].ToString() + "\" title='' onmouseout=\"tooltip.hide();\" onmouseover=\"wsc_showmenu(this); return false\" ><A  HREF=\"javascript:void(window.open('" + dtCurrentApp.Rows[0]["URL"].ToString().Trim() + "'))\">" + strSubject + "</a></span>";
                    else
                        subject.Text = "<span id=\"spanID\" style=\"padding-top:4px;padding-left:1px;padding-right:1px;padding-right:3px;margin-top:2px;margin:bottom:2px;height:100%;width:100%\" curDivDate=\"" + dtCurrentApp.Rows[0]["RecurrenceID"].ToString() + "\" title='' onmouseout=\"tooltip.hide();\" onmouseover=\"wsc_showmenu(this); return false\" >" + strSubject + "</span>";
               
            }
            else
            {
                subject.Text = strSubject;
            }
        }
    }

Regards
Vairamuhu

vairam
Top achievements
Rank 1
 asked on 07 Aug 2009
7 answers
367 views
Repro steps:
1. go to http://demos.telerik.com/aspnet-ajax/splitter/examples/sp_clientsideapi/defaultcs.aspx
2. click on pane 1 and click the pin to dock it.
3. click  the "Toggle 'Pane 1' width 200 / 100 px" link

expected behavior:
pane is resized

actual behavior:
no resize occurs

Thanks,
Chris
Svetlina Anati
Telerik team
 answered on 07 Aug 2009
1 answer
117 views
Hi all i use radgrid with scrolling but when scrolling is on the header (see the link for more info) of grid above the scroll looks different than the content header and on IE8 horizantal scroll is shown
The html markup of radgrid is below
<telerik:RadGrid HeaderStyle-Height="20px" BackColor="#ebebeb" ID="GroupSelectListGrid" AutoGenerateColumns="false" 
                runat="server" GridLines="None"  Width="450px" TableLayout="Fixed" > 
                <MasterTableView CommandItemDisplay="None" Width="425px"  CurrentResetPageIndexAction="SetPageIndexToFirst" 
                    Dir="LTR" Frame="Border" TableLayout="Fixed">                      
                    <Columns> 
                        <telerik:GridBoundColumn DataField="Id" Visible="false" DataType="system.string" 
                            ReadOnly="True" SortExpression="Id" UniqueName="Id">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridTemplateColumn ItemStyle-HorizontalAlign="Center" ItemStyle-Width="20px" HeaderStyle-Width="20px" UniqueName="Selection">  
                            <ItemTemplate> 
                                <asp:CheckBox ID="SelectGroupCheckBox" Width="14" runat="server" AutoPostBack="false" /> 
                            </ItemTemplate> 
                        </telerik:GridTemplateColumn> 
                        <telerik:GridBoundColumn DataField="Name" DataType="system.string" HeaderText="Adı" 
                            ItemStyle-Width="300" HeaderStyle-Width="400" ReadOnly="True" SortExpression="Name" UniqueName="Name">  
                        </telerik:GridBoundColumn> 
                    </Columns> 
                    <NoRecordsTemplate> 
                        Listelenecek Kayıt Bulunmadı</NoRecordsTemplate> 
                </MasterTableView> 
                <ClientSettings> 
                    <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True" FrozenColumnsCount="1">  
                    </Scrolling> 
                </ClientSettings> 
            </telerik:RadGrid> 

so how to disable horizantal scroll and headerstyle for vertical scroll like the content header?
Thanks

Pavlina
Telerik team
 answered on 07 Aug 2009
2 answers
159 views
Hi

I am using declarative binding for a master detail grid. The basic set up is a master table based on a table called Customers with a primary key CustomerID and a detail table based on a database table called Vehicles with primary key Reg and foreign key CustomerID.

The grid has this set up
<telerik:RadGrid DataSourceID="EsDataSource1" ID="RadGrid1" runat="server" AllowAutomaticUpdates="true">  
        <MasterTableView DataSourceID="EsDataSource1" DataKeyNames="CustomerID" AutoGenerateColumns="FALSE">  
     
        <DetailTables> 
<telerik:GridTableView DataSourceID="EsDataSource2" AutoGenerateColumns="false" Name="Vehicles" DataKeyNames="Reg" ShowFooter="false">  
 <ParentTableRelation> 
   <telerik:GridRelationFields DetailKeyField="Reg" MasterKeyField="CustomerID" /> 
</ParentTableRelation> 
 

I am binding this grid using a third party data source. The code to populate the details table basically retrieves all of the records in the Vehicles table and then the RadGrid filters these to show only those belonging to the parent row. Naturally i would prefer to retrieve only those records from the Vehicles table belonging to the parent row in the first place. How can i access the id of the of the current row in the master table in the code behind and pass it to the data source. This is what i have had to do

 Protected Sub RadGrid1_DetailTableDataBind(ByVal source As Object, ByVal e As Telerik.Web.UI.GridDetailTableDataBindEventArgs) Handles RadGrid1.DetailTableDataBind  
        Dim dataItem As GridDataItem = CType(e.DetailTableView.ParentItem, GridDataItem)  
        customerID = dataItem.GetDataKeyValue("CustomerID").ToString()  <======set foreign key in page variable  
 
    End Sub  
 
 
 
 
DATA SOURCE FOR THE DETAILS TABLE  
   Protected Sub EsDataSource2_esSelect(ByVal sender As Object, ByVal e As EntitySpaces.Web.esDataSourceSelectEventArgs) Handles EsDataSource2.esSelect  
        
        Dim coll As New VehiclesCollection  
        Dim query As New VehiclesQuery  
        query.Where(query.CustomerID = customerID)  <==== page variable  
        coll.Load(query)  
        e.Collection = coll 
    End Sub 

I am using the data source rather than just binding programmatically because the grid uses an edit form template and the data source will perform the updates automatically for me.

thanks
andieje
Top achievements
Rank 1
 answered on 07 Aug 2009
1 answer
106 views
We've been suffering for some time without a library like Telerik to create what are, more or less, CRUD forms. Every one is a little different. The special need of this particular page, for which we're evaluating Telerik, is simply that there are 2 levels: there are many A's (maybe a few dozen new ones a year), each of which have many B's (maybe dozens to hundreds). So, it's like a list of lists.

We've created a prototype with a RadGrid of A's, but are stumped on how to modify the edit box to show anything more than just the columns present in the RadGrid of A's. We were hoping to put another RadGrid (of B's) in the edit box. How should we approach this?

Alan

Yavor
Telerik team
 answered on 07 Aug 2009
11 answers
541 views
Hi all,
I want to set a row in edit mode when clicking on it and the clicked cell must get the focus.

i get  this working when using a setTimeOut but i don't like this solution.
ex:
ClientSettings.ClientEvents.OnRowCreated = @" 
    function RowCreatedEventHandler(sender, eventArgs) 
    { 
        var dataItem = eventArgs.get_gridDataItem(); 
        var lastCellFound = false
        var cell;             
        for(var i = 0; i < dataItem.get_element().cells.length; i++) 
        { 
            cell = dataItem.get_element().cells[i]; 
            cell.onclick = function() 
            { 
                if(selectedRow != this.parentNode.rowIndex-1) 
                { 
                    selectedCol = this.cellIndex; 
                    selectedRow = this.parentNode.rowIndex-1; 
                    setTimeout(function() 
                    { 
                        $find(""" + MasterTableView.ClientID + @""").get_dataItems()[selectedRow].get_element().cells[selectedCol].childNodes[0].focus(); 
                    }, 1000); 
                    $find(""" + MasterTableView.ClientID + @""").editItem(selectedRow); 
                    event.cancelBubble=true
                    return false; 
                 } 
 
          }  
    } 
}"; 


I tried to use OnResponseEnd of the ajaxmanager to know when the editItem call ended and then set the focus but this does'n work.
ex:
ClientSettings.ClientEvents.OnRowCreated = @" 
                    function RowCreatedEventHandler(sender, eventArgs) 
                    { 
                        var dataItem = eventArgs.get_gridDataItem(); 
                        var lastCellFound = false
                        var cell;             
                        for(var i = 0; i < dataItem.get_element().cells.length; i++) 
                        { 
                            cell = dataItem.get_element().cells[i]; 
                            cell.onclick = function() 
                            { 
                                if(selectedRow != this.parentNode.rowIndex-1) 
                                { 
                                    selectedCol = this.cellIndex; 
                                    selectedRow = this.parentNode.rowIndex-1; 
                                    var mgr = $find(""" + RadAjaxManager.GetCurrent(Page).ClientID + @"""); 
                                    mgr.OnResponseEnd = function(sender, eventArgs) 
                                        { 
                                            $find(""" + MasterTableView.ClientID + @""").get_dataItems()[selectedRow].get_element().cells[selectedCol].childNodes[0].focus(); 
                                        } 
                                    $find(""" + MasterTableView.ClientID + @""").editItem(editedRow); 
                                    event.cancelBubble=true
                                    return false; 
                                } 
 
                            }  
                        } 
                    }"; 

Can somone help me with this?
Thx in advance.


Veli
Telerik team
 answered on 07 Aug 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?