Telerik Forums
UI for ASP.NET AJAX Forum
20 answers
328 views
Hello Telerik Expert,
What I need is when a user clicks on a RadCalendar's date, it will open up a RadScheduler.
To start off with, for the RadScheduler, what I have done is to actually hard code the ID.
But as it interacts with the RadCalendar, what it should do is when a user clicks on a date, it will open up a RadScheduler.
When the user fills in some info for the specific time span, a new ID will be created and stored back to the Database.
So when the user comes back to that date or any other date on a calender to see their schedule, they can see that specific ID's information. How can we do this? Will the RadScheduler automatically create a new ID, etc. on Insert and update the ID's value on update and even delete automatically.

Please advise.

Thank you.
Nate
Top achievements
Rank 1
 answered on 20 Jun 2011
2 answers
234 views
We have a rather large website and everything was working and loading fine. It has been in production for over two years now with constant updates with new pages. Recently we started looking into Silverlight development and after adding a silverlight project and silverlight class library reference to the website solution we started getting this error message on first run. Subsequent page requests run just fine, but the initial run of the project gets this error.

First thing I tried was to upgrade to latest version. Fail.
Next was to remove the system.windows dependency references from the bin and rebuild project. The files controls.data, controls.data.input, controls.navigation regenerated and are still in the bin as they should be. Fail.
Manually created a reference to system.windows and all child dll's. Fail.
Dumped all extra projects from solution and removed project references. Cleaned and rebuilt solution. Fail.

Any help or Idea's would be appreciated.



[code]

Server Error in '/ePikeMiracle' Application.

Could not load file or assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified.

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: System.IO.FileNotFoundException: Could not load file or assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified.

Source Error:

Line 112:<body runat="server" id="body">
Line 113:    <form id="form1" runat="server">
Line 114:    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
Line 115:    </telerik:RadScriptManager>
Line 116:    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">

[/code]

Doug
Top achievements
Rank 1
 answered on 20 Jun 2011
2 answers
101 views
Hi Telerik,

I was wondering what the prescribed method is for tracking dynamically created panes. I have been working with RadDockLayout for some time and am wondering if it is possible to write an extension method that gives it the ability to keep track of the Panes on the page?

Let me shed some light on some of my issues:

There are a bunch of splitters and panes on the page. The user resizes them and I need to save the state of the controls through page refresh at this point. I am doing this by firing an ajax event on pane resized and then saving the states of all the panes.

public static void SavePanes()
{
    foreach (KeyValuePair<string, RadPaneSetting> paneState in GetStates<SerializableDictionary<string, RadPaneSetting>>().ToList())
    {
        CormantRadPane pane = Utilities.FindControlRecursive(HttpContext.Current.Handler as Page, paneState.Key) as CormantRadPane;
        Save<RadPaneSetting>(pane);
    }
}

The Utilities.FindControlRecurisve is just that, a recursive implementation of Page.FindControl. It is slow when there are large amounts of controls on the page, and I do not like calling it more than I absolutely have to, but I do not have a nice collection of monitored RadPanes already.

As such, I created a manager class for regenerating my controls.

