Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
136 views
Hi! There is a radscheduler whose datasource is a list of appointments, each of them having one or more resources. (There is many-to-many relationship between appointments and resources). Also, there is a checkboxlist of resources, used for binding resurce type of a scheduler. How can I group scheduler by that resource type, to look like in your example on http://demos.telerik.com/ASPNET/Prometheus/Scheduler/Examples/ResourceGrouping/DefaultCS.aspx? (I would like it to have as many columns as number of boxes cheked in checkboxlist). As I understod, relationsheep should be one-to-many or I have to set some appointmentProviders in webconfig?

This is what a have:

<

telerik:RadScheduler runat="server" ID="RadScheduler1" Skin="<%$ AppSettings: SchedulerSkin%>"Width="750px" StartEditingInAdvancedForm="false" SelectedView="MonthView" DataKeyField="ID"DataSubjectField="Subject" DataStartField="Start" DataEndField="End" DataRecurrenceField="RecurrenceRule"DataRecurrenceParentKeyField="RecurrenceParentID" EnableEmbeddedSkins="true" OverflowBehavior="Expand">
<ResourceTypes><telerik:ResourceType TextField="Naziv" KeyField="ResursID" Name="Resurs"/>
</ResourceTypes></telerik:RadScheduler>



I bind scheduler in code behind, and I want to do that with the resource type to, as simplier as it can be. Please help. Thanks,
Ana
Plamen
Telerik team
 answered on 09 Jul 2012
1 answer
89 views
Hi,

I need your help to the following problem. I have a RadGrid which displays some records. Each record can be edit using PopUp Edit Form which is of type WebUserControl (see sample code below)

<telerik:RadGrid ID="grid" runat="server" OnItemCreated="grid_ItemCreated" OnEditCommand="grid_EditCommand"
AutoGenerateColumns="False"  OnNeedDataSource="grid_NeedDataSource"  >
<MasterTableView DataKeyNames="Id" EditMode="PopUp" EnableViewState="true">
    <Columns>
        ...
    </Columns>
    <EditFormSettings UserControlName="~/MyControl.ascx" EditFormType="WebUserControl"  PopUpSettings-Modal="true">
    </EditFormSettings>
</MasterTableView>
</telerik:RadGrid>

On Edit command I want to pass the selected grid row values into the userControl(MyControl.ascx ) using the setter methods exist on the userControl. My problem is how can I get an instance of the userControl inside the grid_EditCommand in order to set the values.

Thanks
Pan
Elliott
Top achievements
Rank 2
 answered on 09 Jul 2012
3 answers
140 views
I have a grid that is programmatically created in Page_Load that also includes a varying number of calculated columns.  Each column contains an aggregate (count, sum, etc.).  However, one of my columns is a percentage that is calculated based on other bound columns.  Each row's calculation is done perfectly, but the grid footer should apply the same expression to the rest of the footer's values.  The real trick is that the expression being used by the grid is not known at design time so I am unable to manually create a custom aggregate.  

Anyone have any ideas how I can use the expression and datafields from the GridCalculatedColumn to evaluate that column's footer?
Andrey
Telerik team
 answered on 09 Jul 2012
1 answer
127 views
I'm using several controls on a page that has a radajaxpanel that contains several controls as i will show:
<asp:Content ID="Content1" ContentPlaceHolderID="VSContentPlaceHolder" Runat="Server">
<telerik:RadScriptManager ID="RadScriptManager1" runat="server" >
</telerik:RadScriptManager>
<telerik:RadCodeBlock ID="EventsRCodBlo" runat="server">      
        <script type="text/javascript">
            window.onload = firstLoad;
 
            function firstLoad() {
                
                setDivHeight();
                //alert(isPostBack());
            }
            function selTreLstChange(sender, args) {
                 
                var treelist = $find("<%=PersonnelAssignedRTreLst.ClientID%>");
                var items = treelist.get_selectedItems();
                var count = items.length;
                if (count > 0) {
                    var item = items[0];
                    var nodetype = item.get_element().getAttribute("typeofnode");
                    var perid = item.get_element().getAttribute("perid");
                    var AuxQualifiedHid = document.getElementById("<%=SelQualHidFie.ClientID%>");
                    AuxQualifiedHid.value = nodetype;
                    var AuxPersAsIDHid = document.getElementById("<%=PersAsIDHidFie.ClientID%>");
                    AuxPersAsIDHid.value = perid;
                    var index = item.get_hierarchicalIndex();
 
                    $find("<%=MainRAjaPan.ClientID %>").ajaxRequest("PersTypeChanged");
                }
            }
            function selBut(sender, args) {
                 
                var toolBar = sender;
                var button = args.get_item();
                var command = button.get_commandName();
                 
                if (command == 'Save') {
                   //Save logic
                }               
            }
            function setDivHeight(sender,args) {
                 //Set height from divs
            }
        </script>
    </telerik:RadCodeBlock>
