Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
64 views
I want to create Radgrid using asp.net codebehind aspx.cs file and assign datasource from the client side .aspx file. Can some one help me with the code to achieve the same? I came across some client settings. how to set the same if I need to do? can I set autogenerate columns to true? as the data is will dynamically change.
Maria Ilieva
Telerik team
 answered on 10 Dec 2014
3 answers
125 views
Hi, can someone teach me how to auto expand the child item when the parent item was selected by giving sample code?

In ItemCommand, the command name is  "ItemClick".

Here is my JavaScript:
<script type="text/javascript">
       var parenItemSelected = false;
       function OnClientNodeClicked(sender, args) {
           var currNode = args.get_item();
           var childNodes = currNode.get_childItems();
           var nodeCount = currNode.get_childItems().length;
           var parentItem = currNode.get_parentItem();
 
           if (parentItem) {
 
               parenItemSelected = true;
               parentItem.set_selected(true);
           }
 
           if (currNode.get_selected()) {
               CheckAllChildren(childNodes, nodeCount);
           }
           else {
               UnCheckAllChildren(currNode, childNodes, nodeCount);
           }
           parenItemSelected = false;
       }
 
       function UnCheckAllChildren(currNode, nodes, nodecount) {
           var i;
           for (i = 0; i < nodecount; i++) {
               nodes[i].set_selected(false);
           }
           currNode.set_selected(false);
       }
 
       function CheckAllChildren(nodes, nodecount) {
           var i;
 
           if (!parenItemSelected) {
               for (i = 0; i < nodecount; i++) {
                   nodes[i].set_selected(true);
               }
           }
       }
   </script>

UI design:
01.<telerik:RadTreeList ID="RadTreeList1" runat="server" AutoGenerateColumns="False" DataKeyNames="id" ParentDataKeyNames="ParentId" CellSpacing="0" GridLines="None" OnNeedDataSource="RadTreeList1_NeedDataSource" HideExpandCollapseButtonIfNoChildren="true" AllowMultiItemSelection="true" OnPreRender="RadTreeList1_PreRender" OnItemCommand="RadTreeList1_ItemCommand" OnItemDataBound="RadTreeList1_ItemDataBound">
02.<Columns>
03.<telerik:TreeListBoundColumn DataField="id" HeaderText="access_id" UniqueName="access_id" DataType="System.decimal" ReadOnly="True" SortExpression="access_id" Display="false"></telerik:TreeListBoundColumn>
04.<telerik:TreeListBoundColumn DataField="access_code" HeaderText="Access Right" UniqueName="role_access_access_id" ReadOnly="True" SortExpression="access_code"></telerik:TreeListBoundColumn>
05.<telerik:TreeListBoundColumn DataField="ParentId" HeaderText="Parent ID" UniqueName="ParentId" ReadOnly="True" SortExpression="ParentId" Display="false"></telerik:TreeListBoundColumn>
06.<telerik:TreeListSelectColumn UniqueName="SelectColumn" HeaderText="Select Menu" ></telerik:TreeListSelectColumn>
07.</Columns>
08. <ClientSettings AllowPostBackOnItemClick="true">
09.<ClientEvents OnItemDeselected="OnClientNodeClicked" OnItemSelected="OnClientNodeClicked"  />
10.<Selecting AllowItemSelection="true" />
11.</ClientSettings>
12.</telerik:RadTreeList>

and the code:
1.Protected Sub RadTreeList1_NeedDataSource(sender As Object, e As TreeListNeedDataSourceEventArgs)
2.        Try
3.            Dim gvAccess = DirectCast(sender, RadTreeList)
4.            gvAccess.DataSource = GetAccessMenuView().ToList
5.        Catch ex As Exception
6.            InformationBox.DisplayError(ex)
7.        End Try
8.End Sub

i had try this,  but not work.
1.Protected Sub RadTreeList1_PreRender(sender As Object, e As EventArgs)
2.        Dim RadTreeList1 = DirectCast(sender, RadTreeList)
3.        If parentIndex IsNot Nothing Then
4.            Dim parent As TreeListDataItem = RadTreeList1.Items(CInt(parentIndex))
5.            RadTreeList1.ExpandItemToLevel(parent, parent.HierarchyIndex.NestedLevel + 1)
6.        End If
7.End Sub

Kostadin
Telerik team
 answered on 10 Dec 2014
1 answer
599 views
Hello guys,

Can't anyone help me?, I'm new in ASP.NET and Telerik.

I do have problem, I can't disable the button in my grid.

I put RadButton in GridTemplateColumn in my grid. This is the hierarchy that I mean :

RadGrid
    MasterTableView
        Column
            GridTemplateColumn
                     ItemTemplate
                       --------->RadButton
                      /ItemTemplate
            /GridTemplateColumn

            GridBoundColumn
            /GridBoundColumn
        /Column

I use RadGrid_NeedDataSource for the data source. I want to disable RadButton if the value in other GridBoundColumn "yes", and if  the value is "No" RadButton will be able.

