Telerik Forums
UI for ASP.NET MVC Forum
3 answers
185 views

Hi,

 I was wondering if there is a way to disable child check boxes when parent check boxes have been disabled. I have used the selectableMode property to disable parent checkbox but am running into issue disabling child checkbox using same property.

 C#:

//This is for disabling child checkbox
 
protected void BindChildGrid(GridDataItem parentItem)
 
        {
            var ucQuoteRows = parentItem.ChildItem.FindControl("ucExpiringRealServices") as UserControls.CustomerGrid;
            CheckBox checkBox = (CheckBox)parentItem["BulkActionSelect"].Controls[0];
             
            if (ucQuoteRows != null)
            {
                checkBox.Attributes.Add("data-customergridid", ucQuoteRows.ClientID);
                //var envelopeName = parentItem.GetDataKeyValue("Name");
                ucQuoteRows.ParentId = parentItem.GetDataKeyValue("ObjectId").ToString();
                /*ucQuoteRows.ExportFileNamePrefix = envelopeName.ToString();
                ucQuoteRows.TaInfoEnable = RoleEngine.CurrentUserHasTARead();*/
                //BindCustomerGrid(ucQuoteRows, null);
                if (parentItem.SelectableMode == GridItemSelectableMode.None)
                {
                    ucQuoteRows.AllowSelection = false;
                }
                else if (parentItem.SelectableMode == GridItemSelectableMode.ServerAndClientSide)
                {
                    ucQuoteRows.AllowSelection = true;
                }
                ucQuoteRows.ColumnCollection = null;
                ucQuoteRows.Rebind();
            }
        }
 
  
 
//this correctly disables parent checkbox
protected void rgExpiringServices_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                 
                var dataItem = ((GridDataItem)e.Item);
                var ObjectId = Guid.Parse(dataItem.GetDataKeyValue("ObjectId").ToString());
 
                e.Item.SelectableMode = this.DisabledIds.Contains(ObjectId) ? GridItemSelectableMode.None : GridItemSelectableMode.ServerAndClientSide;
 
            }
        }

aspx:

<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ExpiringServices.aspx.cs" Inherits="FNA.NRTT.Website.Customer.Service.ExpiringServices" %>
<%@ Register TagPrefix="nrtt" TagName="CustomerGrid" Src="~/UserControls/CustomerGrid.ascx" %>
<%@ Register TagPrefix="nrtt" TagName="DisplayClientDefinedField" Src="~/UserControls/DisplayClientDefinedField.ascx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <h2><asp:Literal ID="ltPageTitle" runat="server" Text="<%$ Resources:NrttLanguage, Services %>"></asp:Literal></h2>
 
    <asp:DropDownList ID="ddlInterval" runat="server" style="text-align:right" OnSelectedIndexChanged="ddlInterval_SelectedIndexChanged" AutoPostBack="true">
        <asp:ListItem Text="30 days" Value="0" />
        <asp:ListItem Text="90 days" Value="1" />
        <asp:ListItem Text="Forever" Value="2" />
    </asp:DropDownList>
    <br />
    <nrtt:DisplayClientDefinedField runat="server" ID="ucDisplayCDFS" OnNeedCdfDefinitions="ucDisplayCDFS_NeedCdfDataDefinition" OnFilterChanged="ucDisplayCDFS_FilterCDFS"/>
    <telerik:RadGrid ID="rgExpiringServices" OnNeedDataSource="rgExpiringServices_NeedDataSource" OnItemCommand="rgExpiringServices_ItemCommand" AllowFilteringByColumn="true" OnPreRender="rgExpiringServices_PreRender" runat="server" Skin="Black" AllowMultiRowSelection="true" OnItemDataBound="rgExpiringServices_ItemDataBound" AllowPaging="true">
        <ClientSettings Selecting-AllowRowSelect="true" Selecting-UseClientSelectColumnOnly="true" ClientEvents-OnRowSelected="nestedGridRowSelected" ClientEvents-OnRowDeselected="nestedGridRowDeselected"></ClientSettings>
        <MasterTableView DataKeyNames="ObjectId, Name" AutoGenerateColumns="false" ShowFooter="true" HierarchyLoadMode="ServerOnDemand" EnableHierarchyExpandAll="true" AllowFilteringByColumn="true">
            <Columns>
                <telerik:GridClientSelectColumn UniqueName="BulkActionSelect" HeaderText="<%$ Resources:NrttLanguage, BulkAction %>" ></telerik:GridClientSelectColumn>
                <telerik:GridButtonColumn ButtonType="ImageButton" ButtonCssClass="btnTiny btnApprove" UniqueName="Renew" CommandName="Renew" ImageUrl="~/Images/blank16.png" HeaderStyle-Width="16px" ItemStyle-Width="16px" ></telerik:GridButtonColumn>
                <telerik:GridButtonColumn ButtonType="ImageButton" ButtonCssClass="btnTiny btnDelete" UniqueName="Terminate" CommandName="Terminate" ImageUrl="~/Images/blank16.png" HeaderStyle-Width="16px" ItemStyle-Width="16px" ></telerik:GridButtonColumn>
                <telerik:GridNumericColumn UniqueName="Name" DataField="Name" HeaderText="<%$ Resources:NrttLanguage, CustomerReference %>" DataType="System.String"> </telerik:GridNumericColumn>
                <telerik:GridDateTimeColumn DataField="DateExpiration" DataType="System.DateTime" FilterControlAltText="Filter DateImportant column" HeaderText="<%$ Resources:NrttLanguage, DateExpiring%>" SortExpression="DateImportant" UniqueName="DateImportant" DataFormatString="{0:d}" >
                </telerik:GridDateTimeColumn>
                <telerik:GridNumericColumn UniqueName="Daysuntilexpired" DataField="DaysUntilExpiration" HeaderText="<%$ Resources:NrttLanguage, daysuntilexpired %>" > </telerik:GridNumericColumn>
                <telerik:GridBoundColumn UniqueName="Services" DataField="ServiceInReferenceString" HeaderText="<%$ Resources:NrttLanguage, Services %>" ></telerik:GridBoundColumn>
                <telerik:GridNumericColumn UniqueName="Parcelcount" DataField="RealInReference" HeaderText="<%$ Resources:NrttLanguage, ParcelCount %>" > </telerik:GridNumericColumn>
            </Columns>
            <NestedViewTemplate>
                <nrtt:CustomerGrid ID="ucExpiringRealServices" runat="server" AllowSelection="true" OnNeedDataSource="ucExpiringRealServices_NeedDataSource" OnNeedColumnCollection="ucExpiringRealServices_NeedColumnCollection" OnItemDataBound="ucExpiringRealServices_ItemDataBound" ></nrtt:CustomerGrid>
            </NestedViewTemplate>
        </MasterTableView>
    </telerik:RadGrid>
    <div style="text-align:right">
        <asp:RadioButton ID="Extend" Text="Extend" Checked="true" GroupName="whattodo" runat="server" />
        <asp:RadioButton ID="Terminate" Text="Terminate" Checked="false" GroupName="whattodo" runat="server" />
        <telerik:RadButton ID="rbtnSubmitSelection" runat="server" Text="<%$ Resources:NrttLanguage, RequestPayment %>" Skin="Black" SingleClick="true" OnClick="rbtnSubmitSelection_Click"></telerik:RadButton>
    </div>
