Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
104 views
I have a dashboard page I am making that has icons to the different pages on it.  What I am doing is using a radwindow with javscript to call all those pages via a icon.  the probme is that if they open one page do there thing then open a different one the pervious window will be there temporarily until the one they called opens.  How do I make sure this does not happen.  Also I have found that if a person stays in that window for about 20 seconds and does nothing the window locks up the code on the page, anbd i have to reload the radwindow to get it working properly agian.  Here is my part dashboard page code to get an idea what I am doing.  It seems when I put vaues for the radwinow in the html radwindow code it does not work so i have to put in javscript to get to work properly as well.

<table style="width:90%;margin-right:auto;margin-left:auto;margin-top:20px">
           <tr>
               <td style="height:20px;width:100%;border-bottom:double;border-color:red">iDRAT Management Options</td>
           </tr>
       </table>
       <table  style="width:90%;margin-right:auto;margin-left:auto;margin-top:20px">
           <tr>
               <td style="width:25%;align-content:center;vertical-align:top">
                   <asp:HyperLink ID="lnkAdmin" runat="server" onclick="LoadWindow(1)" ><asp:Image ID="imgAdmin" runat="server" ImageUrl="~/Images/AdminIcon2.png" /> Manage Admin</asp:HyperLink>
               </td>
               <td style="width:25%;text-align:center">
                    <asp:HyperLink ID="lnkInventory" runat="server" onclick="LoadWindow(2)" ><asp:Image ID="imgtest" runat="server" ImageUrl="~/Images/AdminIcon2.png" /> Manage Inventory</asp:HyperLink>
               </td>
               <td style="width:25%;text-align:center">
                    <asp:HyperLink ID="lnkEquiptypes" runat="server" onclick="LoadWindow(3)" ><asp:Image ID="Image1" runat="server" ImageUrl="~/Images/AdminIcon2.png" /> Manage Equipment Types</asp:HyperLink>
               </td>
               <td style="width:25%;text-align:center">
                    <asp:HyperLink ID="lnkPo" runat="server" onclick="LoadWindow(4)" ><asp:Image ID="Image2" runat="server" ImageUrl="~/Images/AdminIcon2.png" /> Manage Purchase Orders</asp:HyperLink>
               </td>
           </tr>
       </table>


The following is my Javascript to go with it.

<script type="text/javascript">
        function LoadWindow(Type) {
            
                var radWidow = $find("<%= RadWindow.ClientID%>");
                if (Type == 1) {
                    radWidow.show();
                    radWidow.setUrl("ManageAdmins.aspx");
                    radWidow.maximize();
                }
                else if (Type == 2) {
                    radWidow.show();
                    radWidow.setUrl("ManageEquip.aspx");
                    radWidow.maximize();
                }
                else if (Type == 3) {
                    radWidow.show();
                    radWidow.setUrl("ManageDb.aspx");
                    radWidow.maximize();
                }
                else if (Type == 4) {
                    radWidow.show();
                    radWidow.setUrl("ManagePO.aspx");
                    radWidow.maximize();
                }
                else if (Type == 5) {
                    radWidow.show();
                    radWidow.setUrl("ReceiveItems.aspx");
                    radWidow.maximize();
                }
                else if (Type == 6) {
                    radWidow.show();
                    radWidow.setUrl("IssueItem.aspx");
                    radWidow.maximize();
                }
                else if (Type == 7) {
                    radWidow.show();
                    radWidow.setUrl("Transaction.aspx?Tran=5");
                    radWidow.maximize();
                }
                else if (Type == 8) {
                    radWidow.show();
                    radWidow.setUrl("Transaction.aspx?Tran=24");
                    radWidow.maximize();
                }
        }
   </script>

 

 

 

 

                    

 

 

 

 





Kevin
Top achievements
Rank 1
 answered on 19 Sep 2013
2 answers
106 views
I am trying to refresh parent grid from radwindow. Here is my code. Radiwindow opens but it doesn't close and also doesn't refresh. I am not using RadAjaxManager because RadAjaxManager is on the Master page. Please let me know what am I doing wrong?

Parent Page Code:
----------------------------------------
<script type="text/javascript">
    function refreshGrid() {
        var masterTable = $find("<%=RadGrid1.ClientID%>").get_masterTableView();
        masterTable.rebind();  
    }
</script>

<telerik:RadWindowManager runat="server" ID="RadWindowManager1" OnClientClose="refreshGrid" />
  <telerik:RadGrid ID="RadGrid1"
                           runat="server"
                GridLines="None" Skin="Default" OnNeedDataSource="RadGrid1_NeedDataSource"
                 OnItemCommand="RadGrid1_ItemCommand"   >
 <MasterTableView DataKeyNames="id" PageSize="50" EditMode="EditForms">
<Columns>
<telerik:GridButtonColumn Text="View/Edit" UniqueName="EditColumn" CommandName="EditLink"></telerik:GridButtonColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>