public class RegenerationManager
    {
        private static readonly ILog Logger = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
 
        private static readonly RegenerationManager instance = new RegenerationManager();
        private RegenerationManager() { }
 
        public static RegenerationManager Instance
        {
            get { return instance; }
        }
 
        private IList<CormantRadPane> _regeneratedPanes;
 
        //Don't monitor RadDockZone or RadDock -- these are handled by RadDockLayout.
 
        public IList<CormantRadPane> RegeneratedPanes
        {
            get
            {
                if (object.Equals(_regeneratedPanes, null))
                {
                    _regeneratedPanes = new List<CormantRadPane>();
                }
 
                return _regeneratedPanes;
            }
        }
 
        /// <summary>
        /// Recreates the page state recursively by creating a control and looking for its known children.
        /// </summary>
        /// <param name="splitter"> Splitter having children added to it. </param>
        private void RegenerateSplitterChildren(RadSplitter splitter)
        {
            Logger.InfoFormat("Initializing splitter children for splitter {0}", splitter.ID);
            foreach (KeyValuePair<string, RadPaneSetting> paneState in RadControlManager.GetStates<SerializableDictionary<string, RadPaneSetting>>().Where(paneState => paneState.Value.ParentID == splitter.ID))
            {
                CormantRadPane pane = new CormantRadPane(paneState.Value);
                RegeneratedPanes.Add(pane);
                splitter.Controls.Add(pane);
                RegeneratePaneChildren(pane);
                InsertSplitBar(splitter);
            }
        }
 
        /// <summary>
        /// Recreates all the dynamically made DockZones.
        /// </summary>
        public void RegenerateDockZones()
        {
            Logger.Info("Regenerating dock zones.");
            foreach (KeyValuePair<string, RadDockZoneSetting> dockZoneState in RadControlManager.GetStates<SerializableDictionary<string, RadDockZoneSetting>>())
            {
                try
                {
                    RadDockZoneSetting dockZoneSetting = dockZoneState.Value as RadDockZoneSetting;
                    if (dockZoneSetting.ID == "RadDockZone1") continue;
                    Logger.Info(String.Format("Loading state data for dock zone with setting ID: {0}", dockZoneSetting.ID));
                    CormantRadDockZone dockZone = new CormantRadDockZone(dockZoneSetting);
                    //CormantRadPane pane = RegeneratedPanes.First(regeneratedPane => regeneratedPane.ID == dockZoneSetting.ParentID);
                    CormantRadPane pane = Utilities.FindControlRecursive(HttpContext.Current.Handler as Page, dockZoneSetting.ParentID) as CormantRadPane;
                    pane.Controls.Add(dockZone);
                }
                catch (Exception exception)
                {
                    System.Diagnostics.Debug.Assert(false, "Error!");
                    Logger.ErrorFormat("Error regenerating dock zones. Reason: {0}", exception.Message);
                }
            }
        }

If you would kindly look at the above "RegeneratedDockZones" function you will see that I have commented out my attempt at regenerating from my own list. While I seem to find the control just fine I noticed a lot of very weird problems occurring with my dashboard after attempting to load from "RegeneratedPanes". Yet, you can see in RegenerateSplitterChildren that I am working with the same pane which was already existing on the page / being recreated upon the splitter.

Do you see anything erroneous with this? Or anything I should be doing differently? I only have need to monitor RadPanes at this point in time, I was hoping this would be rather simple.. 
Sean
Top achievements
Rank 2
 answered on 20 Jun 2011
1 answer
111 views
Hi all,

I have a question regarding some unexpected behavior that I am experiencing. I don't know if its an issue with the control or an error with the way of have used the control. So I am hoping someone can point me in the right direction. I have a RadTabStrip control that has a RadMultiPage control associated with it. The RadMultiPage control's content URL is set dynamically every time the user changes tabs. This is handled on the TabClick event of the RadTabStrip with the event calling a private method, ChangeTab(), to load the page.

One of the tabs, calls a page that returns a list of users. If a user is selected, the entire page is redirected to a user management screen. We provide a link on that page that allows the web user to return to the list, by storing the tab id as part of the query string. If the user clicks on the link, we get the tab id and change the TabStrip.SelectedIndex to the tab and call the private method, ChangeTab(), to reload the content url for that tab.

I would expect that doing this would allow us to reload the list the user was looking at. This doesn't happen. Instead the tab is selected, but the content is blank. I set a break point in the source's PageLoad event and it isn't called. I have tried the other tabs as well and the same thing happens. I know the method is working because it loads the correct content when the user changes tabs manually. It just doesn't seem to work in the page_load.

Any ideas would be greatly appreciated.

Thanks,
JE
J. E.
Top achievements
Rank 1
 answered on 20 Jun 2011
3 answers
92 views
I've got RadPanelBar with Items with navigateUrl property set. I want the click event on these items to go to the Click event in code-behind instead of navigating to the navigateUrl.

I tried defining a ClientItemClick function for the click event where I set the navigateUrl to null so that it can then go to the code-behind click event.
But it is not working.

Is there anything I can do with preventDefault or anything of that sort?

Thanks and Regards,
Noel
Kate
Telerik team
 answered on 20 Jun 2011
4 answers
249 views
The adjusted width of the RadNumericTextBox will not render correctly in Chrome.  I've tried everything I can think of with no luck.  I want to adjust the width of the control to approximately 50-60px. 

The problem appears to be the Spin Buttons.  If I set ShowSpinButtons="False", then set the control's Width="50px" it resizes just fine.

ASPX Page
<style>
         
        .RadInput_Default table
        {
            width: 50px  !important ;
        }
</style>
 
<div class="qty" style="width:50px;">
        <telerik:RadNumericTextBox ID="txtQty" runat="server"
         MinValue="1" Value="1" ShowSpinButtons="True" NumberFormat-DecimalDigits="0"></telerik:RadNumericTextBox>
         <div style="clear:both;"></div>
</div>

RENDERED HTML
<div class="qty" style="width:50px;">
 
        <!-- 2010.1.415.40 --><div id="txtQty_wrapper" class="RadInput RadInput_Default" style="width:125px;">
 
    <table cellpadding="0" cellspacing="0" class="riTable" style="border-width:0;border-collapse:collapse;width:100%;">
 
        <tr>
 
            <td class="riCell" style="width:100%;white-space:nowrap;"><input type="text" value="1" id="txtQty_text" name="txtQty_text" class="riTextBox riEnabled" style="width:100%;" /><input style="visibility:hidden;float:right;margin:-18px 0 0 -1px;width:1px;height:1px;overflow:hidden;border:0;padding:0;" id="txtQty" class="rdfd_" value="1" type="text" /><input style="visibility:hidden;float:right;margin:-18px 0 0 -1px;width:1px;height:1px;overflow:hidden;border:0;padding:0;" id="txtQty_Value" class="rdfd_" name="txtQty" value="1" type="text" /></td><td class="riSpin"><a class="riUp" href="javascript:void(0)" id="txtQty_SpinUpButton"><span>Spin Up</span></a><a class="riDown" href="javascript:void(0)" id="txtQty_SpinDownButton"><span>Spin Down</span></a></td>
 
        </tr>
 
    </table><input id="txtQty_ClientState" name="txtQty_ClientState" type="hidden" />
 
</div>
 
         <div style="clear:both;"></div>
 
    </div>


Shailendra
Top achievements
Rank 1
 answered on 20 Jun 2011
3 answers
46 views
I tried to follow "Edit On Double Click" Tutorial:
http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/editondblclick/defaultcs.aspx
Everything works quite well. Except that when I changed the GridTextBoxColumnEditor to Multirow mode, it won't be tracked change anymore, (If I make some editing into this multirow textbox, and then click outside, it won't popup "Update changes!", but it works once I change the GridTextBoxColumnEditor back to "SingleLine")