</asp:Content>

Konstantin Dikov
Telerik team
 answered on 29 Dec 2015
3 answers
123 views

can someone tell me why this is not working? I am trying to puss the ID of the video to GetVideoDuration().

<script type="text/x-kendo-template" id="template">
 
   <div class="duration"
        @{string VID = "VID";}                                                            
        @VID.Replace("Vimeo_ID", "${VID}")
        @MultimediaController.GetVideoDuration(VID)
    </div>
 
</script>

Second line display the correct VID on every record. But when  GetVideoDuration() is getting executed the value passed is VID string not the actual number.

multimedia controller.

public static string GetVideoDuration(string VID)
{
            string strDuration = string.Empty;
}

Dimiter Madjarov
Telerik team
 answered on 25 Dec 2015
1 answer
397 views
I have a grid that I'm binding from the database and I have a search box for the users to find rows in the grid. I'm using Autocomplete for the search box. I want the autocomplete to list values from all columns and not just one field. I have a string array with all the values or filtered using where on the search term in my Controller but I'm not sure how to bind this array to the Autocomplete UI in the view. Can someone help me here with an example? Thanks! 
Dimiter Madjarov
Telerik team
 answered on 25 Dec 2015
1 answer
530 views

I wish to exchange the radiobuttons in the default boolean filter with a checkbox.

 

I expected that there was a GridUIRole for this, but alas it was not so.

 

How would I go about this practically?

 

 

Viktor Tachev
Telerik team
 answered on 24 Dec 2015
7 answers
1.2K+ views

Hi,

I have a Kendo Tabstrip in which  I use LoadContentFrom to load content from a controller action that return a PartialView. The code is

        <%  Html.Kendo().TabStrip()
                .Name("TabStrip")
                .Items(tabstrip =>
                {
                    foreach (var pillar in Model.Evaluation.Pillars)
                    {
                        tabstrip.Add()
                            .Text("Name")
                            .LoadContentFrom("EvaluationFormPillar", "Evaluations", new { id = Model.Evaluation.Id, pillarId = pillar.Id,
                                 hasActionItem = Model.Editable , editable = Model.Editable
                            });
                    }
                })
                .SelectedIndex(Model.SelectedTabIndex)
                .Render();            
     %>
        public ActionResult EvaluationFormPillar(int id, string pillarId, bool hasActionItem, bool editable)
        {
            var model = new EvaluationPillarViewModel();
            Evaluation evaluation = this._evaluationsBL.GetEvaluation(id);
......
            return PartialView(model);
        }