.aspx.cs code
----------------------------
        protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
        {
            long ID = Convert.ToInt64((e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["item_id"]));
            if (e.CommandName == "EditLink")
            {
                RadWindow win = new RadWindow();
                win.ID = "window1";
                win.VisibleOnPageLoad = true;
                win.NavigateUrl = "Page1.aspx?ID=" + ID.ToString();
                RadWindowManager1.Controls.Add(win);
            }
        }

Radwindow page:(Child Window)
----------------------------------------------
<script type="text/javascript">
    function CloseAndRebind() {
        var oWin = GetRadWindow();
        var parentWindow = oWin.BrowserWindow;
        $(oWin).ready(function () {
            oWin.close();
        });
        parentWindow.refreshGrid();
    }

    function GetRadWindow() {
        var oWindow = null;
        if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including classic dialog
        else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well)

        return oWindow;
    }
</script>

.aspx page
---------------
<asp:Button ID="Save" Text="Save" runat="server" OnClick="save_Click" />

Code behind
----------------------------
        protected void save_Click(object sender, EventArgs e)
        {
            try
            {
            save();

                //Close Pop up
                ScriptManager.RegisterStartupScript(Page, typeof(Page), "mykey", "CloseAndRebind();", true);
             
            }



   
Konstantin Dikov
Telerik team
 answered on 19 Sep 2013
15 answers
218 views
hello guys,

im just new to asp.net and to telerik as well.  i have problem when i try delete and update i row.  


Server Error in '/' Application.

The database version of the object identified by the specified key is newer than the version specified in the key.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: Telerik.OpenAccess.Exceptions.OptimisticVerificationException: The database version of the object identified by the specified key is newer than the version specified in the key.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 

[OptimisticVerificationException: The database version of the object identified by the specified key is newer than the version specified in the key.]
   OpenAccessRuntime.DataObjects.OpenAccessPersistenceManagerImp.GetObjectByKey(ObjectKey key) +212
   OpenAccessRuntime.DataObjects.UnsynchronizedPMProxy.GetObjectByKey(ObjectKey key) +50
   OpenAccessRuntime.ObjectScope.GetObjectByKey(ObjectKey key) +48
   Telerik.OpenAccess.OpenAccessContextBase.GetObjectByKey(ObjectKey key) +230
   Telerik.OpenAccess.Web.OpenAccessLinqDataSourceView.GetObjectByKeys(IDictionary keys) +125
   Telerik.OpenAccess.Web.OpenAccessLinqDataSourceView.ExecuteDelete(IDictionary keys, IDictionary oldValues) +187
   System.Web.UI.DataSourceView.Delete(IDictionary keys, IDictionary oldValues, DataSourceViewOperationCallback callback) +92
   Telerik.Web.UI.GridTableView.PerformDelete(GridEditableItem editedItem, Boolean suppressRebind) +271
   Telerik.Web.UI.GridCommandEventArgs.ExecuteCommand(Object source) +4897
   Telerik.Web.UI.RadGrid.OnBubbleEvent(Object source, EventArgs e) +200
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e) +142
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +125
   System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +169
   System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +9
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +176
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.225
 


 any help is highly appreciated thank you.

Dimitar Tachev
Telerik team
 answered on 19 Sep 2013
5 answers
97 views
Hi All,

Does anyone know if it is possible to move the HeaderText set on the columns to be placed in side the group at the moment it defaults to show the HeaderText at the top of the whole grid but I would like that hidden and then only expose the column header text when a user expands a group and show it inside the expanded group, I have attached an image to try and explain.

Hope that makes sense

Thanks in advance.

Lee

Maria Ilieva
Telerik team
 answered on 19 Sep 2013
6 answers
209 views
We have several radgrids with toolbars on top, column headers, and page footers.  One of the options in the paging footer is to set the number of lines displayed in the grid.  Since this number is allowed to be much larger than may be displayable on the current monitor, we would much prefer fixed headers and internal scrolling in the grid.

The problem is when there is no data in the grid.  In this case, the footer is not at the bottom of the window as it is in all other cases, it is immediately below the colum headers with only the height of one horizontal scrollbar between the two.  If the horizontal scroll bar is needed because the column widths add to wider than the screen, our custom no data message is hidden by the scrollbar.  If there is not a need for the scrollbar, then the top half of our custom no data message is displayed with the bottom half of the message obscured by the footer.

I believe that we are on 2102 Q3 SP2
Two questions:
1)  Is there a work around for this?
2)  Is it fixed in a more recent build?
John
Top achievements
Rank 1
 answered on 19 Sep 2013
2 answers
125 views

How do I do this?
I have a website that requires a username and password in order to access the site. The name of the user that logs in determines which treeview node in the left-hand pane of FileExplorer receives focus. Basically in OnLoadComplete() I have:
    userNode.Selected = true;