I opened the Demo Project (RadControlExamples that comes with the package), and change the textbox in this project to Multirow, it won't work either.

Please let me know if there is any workaround, Thanks.
Genti
Telerik team
 answered on 20 Jun 2011
4 answers
131 views
I have a rad grid and am using client side binding. In the grid is a GridButtonColumn whose ButtonType is set to "ImageButton".
When the page loads, there are no items in the grid, it is in a div that is hidden.
There is a button on the page that allows the user to add items, after which the grid is bound to those items.
After the 10th item is added, the rendering on the GridButtonColumn goes haywire.
The correctly rendered image button looks like: 
<input type="image" name="ctl00$PlaceHolderMain$CreateForm$DetailsGrid$ctl00$ctl14$gbcDeleteCommandColumn" id="ctl00_PlaceHolderMain_CreateForm_DetailsGrid_ctl00_ctl14_gbcDeleteCommandColumn" title="Delete" src="/WebResource.axd?d=GpOX6CklTui-WvsX3ntJX3ScZbvlRAVY8vywfIml9JItkz7GRkBph6JGqEfC9c79Y_0WJH4Nno_X46fOq0MjDPt_LMglkeRc-eqk2sIgYglxd1EFqxUP8l5AE_GCCW7O8haJNpYIJYTP71JNlw-cuq-QZUhJ-Wl0sZgdku0-h-F4-g8fvnFhBcx7J8a4kUhHArGx1g2&amp;amp;t=634419269737817546" alt="Delete" onclick="if(!confirm('Are you sure you want to delete this entry?'))return false;if(!$find('ctl00_PlaceHolderMain_CreateForm_DetailsGrid_ctl00').fireCommand('Delete','5')) return false;" style="border-width:0px;">

The incorrectly rendered image button looks like:
<input type="image" title="Delete" alt="Delete" src="" onclick="if(!$find('ctl00_PlaceHolderMain_CreateForm_DetailsGrid_ctl00').fireCommand('Delete','10')) return false;">