<telerik:RadToolBar ID="MainToolBar" runat="server" Width="100%" OnClientButtonClicking="selBut" OnButtonClick="MainToolBar_ButtonClick">
            <Items>           
                <telerik:RadToolBarButton runat="server" CommandName="Back" CommandArgument="Back" Text="Back" ImageUrl="~/VS/Images/textbox/post_button_undo.gif" NavigateUrl="javascript:cancel();" ToolTip="Back" PostBack="false" >
                </telerik:RadToolBarButton>
                <telerik:RadToolBarButton runat="server" CommandName="Save" CommandArgument="Save" Text="Save Changes" Visible="true" ImageUrl="~/VS/Images/color/16/0040-save.gif" ToolTip="Save Changes" >
                </telerik:RadToolBarButton>  
                <telerik:RadToolBarButton runat="server" CommandName="Add" CommandArgument="Add" Text="Add Per" ImageUrl="" ToolTip="Add" PostBack="true" Visible="true">
                </telerik:RadToolBarButton>
            </Items>
 </telerik:RadToolBar>
<telerik:RadAjaxLoadingPanel ID="MainLoaPan" runat="server"></telerik:RadAjaxLoadingPanel>
<telerik:RadAjaxPanel ID="MainRAjaPan" runat="server" LoadingPanelID="MainLoaPan" ClientEvents-OnResponseEnd="setDivHeight">
 <div id="LeftUDiv" runat="server"
            style="width: 49.5%; height: 100%;
            float:left;
            overflow:hidden;
            border-spacing:inherit;  
            border: 1px solid #aaaaaa;
            background-color:#FFFFFF;">
<div id="LeftU1Div" runat="server"
                style="width: 100%;height: 45%;
                position: relative;
                overflow: auto;
                background-color:#FFFFFF;">
 
                <%--Tasks RadGrid--%>
                <telerik:RadGrid ID="TasksRGriVie" runat="server" AutoGenerateColumns="false" AllowMultiRowSelection="false"
                                        OnSelectedIndexChanged="TasksRGriVie_SelectedIndexChanged" OnPreRender="TasksRGriVie_PreRender"
                                        OnItemDataBound="TasksRGriVie_ItemDataBound">
                    <MasterTableView DataKeyNames="taskID" ClientDataKeyNames="taskID" ShowHeader="false" Width="99%">
                        <Columns>                                                       
                            <telerik:GridBoundColumn DataField="PIBCID" Visible="false" HeaderText="PIBCID" ItemStyle-Font-Size="Smaller"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="FVRItemID" Visible="false" HeaderText="FVRItemID" ItemStyle-Font-Size="Smaller"></telerik:GridBoundColumn>                           
                        </Columns>
                    </MasterTableView>
                    <ClientSettings EnablePostBackOnRowClick="true">
                        <Selecting AllowRowSelect="true" />
                    </ClientSettings>
                </telerik:RadGrid>
            </div>           
            <div id="LeftU2Div" runat="server"
                style="width: 100%;height: 45%;
                position: relative;
                overflow: auto;
                background-color:#FFFFFF;">
 
                <%--Personnel Assigned RadTreeList --%>                    
                <telerik:RadTreeList ID="PersonnelAssignedRTreLst" runat="server" DataKeyNames="ID" ParentDataKeyNames="parent"
                                        OnNeedDataSource="PersonnelAssignedRTreLst_NeedDataSource" AutoGenerateColumns="false"
                                        AllowMultiItemSelection="false" GridLines="None" ShowTreeLines="false" Width="100%" Height="99%"
                                        OnItemDataBound="PersonnelAssignedRTreLst_ItemDataBound" OnItemCommand="PersonnelAssignedRTreLst_ItemCommand"
                                        OnItemCreated="PersonnelAssignedRTreLst_ItemCreated" OnPreRender="PersonnelAssignedRTreLst_PreRender" >
                    <Columns>
                        <telerik:TreeListBoundColumn DataField="CandidateID" UniqueName="rTreeLstPersAsColCandID" Visible="true" ItemStyle-Font-Size="Smaller">
                        </telerik:TreeListBoundColumn>
                        <telerik:TreeListBoundColumn DataField="Desc" UniqueName="rTreeLstPersAsColName" Visible="true" ItemStyle-Font-Size="Smaller">
                        </telerik:TreeListBoundColumn>
                        <telerik:TreeListBoundColumn DataField="QualDesc" UniqueName="rTreeLstPersAsColExp" Visible="true" ItemStyle-Font-Size="Smaller">
                        </telerik:TreeListBoundColumn>                            
                    </Columns>                        
                    <ClientSettings Selecting-AllowItemSelection="true">
                        <ClientEvents OnItemSelected="selTreLstChange" />
                    </ClientSettings>                             
                </telerik:RadTreeList>  
            </div>
   </div>