This does select the correct node immediately after the user logs in, but the right-hand pane of FileExplorer displays the files and folders that are associated with the root node, instead of displaying the files and folders of the selected node. How do I get the right-hand pane to display the content (files and folders) that are associated with the programmatically selected node, instead of displaying the content of the root node?

Thank you

Brian
Top achievements
Rank 1
 answered on 19 Sep 2013
1 answer
125 views
When I was using a GridClientSelectColumn to select rows in my RadGrid, I used this post and this post to persist the checked state on the client side, using JavaScript to store the selected row ids in a hidden field.

I'd like to do this with checkboxes that are GridTemplateColumns defined on the server side, like this:

    foreach (blah blah)
    {
        templateColumn = new GridTemplateColumn();
        RadGrid1.MasterTableView.Columns.Add(templateColumn);
        templateColumn.ItemTemplate = new MyTemplate(blah);
        templateColumn.HeaderText = blah;
    }
 
private class MyTemplate : ITemplate
{
    protected CheckBox chk;
    private string columnName;
 
    public MyTemplate(string columnName)
    {
        this.columnName = columnName;
    }
 
    public void InstantiateIn(Control container)
    {
        chk = new CheckBox();
        chk.ID = "chk" + columnName;
        chk.DataBinding += new EventHandler(DataBinding);
        chk.Enabled = true;
        container.Controls.Add(chk);
    }
 
    void DataBinding(object sender, EventArgs e)
    {
        CheckBox cBox = (CheckBox)sender;
        GridDataItem container = (GridDataItem)cBox.NamingContainer;
        cBox.Checked = (bool)((DataRowView)container.DataItem)[columnName];
    }
}

I think I can do the same kind of thing here, except I can no longer call the JavaScript function RadGrid1_RowSelected since I'm not selecting the row, just checking boxes. I'll need to use another event that fires when a checkbox is checked or unchecked (I guess that's CheckChanged). But how do I add a handler on the server side and have it handled on the client side?
Kostadin
Telerik team
 answered on 19 Sep 2013
1 answer
135 views
Hi, i am trying to make a confirmation box when moving an appointment.
The problem here is that the:
args.get_targetSlot().get_startTime().format("HH:mm");

returns wrong time, wye is that?

function onAppointmentMoveEnd(sender, args) {
           
           var appointment = args.get_appointment();
           var scheduler = $find("<%= RadScheduler1.ClientID %>");
 
           var fromTime = appointment.get_start();
 
           var customerName = appointment.get_resources().getResourceByType("Kunder").get_text();
           var fromRoom = appointment.get_resources().getResourceByType("Rum").get_text();
 
           var targetRoom = args.get_targetSlot().get_resource().get_text();
 
           var targetTime = args.get_targetSlot().get_startTime().format("HH:mm");
 
           // Calculate the duration of the appointment
           var appointmentDuration = appointment.get_end() - appointment.get_start();
 
           var newFromEndTime = new Date(fromTime.getTime() + appointmentDuration);
           var editSeries = args.get_editingRecurringSeries();
            
           // Pop a confirmation window
           var confirmMessage = "Är du säker pÃ¥ att du vill flytta " + customerName + "?<p> <strong> FrÃ¥n:</strong> " + fromRoom + " <strong>kl:</strong> " + fromTime.format("HH:mm") + "<br/> <strong>Till:</strong> " + targetRoom + " <strong>kl:</strong> " + targetTime + "</p>";
 
           radconfirm(confirmMessage,
           function (arg) {
               if (arg == false) {
                   // The user has confirmed moving the appointment. Update the start and end time.
                   appointment.set_start(fromTime);
                   appointment.set_end(newFromEndTime);
                   scheduler.updateAppointment(appointment, editSeries);
               }
           }, 330, 100);
       }
Plamen
Telerik team
 answered on 19 Sep 2013
4 answers
121 views
Hi,

We are using the telerik (latest library) Grid with "Outlook" skin , problem is when grid rows gets selected header and selected row color appear same (blue).
if there a way to change the selected row color ? also we have a requirement to use only "outlook" skin.
Please suggest me to rid this issue.
Afroz khan
Top achievements
Rank 1
 answered on 19 Sep 2013
1 answer
134 views
Hi,

Thanks in advance for some help.  Here's our situation:

  1. We have a RadAutocompleteBox
  2. Inside a RadPanelBar item Content Template.
  3. Sitting in a RadSlidingPane
  4. When RadAutoCompleteBox's dropdown should be visible, it is not.

We assume that this is a problem with the z-index of the listRac element, but we have not had luck manipulating that element via CSS. Other than not being able to see the drop down list, the RAC seems to work fine.  Screenshot attached.

Any ideas?

Thanks,

Jim
Princy
Top achievements
Rank 2
 answered on 19 Sep 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?