Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
121 views
I am creating RadDocks dynamically.  Each RadDock is created with a custom control (ascx).  I have a RadDock command which displays a dialog in a RadWindow which allows me to change values in the custom control in the RadDock and also the size and title of the RadDock.  All this works except changing the size of the RadDock.  (I'm even able to change the title of the RadDock without a problem.)

After the first creation of the RadDock, on postback the RadDocks are re-created in Page_Init using the Rad Dock states - and then I apply my new dock width after I apply the state.  What am I missing?
Protected Sub Page_Load(sender As Object, e As System.EventArgs)
If Not IsPostBack Then
'CreateRadDock() routine is eventually called from here along with some other stuff that I don't think is relevant
End If
End Sub
Protected Sub Page_Init(sender As Object, e As System.EventArgs)
'Recreate the docks in order to ensure their proper operation
If IsPostBack Then
UpdateZone()
End If
End Sub
Private Function CreateRadDock(Title As String, SectionCount As Integer) As RadDock
Dim dock As New RadDock()
dock.DockMode = DockMode.Docked
dock.UniqueName = Guid.NewGuid().ToString().Replace("-", "a")
dock.ID = String.Format("RadDock{0}", dock.UniqueName)
dock.Title = Title
'dock.Text = String.Format("Added at {0}", DateTime.Now)
dock.Width = Unit.Pixel(270 * SectionCount)
dock.Resizable = True
dock.Height = Unit.Pixel(400)
dock.Skin = "Office2010Black"
'RadAjaxManagerProxy1.AjaxSettings.AddAjaxSetting(dock, RadDockZone1, RadAjaxLoadingPanel1)
AddHandler dock.Command, AddressOf dock_Command
dock.Commands.Add(New DockCloseCommand())
dock.Commands.Add(New DockExpandCollapseCommand())
SetPropertiesCommand(dock)
Return dock
End Function
Sub UpdateZone()
RadDockZone1.Controls.Clear()
Dim i As Integer = 0
While i < CurrentDockStates.Count
Dim dock As RadDock = CreateRadDockFromState(CurrentDockStates(i), i)
RadDockLayout1.Controls.Add(dock)
'We want to save the dock state every time a dock is moved.
CreateSaveStateTrigger(dock)
System.Math.Max(System.Threading.Interlocked.Increment(i), i - 1)
End While
End Sub
Private Function CreateRadDockFromState(state As DockState, PanelOrder As Integer) As RadDock
Dim PanelID As String = String.Format("RadDock{0}", state.UniqueName)
Dim panel As clsDashboardPanelMapItem = New clsDashboardPanelMapItem()
panel = Session(PanelID)
Dim properties As Hashtable = Session("properties_" & panel.PanelID & "_" & panel.SectionCount)
Dim dock As New RadDock()
dock.DockMode = DockMode.Docked
dock.ID = PanelID
dock.Skin = "Office2010Black"
dock.ApplyState(state)
dock.Width = Unit.Pixel(270 * properties("PanelCount"))
dock.Height = Unit.Pixel(400)
dock.Title = properties("PanelTitle")
'Load the custom control
Dim UserControl As Control = SetSection(panel.PanelModulePath, properties("PanelTitle"), panel.PanelDesc, properties, Nothing, properties("PanelCount"), panel.PanelID, panel.SectionCount, panel.ObjectName)
dock.ContentContainer.Controls.Add(UserControl)
AddHandler dock.Command, AddressOf dock_Command
dock.Commands.Add(New DockCloseCommand())
dock.Commands.Add(New DockExpandCollapseCommand())
SetPropertiesCommand(dock)
Return dock
End Function
Private Sub CreateSaveStateTrigger(dock As RadDock)
'Ensure that the RadDock control will initiate postback
' when its position changes on the client or any of the commands is clicked.
'Using the trigger we will "ajaxify" that postback.
dock.AutoPostBack = True
dock.CommandsAutoPostBack = True
End Sub
Sub SetPropertiesCommand(dock As RadDock)
Dim propCmd As DockCommand = New DockCommand()
propCmd.Name = "Properties"
propCmd.Text = "Properties"
propCmd.CssClass = "DockPropertiesCommand"
propCmd.AutoPostBack = True
dock.Commands.Insert(0, propCmd)
End Sub

<telerik:RadDockLayout ID="RadDockLayout1" runat="server" Skin="Default" OnSaveDockLayout="RadDockLayout1_SaveDockLayout"
    OnLoadDockLayout="RadDockLayout1_LoadDockLayout" StoreLayoutInViewState="True">
    <telerik:RadDockZone ID="RadDockZone1" runat="server" Height="1400px" Width="1100px" Skin="Black" Orientation="Horizontal">
 
    </telerik:RadDockZone>
</telerik:RadDockLayout>

Any help is appreciated. Thanks.

Hunter
Top achievements
Rank 1
 answered on 26 Feb 2013
1 answer
313 views
Hello,
i've the problem...on my web page there's a radmenu and from this page i call with radmenu a radwindows..if the resolution of the user's screen is low radwindon instead of staying above the radmenu appears below .. how can I do?

see the image that i posted

Marin Bratanov
Telerik team
 answered on 26 Feb 2013
3 answers
108 views
Hello Team,

I am using a rad window to update the content in my grid, I got a sample from telerik forums and I am using it. It did worked fine for me.

I used java script to open the rad window from the code base rad grid item created.

this is in .aspx page :

    function RefreshrgUnitTypesGrid() {

        var masterTable = $find("<%= rgunitTypes.ClientID %>").get_masterTableView();
        masterTable.rebind();

    }




    function ShowEditFormrgTypes(id, rowIndex) {


        var gridunitTypes = $find("<%= rgunitTypes.ClientID %>");

        var rowControl = gridunitTypes.get_masterTableView().get_dataItems()[rowIndex].get_element();
        gridunitTypes.get_masterTableView().selectItem(rowControl, true);

        window.radopen("../ERP/NormalPages/AddUnitTypes.aspx?ID=" + id, "UserEditUnittype");

        return false;
    }


 this is in item created:

    ImageButton imgBtnEditTenancy = (ImageButton)e.Item.FindControl("imgBtnEditTenancy");
                    imgBtnEditTenancy.Attributes["onclick"] = String.Format("return ShowEditFormrgTypes('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["ID"], e.Item.ItemIndex);

and here is my window:

     <telerik:RadWindow ID="UserEditUnittype" runat="server" Title="Edit Unit Type" Height="320px"
                Width="310px" Left="150px" ReloadOnShow="true" ShowContentDuringLoad="false"
                Modal="true"  onclientclose="RefreshrgUnitTypesGrid">
            </telerik:RadWindow>



----- problem is , I am able to see a rad window ,but not this "UserEditUnittype" where I mentioned height ,width and title. One rad window is popping up where I was surprised see that which don not all the properties that I mentioned. I am attaching a screen shot. can some one please look into that issue for me?


Marin Bratanov
Telerik team
 answered on 26 Feb 2013
13 answers
297 views
The scheduler opens the edit form (in my case a custom form) when I double click on the appointment.

I now have a requirement to generate an Ajax requires on a client-side single click. Having written the code to do this I can't get a double click to fire the default action, ie open the custom form.

What am I missing?

-- 
Stuart
Dimitar Terziev
Telerik team
 answered on 26 Feb 2013
1 answer
139 views
Hi,
 I have Radscheduler which displays next day's calendar after 11 PM.  I fixed the time range displayed in  timeline view of calendar  by setting start date  on initial page load. However when I click "Today" , it again shows next day in timeline view. 
Is there any event fired on clicking"Today" so that I can set scheduler's selected date,  or  am I missing a setting?

c# Code
  //PK 02/18/2013  Set selected date of scheduler, so it does not show next day's timelineview  at 11:00 PM
               if (!IsPostBack)    
                   rsTicketsSchedule.SelectedDate = DateTime.Now.Date;

ASPX:
  <telerik:RadScheduler ID="RadScheduler1" runat="server" Skin="Office2007"
                        Width="100%" RowHeaderWidth="52" OverflowBehavior="Auto" ShowFooter="false" DataSourceID="SchedulerDataSource"
                        DataKeyField="AppointmentID" DataStartField="Start" DataEndField="End" DataSubjectField="Subject"
                        CustomAttributeNames="Due, Priority" RowHeight="37px" OnAppointmentCommand="RadScheduler1_AppointmentCommand"
                        OnAppointmentInsert="RadScheduler1_AppointmentInsert" SelectedView="TimelineView" 

                       
                     >
                      <TimelineView GroupBy="Calendar" GroupingDirection="Vertical"  SlotDuration="00:30:00"
                           ColumnHeaderDateFormat="hh:mm"></TimelineView>
                        <AdvancedForm Modal="true"></AdvancedForm>
                        <AppointmentTemplate>
                            <%# Eval("Subject") %>
                                <asp:Button runat="server" ID="UnscheduleAppointment" CssClass="simpleButton" CommandName="Unschedule"
                                Text="&nbsp;" ToolTip="Unschedule this appointment"></asp:Button>
                        </AppointmentTemplate>
                        <TimeSlotContextMenuSettings EnableDefault="true"></TimeSlotContextMenuSettings>
                        <AppointmentContextMenuSettings EnableDefault="true"></AppointmentContextMenuSettings>
                   
                    </telerik:RadScheduler>

http://demos.telerik.com/aspnet-ajax/scheduler/examples/timelineview/defaultcs.aspx

Thanks,
Prava
Boyan Dimitrov
Telerik team
 answered on 26 Feb 2013
4 answers
302 views
I am exporting data from a radgrid (group by), and I want to put  data into different  worksheets( same workbook) based on group,Can I do that? 

Thanks!

William
Top achievements
Rank 1
 answered on 26 Feb 2013
1 answer
155 views
Hi

We have a radwindow within a variable width site, we open the RadWindow as follows:
        
var oWindow = window.radopen(url, null);

And then set the width & height:

        oWindow.setSize(width, height);

When the above runs it adds an inline width attribute to the RadWindowWrapper element with a width of 15016px so the window is stupidly large.

This only happens in the latest version of Google Chrome which was released on 21st Feb 2013.

I could do with a fix for this asap as the RadWindow has been used throughout our site and is currently unusable in Chrome.

Marin Bratanov
Telerik team
 answered on 26 Feb 2013
1 answer
286 views
This is probably really simple, but for some reason the grid is not pulling back any data when the filter is run. i have 2 grids on the page and you click grid1 it runs the datasource for grid2. this is all done with a postback in grid2. the new data is there and i want to filter it by say a "first name". so i click in the filter and type "Jim" - the grid is blank - no message nothing. but...
 
<telerik:GridBoundColumn DataField="FirstName" DataType="System.String" HeaderText="Name" UniqueName="FirstName" Reorderable="true" AutoPostBackOnFilter="false" CurrentFilterFunction="Contains" FilterDelay="1000" ShowFilterIcon="false">
<ItemStyle Width="100px" />
</telerik:GridBoundColumn>

...i click on the grid1 row that was selected and it does a postback and shows the filtered data using "Jim". why is it not filtering out when i am done entering the filter as the GridBoundColumn is coded. I have to select the Grid1 for the data to refresh the Grid2 data with the filter working. 

Grid2 below:
<telerik:RadGrid runat="server" ID="RadGridMembers" Height="825px" Width="600px" AutoGenerateColumns="false" AllowMultiRowSelection="false" AllowFilteringByColumn="true">
<GroupingSettings CaseSensitive="false" ></GroupingSettings>
<MasterTableView DataKeyNames="MemberId, FirstName" ClientDataKeyNames="MemberId">

There has to be something simple here that needs to make it postback and grab the data with the filter in place instead of clicking on the Grid1 to make it NeedDataSource

Thoughts, ideas, answers?
Thanks!
Angel Petrov
Telerik team
 answered on 26 Feb 2013
1 answer
159 views
Hello,

I'm adding new values to the comboBox client-side, including an icon. Unfortunately, the image won't work. In fact, all icons of already existing items (which were added server-side) disappear. The imageUrl is correct, I also used the imageUrl of the currently selectected item.

This is my code:
var caption = "Test";
var id = "123";
var img = "inc/img/Ps/Img1.png"
 
  var items = this.get_comboBox().get_items();
      this.get_comboBox().trackChanges();
      var comboItem = new Telerik.Web.UI.RadComboBoxItem();
      comboItem.set_text(caption);
      comboItem.set_value(id);
      comboItem.set_imageUrl(img);
 
      items.add(comboItem);
      this.get_comboBox().commitChanges();

Am I missing something?

Edit: If I don't set the ImageUrl to the client-side item, the other icons disappear anyway.
JP
Top achievements
Rank 1
 answered on 26 Feb 2013
6 answers
233 views
Hi,

I want to open a new appointment dialog using code behind or javascript, not clicking on the scheduler. I have played around with that but see no luck.

The scenario is that when I click on an external button outside the scheduler, it will open a new appointment dialog with current date.

Thanks,

Khoa
Wayne Wilson
Top achievements
Rank 1
 answered on 26 Feb 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?