<div id="RightUDiv" runat="server"
            style="width: 50%; height: 100%;
            float:right;
            overflow:hidden;                   
            border-spacing:inherit;  
            border: 1px solid #aaaaaa;
            background-color:#FFFFFF;">
                     
            <%--Personnel To Assign RadGrid --%>
            <telerik:RadGrid ID="PersonnelToAssignRGriVie" runat="server" AutoGenerateColumns="false"
                             AllowMultiRowSelection="false"
                             OnPreRender="PersonnelToAssignRGriVie_PreRender" AllowSorting="true"
                             OnSortCommand="PersonnelToAssignRGriVie_SortCommand"
                             OnItemDataBound="PersonnelToAssignRGriVie_ItemDataBound">
                <MasterTableView DataKeyNames="ID,UniqueID" ClientDataKeyNames="ID" TableLayout="Auto" Width="100%">
                    <NoRecordsTemplate>
                        No Records to display
                    </NoRecordsTemplate>
                    <Columns>
                        <telerik:GridTemplateColumn UniqueName="Selectcol" HeaderStyle-Width="100px" ItemStyle-Width="80px">
                            <HeaderTemplate>
                                <telerik:RadButton ID="PersonnelAddRBtn" CommandName="PersonnelAddRBtn" CommandArgument="PersonnelAddRBtn"
                                                   runat="server" Text='' Visible="true" Width="95px" >
                                </telerik:RadButton>                                
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:Image ID="imgTrain" ToolTip="Requires Training" runat="server" Visible="false" ImageUrl="~/VS/Images/icon_emark1.gif" Width="10" Height="10" onclick="openTrainingInfo(this);" />
                                <asp:CheckBox ID="chkSelPersonnel" runat="server" Visible="true" onclick="checkSpan(this);" />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn DataField="CandidateID" AllowSorting="true" HeaderText="Candidate ID" UniqueName="CandidateIDCol" SortExpression="CandidateID" ItemStyle-Font-Size="Smaller">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Desc" AllowSorting="true" HeaderText="Name" UniqueName="NameCol" SortExpression="Desc" ItemStyle-Font-Size="Smaller">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="CompName" AllowSorting="true" HeaderText="Company" UniqueName="CompNameCol" SortExpression="CompName" ItemStyle-Font-Size="Smaller">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="QualDesc" AllowSorting="true" HeaderText="Qualified" UniqueName="QualDescCol" SortExpression="QualDesc" ItemStyle-Font-Size="Smaller">
                        </telerik:GridBoundColumn>
                    </Columns>
                </MasterTableView>
                <SortingSettings EnableSkinSortStyles="false" />
                <ClientSettings>
                    <Selecting AllowRowSelect="false" />
                    <Resizing AllowColumnResize="false" />
                    <Scrolling AllowScroll="true" UseStaticHeaders="true" SaveScrollPosition="true" />
                </ClientSettings>
            </telerik:RadGrid>
 
        </div>
