Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
607 views
Hello,

I like the example called "Use controls container" shown here:

http://demos.telerik.com/aspnet-ajax/window/examples/internalcontent/defaultcs.aspx

for an application I am working on. I am displaying a list of investments on a grid, and by selecting a grid row, I would like to display the investment historical returns in a Rad Window. I would also like to allow them to move from one investment to another and have the historical returns update in the rad window. I have all of this working fine, however I would like to initially have the window hidden. So if they aren't interested in historical returns they don't have to view them. I would like to show the window only if they select a row for display. I'm having trouble doing this. Can you point me in the right direction? Basically, I would like the example for User Controls Container to work exactly as is, however initially the window is not visible.
Svetlina Anati
Telerik team
 answered on 18 Dec 2009
1 answer
146 views
Hi,

I'm trying to prevent particular users from being able to delete appointments but not having much luck so far.

Following the various threads on the same topic I've added the logic into the AppointmentDataBound event.

Protected Sub rd_Schedule_AppointmentDataBound(ByVal sender As Object, ByVal e As SchedulerEventArgs)  
         
        'Control Access to Edit and Delete Appointments  
        If Page.User.IsInRole("BasicAccess") then  
              e.Appointment.AllowDelete = False 
        End If 
 
End Sub 

In stepping through the code the if statement happily evaluates to true and then sets the e.Appointment.AllowDelete to false. However the context menu delete still causes the Confirm Delete Dialog to display and will still delete the appointment. I've added in the AppointmentDelete event and checked the AllowDelete for the appointment and it evaluates to false despite deleting the appointment.

Is there a more comprehensive example of this or anything I can look at that might be effecting it?
Cheers,
Damien
Shinu
Top achievements
Rank 2
 answered on 18 Dec 2009
3 answers
131 views
Hi there,

We are using Q3 2008 RadControls For ASP.NetAjax.
We have requirement of multiple dynamic count scheduler inside DataList.
Here is complete details of the problem:
RadScheduler is inside a Closable-Div in DataList: ItemTemplate. Using Ajax partial Post backs to Create/Update Appointments inside a Scheduler results in the disturbance of the Appointment BackColor of the rest of the Schedulers inside DataList.
You can see the image before ajax call at http://i33.tinypic.com/2cpu6uh.jpg
But after creating some Appointments in a schedule (Left one in Image) http://i38.tinypic.com/a0i1s1.jpg the appointments BackColor of the other Schedulers inside DataList (the right one in image) resets/disturbs.
(Note: In Appointment Creation Ajax postback, we only rebinds that particular scheduler).

Any significant help will be really appriciated in this regards.

Thanks
Sajid Wahab
Muhammad
Top achievements
Rank 1
 answered on 18 Dec 2009
7 answers
206 views
Hi -

I'm using a simple routing handler (http://chriscavanagh.wordpress.com/2009/01/20/aspnet-routing-in-vbnet/) for a small project.  When I try to place Rad controls such as a menu or combo box on a page, they work fine if the routing indicates the root directory (where the physical page actually is), however if the routing indicates an "interior" page such as "root/About Us/Bios", the Rad links to the AXD file appear to break - I get no CSS and no JavaScript on the controls.  Have you run across similar situations?

Thanks,

Rod

Georgi Krustev
Telerik team
 answered on 18 Dec 2009
4 answers
209 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
166 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
154 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
127 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
277 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
139 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?