But strangely enough, LoadContentFrom can't go to action "EvaluationFormPillar". It just displays a empty tabstrip with correct tab (set by SelectedIndex). Can anyone help me on this problem? Thanks.

Dimiter Madjarov
Telerik team
 answered on 24 Dec 2015
3 answers
754 views

Hi,

I'm not sure if i posted in the correct sub forum. But i have a problem using drawer as navigation menu. The menu links need to open the page in current tab/page. My code works ok in desktop browser but when test it on ipad it's opened in new tab. I have tried using the code from telerik documentation something like this:

<div data-role="drawer" data-views='["bar.html"]'>

    <ul data-role="listview">

             <li><a href="#foo">Foo</a></li>

             <li><a href="bar.html">Bar</a></li>

     </ul>

</div>

but the page wouldn't open correctly and just looks like a blank page. What am i doing wrong? Please someone help me.

I have attached my sample code as reference. Thank you.

Ady

Alexander Valchev
Telerik team
 answered on 24 Dec 2015
14 answers
782 views
URL :
http://www.rewardsalad.com/Pages/Events/EventList.aspx

Error message :
SCRIPT5007: Unable to get value of the property 'replace': object is null or undefined
kendo.all.min.js, line 8 character 4630


Please see the attachment for the error screenshot.

It's occurred only in IE 9. in all other web browsers, FF, Chrome, Safari and even IE8, it's not happening.
Not everytime. but, at least, more than 50%.

Please help me out.

Thanks.



Nikolay Rusev
Telerik team
 answered on 23 Dec 2015
1 answer
183 views
I have a timeline Month view with many resources on the left column. When user scrolls down, they can't see the day because the top disappears. Is it possible to freeze the top row?
Vladimir Iliev
Telerik team
 answered on 23 Dec 2015
2 answers
357 views

I have a grid which has inline editing with one field visible (a date field).

 

For some reason when I press edit on a row and then cancel (on any row apart from the top row) the whole row turns into the value of the top item.

No data is saved to the database as refreshing the grid shows the correct values again.

 

I've put in an event handler to see what's being happening when cancel is pressed and it seems by the time the cancel event is hit, the object that gets returned is the first item of the grid.

 

How can I stop this behaviour from happening?

Dimiter Madjarov
Telerik team
 answered on 22 Dec 2015
1 answer
272 views

Hi,
I want to see only one series visible on page load. I have dynamically loading the series:

.Series(series =>
    {
       foreach (var def in Model.Series)
       {
             series.Column(def.Value).Name(def.Years);

              //.Visible(just year "2014")
       }
     })

Thanks,

Victor

Iliana Dyankova
Telerik team
 answered on 22 Dec 2015
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
Upload
ComboBox
MultiSelect
ListView
Window
TabStrip
Menu
Installer and VS Extensions
Spreadsheet
AutoComplete
TreeList
Gantt
PanelBar
NumericTextBox
Filter
ToolTip
Map
Diagram
Button
PivotGrid
Form
ListBox
Splitter
Application
FileManager
Sortable
Calendar
View
MaskedTextBox
PDFViewer
TextBox
Toolbar
MultiColumnComboBox
Dialog
DropDownTree
Checkbox
Slider
Switch
Notification
ListView (Mobile)
Pager
Accessibility
ColorPicker
DateRangePicker
Wizard
Security
Styling
Chat
MediaPlayer
TileLayout
DateInput
Drawer
SplitView
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Template
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Rating
ScrollView
ButtonGroup
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
AppBar
BottomNavigation
Card
FloatingActionButton
Licensing
Localization
MultiViewCalendar
PopOver (Mobile)
Ripple
ScrollView (Mobile)
Switch (Mobile)
PivotGridV2
FlatColorPicker
ColorPalette
DropDownButton
AIPrompt
PropertyGrid
ActionSheet (Mobile)
BulletGraph
Button (Mobile)
Collapsible
Loader
CircularGauge
SkeletonContainer
Popover
HeatMap
Avatar
ColorGradient
CircularProgressBar
SplitButton
StackLayout
TimeDurationPicker
Chip
ChipList
DockManager
ToggleButton
Sankey
OTPInput
ChartWizard
SpeechToTextButton
InlineAIPrompt
DateTimePicker
TimePicker
StockChart
RadialGauge
ContextMenu
ArcGauge
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?