Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
193 views
Hi,

How can i show last panel item bottom of the screen?i trying panel height 100% and its not working.Example if i have 3 radpanel item and if i selected first one then i want that second and third panel items going bottom of the screen?
Kamen Bundev
Telerik team
 answered on 18 Dec 2009
2 answers
160 views
Hello,

I have a grid, and a combobox.
When multiple row are selected in the grid, I test if the values for a certain column are equals, if so, I found this value in the combobox, if not, I set an empty message to the combobox.

Suppose there's 3 rows in my grid :
row1 : a ; g1
row2 : b ; g1
row3 : c ; g3

because g1 != g3, combobox is setting to the empty message ("choose a group").

Now, user can choose the group to put a, b and c.  I need to detect the ClientSelectedIndexChanged event. But it seems that passing from empty message to an element of my combobox doesn't raise the event.

Below, the code I used.

 <tlk:RadAjaxPanel ID="AjaxPnl" runat="server" LoadingPanelID="oAjaxPanel"  
        OnAjaxRequest="AjaxPnlRequest"
<tlk:RadComboBox ID="oModCombo" runat="server" MarkFirstMatch="true" style="margin-top:5px; float:right; margin-right:5px;"  
            EmptyMessage="Choisir un groupe..." AllowCustomText="true" 
            OnClientSelectedIndexChanged="oGroupModSelectedIndexChanged"  
            OnClientTextChange="oGroupModTextChange" /> 
         
        <tlk:RadGrid ID="modgrid" runat="server" OnNeedDataSource="modgrid_OnNeedDataSource"  
            Height="215" Width="95%" style="margin-top:30px;margin-left:5px;" 
            AutoGenerateColumns="false" AllowMultiRowSelection="true" > 
            <MasterTableView > 
            <Columns> 
            <tlk:GridBoundColumn DataField="id"  Visible="false"/> 
            <tlk:GridBoundColumn AllowSorting="true" HeaderText="Modalités" DataField="mod"
            </tlk:GridBoundColumn> 
            <tlk:GridBoundColumn AllowSorting="true" HeaderText="Status" DataField="status">   
            <HeaderStyle Width="150" /> 
            </tlk:GridBoundColumn>             
            <tlk:GridBoundColumn DataField="gpvalue" ReadOnly="true" Display="false"
            <HeaderStyle Width="0" /> 
            <ItemStyle  ForeColor="White" Width="0"/> 
            </tlk:GridBoundColumn> 
            </Columns> 
            </MasterTableView> 
            <ClientSettings  > 
            <Scrolling AllowScroll="true" UseStaticHeaders="true" /> 
            <Selecting AllowRowSelect="true" EnableDragToSelectRows="true" /> 
            <ClientEvents OnRowSelected="ModalitiesSelected" OnRowDeselected="ModalitiesDeselected" /> 
            </ClientSettings> 
        </tlk:RadGrid> 
    </tlk:RadAjaxPanel> 
         
        <tlk:RadCodeBlock runat="server" ID="rcb2"
 
        <script type="text/javascript" language="javascript">        
        function AjaxPnlRequest(requestName) 
        { 
             var manager = <%= AjaxPnl.ClientID %>;  
            manager.ajaxRequest(requestName); 
        } 
        </script>         
         </tlk:RadCodeBlock> 