Do you get it what I meant?
Konstantin Dikov
Telerik team
 answered on 10 Dec 2014
11 answers
648 views
can this be done?
Konstantin Dikov
Telerik team
 answered on 10 Dec 2014
1 answer
110 views
Hello Team,

I am using Telerik RadEditor  and having Design and HTML as Edit Mode ,but problem is when I select HTML mode , it gets change to Design after postback event.

Could you please help, how can I keep the last selected Edit mode(Design or HTML) after postback event.

Thanks
Afroz Khan
Ianko
Telerik team
 answered on 10 Dec 2014
8 answers
98 views
it seems IE 11 has issues with RadAsyncupload control. it works fine in IE9, but in IE 11 the page typically freezes (yellow dot for upload control) .


<telerik:RadAsyncUpload runat="server" ID="RadAsyncUpload1" MaxFileInputsCount="1" Localization-Select="Browse"
HideFileInput="true" MultipleFileSelection="Disabled" AllowedFileExtensions=".pdf" MaxFileSize="1000000" OnClientValidationFailed="ValidationFailed"/>
Peter Filipov
Telerik team
 answered on 10 Dec 2014
1 answer
85 views
Hi I am trying to use the RadGrid and I keep getting the following Error:

The Controls collection cannot be modified because the control contains code blocks

Any help would be much appreciated.

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="PluginViewAndDownloadBillData.ascx.cs" Inherits="VIPEnergyClientPortal.Plugins.PluginViewAndDownloadBillData" %>
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
<telerik:RadScriptManager ID="sm1" runat="server" EnableTheming="True">
    <Scripts>
        <asp:ScriptReference Assembly="Telerik.Web.UI"
            Name="Telerik.Web.UI.Common.Core.js">
        </asp:ScriptReference>
        <asp:ScriptReference Assembly="Telerik.Web.UI"
            Name="Telerik.Web.UI.Common.jQuery.js">
        </asp:ScriptReference>
        <asp:ScriptReference Assembly="Telerik.Web.UI"
            Name="Telerik.Web.UI.Common.jQueryInclude.js">
        </asp:ScriptReference>
    </Scripts>
</telerik:RadScriptManager>

<telerik:RadGrid ID="RadGrid1" runat="server" GroupPanelPosition="Top"
    ResolvedRenderMode="Classic" AllowFilteringByColumn="True"
    DataSourceID="UtilityAccounts">
    <MasterTableView AutoGenerateColumns="False" DataSourceID="UtilityAccounts">
        <Columns>
            <telerik:GridBoundColumn DataField="LocationID"
                DataType="System.Guid"
                FilterControlAltText="Filter LocationID column"
                HeaderText="LocationID" SortExpression="LocationID"
                UniqueName="LocationID">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="AccountNumber"
                FilterControlAltText="Filter AccountNumber column"
                HeaderText="AccountNumber"
                SortExpression="AccountNumber"
                UniqueName="AccountNumber">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Utility"
                FilterControlAltText="Filter Utility column"
                HeaderText="Utility"
                SortExpression="Utility"
                UniqueName="Utility">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Commodities"
                FilterControlAltText="Filter Commodities column"
                HeaderText="Commodities"
                SortExpression="Commodities"
                UniqueName="Commodities" ReadOnly="True">
            </telerik:GridBoundColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

<asp:ObjectDataSource ID="UtilityAccounts" runat="server"
    SelectMethod="UtilityAccountData"
    TypeName="VIPEnergyClientPortal.Plugins.PluginViewAndDownloadBillData">
    <SelectParameters>
        <asp:ControlParameter ControlID="txtAccountNumber" DbType="Guid"
            Name="LocationID" PropertyName="Text" />
    </SelectParameters>
</asp:ObjectDataSource>

<asp:TextBox ID="txtAccountNumber" runat="server" Visible="false"></asp:TextBox>
Viktor Tachev
Telerik team
 answered on 10 Dec 2014
1 answer
95 views
Hi 

Is there any way to achieve this? i would like to have a 'load more' button at the end of the list which posts back to server and then adds more data. 
This needs to be server side and NOT javascript please.

Thanks in advance!

Regards
Sean
Maria Ilieva
Telerik team
 answered on 10 Dec 2014
1 answer
30 views
I am attempting to validate some data in a cell before the datasource of the grid gets modified.

Which event would allow me to inspect this cell after the user has left the cell, but before the datasource is modified?
Viktor Tachev
Telerik team
 answered on 10 Dec 2014
1 answer
83 views
When loading a save grid setting all of the filtering, grouping and sorting is display correctly.  The problem is with the columns that are Checklist list not showing the filter icon as highlight and when you click on the icon the filter checklist items are not checked (loaded through the FilterCheckListItemsRequested event).  Is there a way to highlight the filter icon and check the appropriate items in the list?
Viktor Tachev
Telerik team
 answered on 10 Dec 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?