Here is the grid:
<telerik:RadGrid ID="DetailsGrid" runat="server"
    AllowMultiRowEdit="false"
    AllowPaging="false"
    AllowSorting="false"
    AutoGenerateColumns="false"
    EnableViewState="false"
    GridLines="None"
    Skin="Simple"
    Width="100%">
    <MasterTableView TableLayout="Fixed" ClientDataKeyNames="ID">
        <Columns>
            <telerik:GridBoundColumn UniqueName="Date" DataField="Date" HeaderText="Date" ReadOnly="true" HeaderStyle-Width="75px" ItemStyle-HorizontalAlign="Left" DataType="System.DateTime" DataFormatString="{0:MM/dd/yyyy}">
            </telerik:GridBoundColumn>                   
            <telerik:GridBoundColumn UniqueName="UserDisplayName" DataField="UserDisplayName" HeaderText="User" ReadOnly="true" HeaderStyle-Width="135px" ItemStyle-HorizontalAlign="Left">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="Hours" DataField="Hours" HeaderText="Hours" HeaderStyle-Width="50px" ItemStyle-HorizontalAlign="Center">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="Minutes" DataField="RemainderMinutes" HeaderText="Minutes" HeaderStyle-Width="60px" ItemStyle-HorizontalAlign="Center">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="Description" DataField="Description" HeaderText="Description" ItemStyle-HorizontalAlign="Left">
            </telerik:GridBoundColumn>
            <telerik:GridButtonColumn UniqueName="DeleteCommandColumn"
                                        CommandName="Delete"
                                        ButtonType="ImageButton"
                                        ConfirmText="Are you sure you want to delete this entry?"
                                        ConfirmTitle="Delete Entry"
                                        Text="Delete"
                                        HeaderStyle-Width="30px"                                                                                                                       
                                        ItemStyle-HorizontalAlign="Center" >
            </telerik:GridButtonColumn>
        </Columns>
    </MasterTableView>
    <ClientSettings>
        <ClientEvents OnCommand="Stp.DetailsGrid_Command"></ClientEvents>
    </ClientSettings>
</telerik:RadGrid>         

This happens in both IE and Chrome.
Version 2011.1.315.35
Has anyone seen this before?
Chase Huber
Top achievements
Rank 1
 answered on 20 Jun 2011
2 answers
133 views
Hi
We have an aspx page with a usercontrol lying directly in the page and a tabstip with usercontrols dynamically loaded on each tab on demand.

Based on the save operation of user control inside a particular tab, we would like to refresh data in the user controls that direcly place in the aspx page.

But the problem is the evenhandler is always null inside the usercontrol in the tabstrip.

Are we using the right code to handle this?

Here is the code from ascx control residing inside a tab:
private System.EventHandler ButtonResSaveClicked; 
    
        public event EventHandler BtnResSaveClicked 
        
            add 
            { ButtonResSaveClicked += value; } 
            remove 
            { ButtonResSaveClicked -= value; } 
    
        
    
    
protected void btnSave_Click(object sender, EventArgs e) 
        
           //Perform save operation 
           if (ButtonResSaveClicked != null) 
                        
                            ButtonResSaveClicked(sender, e); 
                        
    
           }

Related code in aspx page:
ucFromTab.ButtonResSaveClicked+= ucInPage.RefreshData;



Any of your response will be of great help to me.
Me Mo
Top achievements
Rank 1
 answered on 20 Jun 2011
3 answers
124 views
Hi,

Is it possible to attach a context menu to a nested grid ? I currently have a radGrid with a nestedGrid and I use the following code to attach a menuContext

function RowContextMenu(sender, eventArgs) {
    var menu;
    var ownerTable = eventArgs.get_tableView();
 
    if (ownerTable.get_name() == "Grid") {
        menu = $find("<%=RadContextMenuUser.ClientID %>");
    }
    else if (ownerTable.get_name() == "NestedGrid") {
        menu = $find("<%=RadContextMenuUsersRole.ClientID %>");
    }

    var evt = eventArgs.get_domEvent();
 
    if (evt.target.tagName == "INPUT" || evt.target.tagName == "A") {
    return;
    }
 
    var index = eventArgs.get_itemIndexHierarchical();
    document.getElementById("radGridClickedRowIndex").value = index; 
    document.getElementById("radGridClickedTableId").value = ownerTable._data.UniqueID;
 
    sender.get_masterTableView().selectItem(sender.get_masterTableView().get_dataItems()[index].get_element(), true);

For the "parent" grid, it works really great, but it doesn't work for the nestedGrid. In fact, I have the following error : 
Cannot call method 'get_element' of undefined.  

So, anyone may help me please ?

David
Top achievements
Rank 1
 answered on 20 Jun 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?