var bNotPostback = true
        var bAllEquals = true
        var sValue = null
        var iHandled = -1; 
        var bMade = false
        function ModalitiesSelected() { 
            var grid = $find("<%=modgrid.ClientID %>"); 
            var MasterTable = grid.get_masterTableView(); 
            var selectedRows = MasterTable.get_selectedItems(); 
            //alert(iHandled + " " + selectedRows.length); 
            if (selectedRows.length == 1) { 
                bAllEquals = true
                iHandled = 1;bMade = false
                sValue = MasterTable.getCellByColumnUniqueName(selectedRows[0], "gpvalue").innerHTML
            } 
            else { 
                var row = selectedRows[selectedRows.length - 1]; 
                bMade = false
                var cell = MasterTable.getCellByColumnUniqueName(row, "gpvalue"); 
                bAllEquals = (sValue == cell.innerHTML); 
                iHandled += 1; 
            } 
            window.setTimeout(function() { setCombo(); }, 500); 
        } 
 
        function ModalitiesDeselected() { 
            var grid = $find("<%=modgrid.ClientID %>"); 
            var MasterTable = grid.get_masterTableView(); 
            var selectedRows = MasterTable.get_selectedItems(); 
            iHandled = selectedRows.length; 
            if (iHandled > 0) { 
                bMade = false
                bAllEquals = true
                sValue = MasterTable.getCellByColumnUniqueName(selectedRows[0], "gpvalue").innerHTML
                var i = 1; 
                while ((i < iHandled) && bAllEquals) { 
                    var cell = MasterTable.getCellByColumnUniqueName(selectedRows[i], "gpvalue"); 
                    bAllEquals = (sValue == cell.innerHTML); 
                    i++; 
                } 
                setCombo(); 
            } 
            else { 
                var oCombo = $find("<%=oModCombo.ClientID %>"); 
                oCombo.clearSelection(); 
                oCombo.disable(); 
                oCombo.set_emptyMessage(oCombo.get_emptyMessage());  
            } 
        } 
 
        function setCombo() { 
            var grid = $find("<%=modgrid.ClientID %>"); 
            var MasterTable = grid.get_masterTableView(); 
            var selectedRows = MasterTable.get_selectedItems(); 
            if ((iHandled == selectedRows.length) && (bMade == false)) { 
                //alert("setCombo " + iHandled + " " + selectedRows.length); 
                bNotPostback = true;bMade = true
                var oCombo = $find("<%=oModCombo.ClientID %>"); 
                oCombo.clearSelection(); 
                oCombo.enable(); 
                if (bAllEquals) { 
                    var item = oCombo.findItemByValue(sValue); 
                    if (item) item.select(); 
                } 
                else { 
                    oCombo.set_emptyMessage(oCombo.get_emptyMessage()); 
                    //oCombo.set_text(oCombo.get_emptyMessage()); 
                } 
            } 
        } 
         
        
        function oGroupModSelectedIndexChanged(sender, args) { 
            if (bNotPostback) bNotPostback = false
            else { 
                var sArg = "oModCombo;"
                var item = args.get_item(); 
                sArg += item.get_text() + ";" + item.get_value(); 
                AjaxPnlRequest(sArg); 
            } 
        } 
 
        function oGroupModTextChange(sender, args) { 
            var sArg = "oModCombo;"
            sArg += sender.get_text() + "; "
            AjaxPnlRequest(sArg); 
        } 
         


Thanks for your help.
Aurore

Aurore
Top achievements
Rank 1
 answered on 18 Dec 2009
1 answer
138 views
Dear experts.
I need to expand the insert and edit template of the Scheduler and wanted to test the tutorial given by this page: http://www.telerik.com/help/aspnet-ajax/schedule_appearancetemplates.html

Altough I followed the example point by point, when I run it and try to go into the "Advanced" insert or edit mode I get the error: 
Cannot find the control with ID TitleTextBox which is associated with Label Label1.

I noticed that the asked for TextBox was situaed in the InlineInsertTemplate and the InlineEditTemplate, but I am not sure if this has got anything to do with the solution.

Please advise me on what I have done wrong.

One last request:
How can I copy the current default edit/insert template in order to integrate look and functionality (of e.g. reccurence) in a custom advanced edit/insert template?

Looking forward to your replies.
Peter
Telerik team
 answered on 18 Dec 2009
1 answer
119 views
When i change the page size on the grid, the data refreshes, but sometimes, not always, the grid comes back with some empty rows. So if the page size is 12, I might see 3 actual rows and 8 empty rows. Any ideas why?

I suspect this is something to do with ajax loading not being able to finish in time or something like that. Thanks
tom
Radoslav
Telerik team
 answered on 18 Dec 2009
2 answers
271 views
Hi ,
I have used a radgrid for selecting and displaying the data from SQL DB. I got stuck up at this point with the below problem:

1) I am retrieving the data from DB using selectcommand in .aspx page.
<asp:SqlDataSource ID="SqlDataSource1" runat="server"   
            ConnectionString="<%$ ConnectionStrings:TestMangerConnectionString %>"   
            SelectCommand="SELECT Component_Table.Component as Component,Bug_Count_Bucket_Wise.E2ECount_Total as Total,Bug_Count_Bucket_Wise.E2ECount_Active as Active,Bug_Count_Bucket_Wise.E2ECount_Closed as Fixed,Bug_Count_Bucket_Wise.E2ECount_Resolved as Resolved,Track_Table.ETA as ETA,Track_Table.Comments as Comments
