Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
184 views
I've been searching through the documentation to do a simple server-side select and access the data in that row. I found this page here (http://www.telerik.com/help/aspnet-ajax/grid-retrieve-primary-key-field-values-for-items.html) and used a line from the sample code:

RadGrid1.SelectedItems[0].GetDataKeyValue("CustomerID").ToString()

Visual Studio gives me an error of "'Telerik.Web.UI.GridItem' does not contain a definition for 'GetDataKeyValue' and no extension method 'GetDataKeyValue' accepting a first argument of type 'Telerik.Web.UI.GridItem' could be found (are you missing a using directive or an assembly reference?)"

I tried a different route using this:

grd.SelectedItems[0].Cells[1].Text

but this doesn't return anything at runtime, regardless of the index I use for the cells collection.

Please advise. Thanks guys!

Darren
Top achievements
Rank 2
 answered on 09 Jul 2012
2 answers
148 views
The project got a RadSlider, a RadNumericTextBox and a Label. Changing values ​​RadSlider the value shown in RadNumericTextBox, Label displays the function result (deposit + interest).

The problem is that I can not create an event that would change the values ​​in RadNumericTexBox (change clients) value delegated to RadSlider.

<script type="text/javascript">
        function ManualValueChange(sender, eventArgs) {
            $get("CalcSlider").value = sender.get_newValue();
        }
    </script>
    <telerik:RadAjaxManager ID="PpAjaxManager" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="CalcSlider">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="CalcSliderDeposit" UpdatePanelRenderMode="Inline" />
                    <telerik:AjaxUpdatedControl ControlID="lblYouHave" UpdatePanelRenderMode="Inline" />
                    <telerik:AjaxUpdatedControl ControlID="lblprofit" UpdatePanelRenderMode="Inline" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="CalcSliderDeposit">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="CalcSlider" UpdatePanelRenderMode="Inline" />
                    <telerik:AjaxUpdatedControl ControlID="lblYouHave" UpdatePanelRenderMode="Inline" />
                    <telerik:AjaxUpdatedControl ControlID="lblprofit" UpdatePanelRenderMode="Inline" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
   <div class="typeCalc">
                    <br />
                    <table style="width: 640px; margin: 0 auto;">
                        <tr>
                            <td colspan="2" style="height: 20px; text-align: center">
                                <h3>
                                    BondMarketers Invest Plan</h3>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" style="height: 80px; border-top: 1px solid gray; text-align: center">
                                <telerik:RadSlider ID="CalcSlider" runat="server" Skin="Black" MinimumValue="0" MaximumValue="10000"
                                    LargeChange="2000" SmallChange="10" Width="650px" Height="65px" ItemType="Tick"
                                    TrackPosition="TopLeft" AnimationDuration="600" ShowDragHandle="false" OnValueChanged="CalcSliderValueChanged"
                                    AutoPostBack="true">
                                </telerik:RadSlider>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" style="height: 20px">
                                  
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 200px; text-align: center">
                                Invest:
                            </td>
                            <td>
                                <telerik:RadNumericTextBox runat="server" ID="CalcSliderDeposit" Type="Currency"
                                    Culture="en-US" DataType="System.Decimal" AutoPostBack="true">
                                    <ClientEvents OnValueChanged="ManualValueChange" OnLoad="ManualValueChange" />
                                </telerik:RadNumericTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" style="height: 20px">
                                  
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 200px; text-align: center">
                                <asp:Label runat="server" ID="lblYouHave" />
                            </td>
                            <td>
                                <asp:Label runat="server" ID="lblprofit" Font-Bold="True" Font-Size="Larger" ForeColor="Green" />
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" style="height: 20px">
                                  
                            </td>
                        </tr>
                    </table>
                </div>


Method to change the values​​:

protected void CalcSliderValueChanged(object sender, EventArgs e)
       {
           double percent = FormulaLayer.FormulaValue((decimal)CalcSlider.Value);
           decimal deposit = (decimal)CalcSlider.Value;
           int percents = 100;
 
           DateTime sDate = DateTime.Now;
           DateTime eDate = DateTime.Now.AddDays(365);
 
           CalcSliderDeposit.Value = Convert.ToDouble(deposit);
            
                
           lblYouHave.Text = "You have: ";
 
           lblprofit.Text = string.Format("${0}", ((Convert.ToDouble(deposit) / percents) * percent * Convert.ToDouble(FormulaLayer.GetWorkDayCount(sDate, eDate)) + Convert.ToDouble(CalcSlider.Value)));
       }