</telerik:RadAjaxPanel>

The way of working is the next, when selecting a item from TaskRadGridView, we load data from the database:
Protected Sub TasksRGriVie_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim AuxTaskId As Integer
        If TasksRGriVie.SelectedItems.Count > 0 Then
            Dim item As GridDataItem = TasksRGriVie.SelectedItems(0)
            AuxTaskId = CInt(item.GetDataKeyValue("taskID"))          
            LoadTaskDetails(AuxTaskId)
        End If
    End Sub
 
Sub LoadTaskDetails(ByVal selTaskID As Integer)
        If TasksRGriVie.Items.Count > 0 Then
 
            Dim auxQual As Integer = CInt(Me.SelQualHidFie.Value)
           
            Dim curContractor As Integer = Session("CompanyID")
 
            Dim objtask As OQCrewItem = listTask.Find(Function(c) c.taskID = selTaskID)
            
            'Loads the list view with the current personnal
             Dim ListPerAs As New List(Of OQCrewPersonnel)
             'Getting data from the view state
             If selTaskID > 0 Then
                  'listTask a property that gets data from viewState('listtask')
                  ListPerAs = listTask.Find(Function(c) c.taskID = selTaskID).personnel
                  PersonnelAssignedRTreLst.DataSource = ListPerAs.Where(Function(c) c.statusID = 1).OrderByDescending(Function(c) c.lastName).ToList()
        End If
 
            'Gets list of personnel
            Dim listAvailablePer = OQProjectBL.GetAvailableCrewPersonnel()           
            
           Dim list = listAvailablePer.Where(Function(c) c.qualified = "Yes").OrderBy(Function(c1) c1.lastName).ToList()         
            PersonnelToAssignRGriVie.DataSource = list
            PersonnelToAssignRGriVie.DataBind()
        End If
    End Sub
The when we select (highlight) a node from the RadTreeList PersonnelAssignedRTreLst, we get the data for PersonnelToAssignGriView, from the PersonnelToAssignGriView we can select (check) several items then when we click on the button PersonnelAddRBtn 
on the header of this item we should add those items to PersonnelAssignedRTreLst, the problem occurs when the list of items related to the PersonnelToAssignGriView  is like 500 rows, there is a problem when click on the PersonnelAddRBtn 
Button from the header, it does not make a postback I get this error. Uncaught Sys.WebForms.PageRequestManagerParserErrorException: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. It doesn't make a postback, I search in the web, I'm not using Response.write  anywhere. Thinking that the problem could be that the button is inside the radajaxpanel i set a button Add on the RadToolBar, but i get a similar error, it never goes to the function established on the serverside, i set a debugger on the JS function selBut that executes onClientButtonClicking event, then i got an exception on telerik code on line 6224 see that on image related.
There is another odd behavior of the page, in some computers there isn't any exception, could be a configuration that i'm missing?.

Javier

Iana Tsolova
Telerik team
 answered on 09 Jul 2012
1 answer
168 views
Hello there,

I am getting two columns from database (using SQL Data Source) namely points and month, I am summing the points based on month number for example a person gained 500 points in month 6 (which means June). The data appears in this format.

500, 6
1100, 7
900, 8
430 9

and so on...

Now I am binding the points (the first column) to y-axis of rad chart and month number to x-axis. But I want x-axis values to appear as month names instead of numeric values like June or Jun for 6, July or Jul for 7 and so on...

How can I convert xaxis numeric values to month names ?

Thanks.
Petar Kirov
Telerik team
 answered on 09 Jul 2012