FROM Bug_Count_Bucket_Wise,Component_Table,Track_Table,Type_of_Bucket,TL_Details,TM_Details
WHERE 
Component_Table.CompID=Bug_Count_Bucket_Wise.CompID  
AND Bug_Count_Bucket_Wise.CompID=Track_Table.CompID
AND TM_Details.TMID = TL_Details.TMID 
AND TL_Details.ID=Component_Table.TLID
AND Type_of_Bucket.ID = Track_Table.BucketID
AND TM_Details.TMAlias=@TM
AND Type_of_Bucket.Type= 'AHI'"   
              
            UpdateCommand="UPDATE Track_Table 
SET Track_Table.ETA = @ETA,Track_Table.Comments= @comments,Track_Table.Modified_Date=  @CurrentTime,Track_Table.Edit_Alias=@LoginUser
FROM Bug_Count_Bucket_Wise,Component_Table,Track_Table,Type_of_Bucket,TL_Details,TM_Details
WHERE 
Component_Table.CompID=Bug_Count_Bucket_Wise.CompID  
AND Bug_Count_Bucket_Wise.CompID=Track_Table.CompID
AND TM_Details.TMID = TL_Details.TMID 
AND TL_Details.ID=Component_Table.TLID
AND Type_of_Bucket.ID = Track_Table.BucketID
AND TM_Details.TMAlias=@TM
AND Type_of_Bucket.Type= 'AHI'
AND Component_Table.Component = ??????">  
             <SelectParameters>  
                 <asp:CookieParameter CookieName="TM" Name="TM" Type="String" DbType="Object" />  
             </SelectParameters>  
              
             <UpdateParameters>  
             <asp:Parameter Name="ETA" Type="DateTime" />  
             <asp:Parameter Name="Comments" Type="String" />  
             <asp:CookieParameter CookieName="CurrentTime" Name="CurrentTime" Type="DateTime" DbType="Object" />  
             <asp:CookieParameter CookieName="LoginUser" Name="LoginUser" Type="String" DbType="Object" />  
             <asp:CookieParameter CookieName="TM" Name="TM" Type="String" DbType="Object" />  
               
             <asp:Parameter Name="Component" Type="String" />  
               
                  
</UpdateParameters>  
 
              
   </asp:SqlDataSource> 

2) I am updating the same using above query in .aspx page.

The user can edit a field of the table/grid by clicking on the edit button. As it can be seen in the update querry above, the ETA and the Comment fields are editable and once the changes are done , the update button is clicked.

After this the table should be refreshed with the new changes which have just been incorporated by the user. The issue arises when the update button is clicked.
 The changed data is being fetched from the DB but the, ETA and comments fields in each row of the new table generated, now contain the changed/updated values.

This is because we are unable to identify the row which has been changed, with a unique ID.

I would like to know,how to identify a row uniquely in a given update querry in aspx.

Kindly refer to the "?????????" in the query posted above in .aspx.

I would like to know how to extract a given field of a radgrid. For instance, the background id associated with "Print" , which is the value in the first row, first column of the grid.  (please refer the screenshot attached) .

This value/unique id, should now be substituted for the "??????" in the above querry.





Mira
Telerik team
 answered on 18 Dec 2009
0 answers
135 views

Hi
To simplify, I have on a page RadAjaxPanel with RadGrid inside (Rad controls for asp.net ajax Q1 2009); everything is fine till I'm placing an ajax request - refreshing the grid - then I get this 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.

Global.asax code:

void Application_Start(object sender, EventArgs e) 
    { 
        RegisterRoutes(RouteTable.Routes); 
    } 
 
public static void RegisterRoutes(RouteCollection Routes) 
    { 
        Routes.Add(new Route("{resource}.axd/{*pathInfo}", new StopRoutingHandler())); 
        var routeHandler = new WebFormRouteHandler<Page>("~/Desktop/Default.aspx"); 
 
        Routes.Add(new Route("pg/{page}", routeHandler)); 
 
    } 


Handler:

public class WebFormRouteHandler<T> : IRouteHandler where T : IHttpHandler, new() 
    { 
        public string VirtualPath { get; set; } 
 
        public WebFormRouteHandler(string virtualPath) 
        { 
            this.VirtualPath = virtualPath
        } 
 
        #region IRouteHandler Members 
 
        public IHttpHandler GetHttpHandler(RequestContext requestContext) 
        { 
            string pageName 
                    = requestContext.RouteData.GetRequiredString("page"); 
            if (!pageName.Contains(".axd") && pageName.Contains(".aspx")) 
            { 
                pageNamepageName = pageName.Replace(".aspx", ""); 
                string virtualPath 
                    = ObjectContentValidator.StringIsNullOrEmpty(pageName) 
                    ? "~/desktop/default.aspx" 
                    : string.Format("~/desktop/default.aspx?page={0}", pageName); 
                HttpContext.Current.RewritePath(virtualPath, false); 
                return (T)BuildManager.CreateInstanceFromVirtualPath(VirtualPath, typeof(T)); 
            } 
            else 
                return (VirtualPath != null) 
                    ? (IHttpHandler)BuildManager.CreateInstanceFromVirtualPath(VirtualPath, typeof(T)) 
                    : new T(); 
        } 
 
        #endregion 
    } 

I didn't send entire application because is huge... It's a portal with single page (default.aspx), with modules (custom controls) loadable at runtime.
If I remove url routing/rewriting everything works fine.
Thank you for your time!

PS: I saw a bug in code editor from current page:
I'm using Firefox (3.5.5) and if I'm trying to edit in code preview section using backspace the tab is closed.
I've done it 3 times till I understood to not use backspace... imagine :))

Cheers!
Michael
Top achievements
Rank 1
 asked on 18 Dec 2009
1 answer
129 views
Hi,
My window is showing up behind the menu, how can put it in front of it?
I can't recall I've seen this in previous versions but I can be wrong. Else it's something wrong with release 2009.3.1208.35

<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server"
    <title></title
    <script type="text/javascript"
        function OpenWindow(url) { 
            var oWnd = window.radopen(url, 'DefaultWindow'); 
        } 
    </script> 
</head> 
<body> 
    <form id="form1" runat="server"
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager> 
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Overlay="true"
        <Windows> 
            <telerik:RadWindow Skin="Default" ID="DefaultWindow" runat="server" Title="" Height="650px" 
                Width="800px" Left="150px" ReloadOnShow="true" ShowContentDuringLoad="false" VisibleStatusbar="false" Modal="false" Overlay="True" /> 
        </Windows> 
    </telerik:RadWindowManager>  
    <div> 
        <telerik:RadMenu ID="RadMenu1" runat="server"
            <Items> 
                <telerik:RadMenuItem Text="test"></telerik:RadMenuItem> 
                <telerik:RadMenuItem Text="test2"></telerik:RadMenuItem> 
            </Items> 
        </telerik:RadMenu> 
    </div> 
    <p><input id="Button1" type="button" value="open win" onclick="OpenWindow('/test.htm');" /></p
    </form> 
</body> 
</html> 

Georgi Tunev
Telerik team
 answered on 18 Dec 2009
2 answers
167 views
We are having issues with the RadDatePicker control inside the Ajax.BeginForm construct.  Although the control renders properly, it does not have button click events and calendar view does not display.
--------------------------
inside index.aspx:

<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<%@ Import Namespace="MvcApplication5.Controllers" %>
<asp:Content ID="indexTitle" ContentPlaceHolderID="TitleContent" runat="server">
    Home Page
</asp:Content>
<asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        <%= Html.Encode(ViewData["Message"]) %></h2>
    <p>
        To learn more about ASP.NET MVC visit <a href="http://asp.net/mvc" title="ASP.NET MVC Website">
            http://asp.net/mvc</a>.
    </p>
    <% using (Ajax.BeginForm("Partial", new AjaxOptions() { UpdateTargetId = "contentWrapper" }))
       { %>
    <div id="contentWrapper">
        <%Html.RenderPartial("RadDatePickerView");%>
    </div>
    <input type="submit" />
    <%} %>
</asp:Content>


------------------------------------
inside RadDatePickerView.ascx:

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<%@ Import Namespace="Telerik.Web.Mvc" %>
<%= Html.RenderRadDatePicker(control =>
                                       {
                                           control.Calendar.Width = Unit.Pixel(250);
                                           control.DbSelectedDate = DateTime.Now;
                                       },"Hay")%>



Aiyaz
Top achievements
Rank 1
 answered on 18 Dec 2009
3 answers
134 views
How can i get the recurrence fields like daily ,weekly checkboxes in AdvancedInsertTemplate in radscheduler...
Peter
Telerik team
 answered on 18 Dec 2009
2 answers
112 views
Hi, is it normal that the installation takes between 10 and 15 minutes?
(And up to 20-25 minutes if including uninstall of previous version.)
I'm using a "new" computer with Vista on it.

/Mattias
Mattias
Top achievements
Rank 1
 answered on 18 Dec 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?