Thanks for any help.

Sorry for my bad english... :D
Patrik
Top achievements
Rank 2
 answered on 09 Jul 2012
1 answer
315 views
What I am trying to do is uncheck another checkbox in the same row. I want to have a subscribe and unsubscribe checkbox columns. So when you click on subscribe the unsubscribe checkbox should uncheck and vise versa. I found a lot of entries that are similar in the forums but didnt come across anything in this. Found something in the old ASP forum but its not working. Below is what I ahve.

Source
<telerik:RadGrid ID="grdPubList" runat="server" Skin="Office2007" GridLines="None"
                                               AutoGenerateColumns="False" AllowNaturalSort="false" CellSpacing="0">
                                               <HeaderStyle Width="100px" HorizontalAlign="Center" />
                                               <ClientSettings>
                                                   <Selecting CellSelectionMode="None"></Selecting>
                                               </ClientSettings>
                                               <MasterTableView AllowMultiColumnSorting="true" ShowHeadersWhenNoRecords="false">
                                                   <NoRecordsTemplate />
                                                   <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
                                                   <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                                                   </RowIndicatorColumn>
                                                   <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                                                   </ExpandCollapseColumn>
                                                   <Columns>
                                                       <telerik:GridTemplateColumn ItemStyle-Width="250px" HeaderStyle-Width="250px" ItemStyle-HorizontalAlign="Left"
                                                           ItemStyle-VerticalAlign="Top" HeaderText="Publication Name">
                                                           <ItemTemplate>
                                                               <asp:Label ID="lblPubId" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.PubID").ToString() %>'
                                                                   CssClass="label_default_nb" Visible="false"></asp:Label>
                                                               <asp:Label ID="lblPubName" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Name").ToString() %>'
                                                                   CssClass="label_default_nb"></asp:Label>
                                                           </ItemTemplate>
                                                           <HeaderStyle Width="250px"></HeaderStyle>
                                                           <ItemStyle HorizontalAlign="Left" VerticalAlign="Top" Width="250px"></ItemStyle>
                                                       </telerik:GridTemplateColumn>
                                                       <%--<telerik:GridBoundColumn HeaderText="Practice Area" DataField="departmentDescription"
                                                           AllowSorting="false" ItemStyle-HorizontalAlign="Left" ItemStyle-VerticalAlign="Top"
                                                           ItemStyle-Width="100px" HeaderStyle-Width="50px">
                                                           <HeaderStyle Width="50px"></HeaderStyle>
                                                           <ItemStyle HorizontalAlign="Left" VerticalAlign="Top" Width="100px"></ItemStyle>
                                                       </telerik:GridBoundColumn>--%>
                                                       <%--<telerik:GridTemplateColumn ItemStyle-HorizontalAlign="Center" ItemStyle-Wrap="False"
                                                           ItemStyle-VerticalAlign="Top" HeaderText="Modified <br> By/Date" UniqueName="ModifiedByDate"
                                                           ItemStyle-Width="100px" HeaderStyle-Width="100px">
                                                           <ItemTemplate>
                                                               <asp:Label ID="lblUserModified" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.userModified").ToString() %>'
                                                                   CssClass="label_default_nb" Width="100px"></asp:Label>
                                                               <asp:Label ID="lblDateModified" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.dateModifiedStr").ToString() %>'
                                                                   CssClass="label_default_nb" Width="100px"></asp:Label>
                                                           </ItemTemplate>
                                                       </telerik:GridTemplateColumn>--%>
                                                       <telerik:GridTemplateColumn FilterControlAltText="Filter TemplateColumn1 column"
                                                           HeaderText="Format" UniqueName="typeDescription" DataField="typeDescription">
                                                           <ItemTemplate>
                                                               <asp:Label ID="lblPubType" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.typeDescription").ToString() %>'
                                                                   CssClass="label_default_nb"></asp:Label>
                                                           </ItemTemplate>
                                                       </telerik:GridTemplateColumn>
                                                       <telerik:GridTemplateColumn HeaderText="Subscribe">
                                                           <ItemTemplate>
                                                               <asp:CheckBox ID="radchkSubscribe" runat="server" />
                                                           </ItemTemplate>
                                                       </telerik:GridTemplateColumn>
                                                       <telerik:GridTemplateColumn HeaderText="Unsubscribe">
                                                           <ItemTemplate>
                                                               <asp:CheckBox ID="radchkUnsubscribe" runat="server" />
                                                           </ItemTemplate>
                                                       </telerik:GridTemplateColumn>
                                                   </Columns>
                                                   <EditFormSettings>
                                                       <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                                       </EditColumn>
                                                   </EditFormSettings>
                                               </MasterTableView>
                                               <FilterMenu EnableImageSprites="False">
                                               </FilterMenu>
                                           </telerik:RadGrid>