1 answer
127 views
I have a MultiView control, and on View2 I have several LinkButtons, GridView, RadScheduler and RadListBox with check boxes on every item. I want to be able to update the whole View2 on  RadScheduler_AppointmentUpdate event. How can I accomplish that? I've used RadAjaxManager and have set AjaxControlID="RadScheduler" . For AjaxUpdatedControl I've set View2 and got the error: "Controls added to a ViewCollection must be of type View"
On THIS thread you said that I should wrap the whole MultiView with a Panel. But after I do that, I'm not able to check any checkbox inside RadListBox. Edit: Checking RadListBox items is essential for populating appointments in RadScheduler.
Is it possible to refresh a MultiView's view on RadScheduler_AppointmentUpdate event?
Iana Tsolova
Telerik team
 answered on 09 Jul 2012
1 answer
99 views
Hello,

I am pretty new to Rad controls, so please point me to articles that help explain this, but this is what I am trying to do.

I used a RadGrid control on my page, and included a GridTemplateColumn column in my grid by implementing the ITemplate interface. The template column is essentially a list of items in a drop down. This is working beautifully, but now I want the rest of the columns in the row to be updated accordingly when a user changes a value in the drop down of this Template column. I want to do this without doing a complete postback to the server.

Any help on how I can do this *correctly* would be greatly appreciated. I have been reading various articles and trying out things, but nothing is working too well.

Also, I don't know if this matters, but the data for my grid and the structure of the grid is completely created at run time without using any SqlDataSource controls.

Appreciate any input,
Thank you!
Eyup
Telerik team
 answered on 09 Jul 2012
2 answers
83 views
Hello, I have a rotator which it implements a ascx, and in the ascx there is a linkbutton that it opens a tooltip who implements other ascx.

It works fine in IE, but in Firefox and Chrome the button doesn't work, it is disabled.

<telerik:RadRotator ID="RadRotator1" runat="server" Width="900px" Height="300" ItemWidth="450px"
ItemHeight="300" ScrollDuration="500" RotatorType="Buttons" OnDataBound="RadRotator1_DataBound"
OnClientItemShown="OnClientItemShown">
    <ItemTemplate>
         <uc1:Component ID="Component0" runat="server"></uc1:Component>
    </ItemTemplate>
  
    <ControlButtons LeftButtonID="leftArrow" RightButtonID="rightArrow" />
</telerik:RadRotator>

Ascx
<telerik:RadToolTipManager ID="RadToolTipManager1" OffsetY="-1" HideEvent="LeaveToolTip"
            Width="800" Height="400" runat="server" EnableShadow="true"
            OnAjaxUpdate="OnAjaxUpdate" RelativeTo="BrowserWindow"
            Position="TopCenter" BackColor="#D6D6D6" ShowEvent="OnClick"
            Modal="True" ManualCloseButtonText="Cerrar" Skin="Default"
        ManualClose="True" AutoCloseDelay="2000000" >
               <TargetControls>
                   <telerik:ToolTipTargetControl IsClientID="False"
                       TargetControlID="btnVer" Value="" />
               </TargetControls>
         </telerik:RadToolTipManager>
 
<asp:LinkButton ID="btnVer" runat="server" >
                        <img id="Img1" alt="" src="~/Imagenes/Botones/btn_ver_anuncio.png" runat="server" border="0" />
                    </asp:LinkButton>
Niko
Telerik team
 answered on 09 Jul 2012
3 answers
115 views
hi,

In the first use, AllowedFileextensions is unavailable. In the second click select button then is available. I want to when i click select only the allowed extension is available or deleting unavailable selection.And there is another question that I want to put limitation for multiple selection. i do it. But unavailable selection is still seeing. how would i delete them.

best wishes,
ömer

Plamen
Telerik team
 answered on 09 Jul 2012
1 answer
92 views
Dear All,

I have RadGrid in my page here when i binding my grid not data displaying in grid.but i can get data and there showing count and data everything but i cant showing that in grid..what i missed .. my code is

Thanks in Advance..!
protected void Page_Load(object sender, EventArgs e)
        {        
            if (!Page.IsPostBack)
            {
                RadGrid1.DataSource = applicationProcess.SelectLocations();
                RadGrid1.DataBind();
            }
}
Princy
Top achievements
Rank 2
 answered on 09 Jul 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?