VB code in the page. 
Private Sub grdPubList_ItemCreated(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles grdPubList.ItemCreated
      If TypeOf e.Item Is GridDataItem Then
          Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)
          Dim chk1 As CheckBox = DirectCast(item.FindControl("radchkSubscribe"), CheckBox)
          Dim chk2 As CheckBox = DirectCast(item.FindControl("radchkUnsubscribe"), CheckBox)
          'Dim chk3 As CheckBox = DirectCast(item.FindControl("CheckBox3"), CheckBox)
          chk1.Attributes.Add("onclick", (("checkUncheck('" + chk1.ClientID & "','") + chk2.ClientID & "',')"))
           
      End If
  End Sub


Javascript in masterpage. Though i think the ch2.checked should be false in the if and true in the else.
<script type="text/javascript">
       function checkUncheck(c1, c2) {
           var ch1 = document.getElementById(c1);
           var ch2 = document.getElementById(c2);
 
           if (ch1.checked) {
               ch2.checked = true;
 
           }
           else {
               ch2.checked = false;
 
           }
       }    
   </script>

Casey
Top achievements
Rank 1
 answered on 09 Jul 2012
1 answer
140 views
I have a switch statement in a javascript function that performs different actions based on the type of control that is being passed, however the sender.type of the RadComboBox is null. How do I get the type?

here is my javascript function:

function RefreshCsiOptions(sender) {
            switch (sender.type) {
                case "radio":
                    if (sender.checked == true) {
                        for (i = 0; i < cbxCSI.length; i++) {
                            var z = rcbCSI[i];
                            if (rcbCSI[i].get_selecteditem().get_value() != "") { rcbCSI[i].disabled = "disabled"; } else { cbxCSI[i].disabled = true; }
                            cbxCSI[i].checked = false;
                        }
                        lblWithoutCSI.disabled = "";
                    }
                    break;
                case "checkbox":
                    var cbxNumber = sender.id.substr(6, 1);
                    if (sender.checked == true) {
                        rcbCSI[cbxNumber - 1].disabled = "";
                        lblWithoutCSI.disabled = "disabled";
                        rbWITHOUT.checked = false;
                    } else {
                        rcbCSI[cbxNumber - 1].disabled = "disabled";
                    }
                    CheckWithoutStatus();
                    break;
                case "select-one":
                    var rcbNumber = sender.id.substr(14, 1);
                    if (rcbNumber == "_") rcbNumber = "0";
                    var rcbValue = rcbCSI[rcbNumber].get_selecteditem().get_value();
                    document.Form1.elements['CSI' + rcbNumber + '_value'].value = rcbValue;
                    if (rcbValue != "") {
                        cbxCSI[rcbNumber].disabled = false;
                        cbxCSI[rcbNumber].checked = true;
                        if (rbWITHOUT.checked == true) rbWITHOUT.checked = false;
                    } else {
                        cbxCSI[rcbNumber].disabled = true;
                        cbxCSI[rcbNumber].checked = false;
                        CheckWithoutStatus();
                    }
                    break;
                default:
                    //alert(sender.type);
                    break;
            }
        }  
Nencho
Telerik team
 answered on 09 Jul 2012
6 answers
169 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
108 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
179 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
154 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
194 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
153 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?