Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
144 views
I have a master-detail grid defined. In the detail grid I have a GridCheckBoxColumn whose UniqueName is IsCompleted. I have another GridDateTimeColumn column in the detail grid whose UniqueName is DateCompleted. These values are initially populated from our database. Everything works fine so far.

What I would like to do is when the user checks the IsCompleted check box, the DateCompleted column is automatically populated with Today's date. All this should be done on the client side as the user may want to change the date after the automatic setting of the date.

Being fairly new to the Telerik controls, I can't figure out which events and how to accomplish this. Any help would be greatly appreciated!
Princy
Top achievements
Rank 2
 answered on 24 May 2012
1 answer
96 views
Hello Telerik team.

I posted same problem this article ( http://www.telerik.com/community/forums/aspnet-ajax/input/radtextbox-and-requiredvalidator-problem.aspx) , and I received answer how to solve matters.

But i had tested this problem with chrome browser,  it doesn't work chrome browser.

i'm using 2012.1.403.40 telerik version.

Please refer my past article and let me know how to take care of the matter

thanks
Milena
Telerik team
 answered on 24 May 2012
5 answers
260 views

I use OnClientClick="showNotification();" on a asp:button with this java script. I try to use on same page validate a control with a telerik:RadButton and OnClientClicked, but dont have it to work. Only works with asp:button.
How to get showNotification work with telerik:RadButton?

<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
    <script type="text/javascript">
        function showNotification() {
            var notification = $find("<%= RadNotification1.ClientID %>");
            setTimeout(function () {
                notification.show();
            }, 0);
        }
 
        function CheckIfShow(sender, args) {
            var summaryElem = document.getElementById("<%= ValidationSummary1.ClientID %>");
            var noErrors = summaryElem.style.display == "none";
            args.set_cancel(noErrors);
        }
    </script>
</telerik:RadScriptBlock>
Slav
Telerik team
 answered on 24 May 2012
2 answers
83 views
Please guide me to fix this. How could I customize the telerik RadFilter Control

Advance & Thanks
Tamim
Tamim
Top achievements
Rank 1
 answered on 24 May 2012
1 answer
142 views
Hi,

I have a strange problem with my RadGrid. I placed to RadComboBoxes

<telerik:GridTemplateColumn UniqueName="Dossier" SortExpression="Identification"
    HeaderText="<%$Resources:ESTV.A3, LabelDossier%>" DataField="Identification"
    CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" ShowFilterIcon="false"
    ShowSortIcon="True">
    <ItemTemplate>
        <a href="<%# Eval("Case.Url") %>">
            <%# Eval("Case.Identification") %></a>
    </ItemTemplate>
    <EditItemTemplate>
        <telerik:RadComboBox runat="server" ID="comboBoxDossier" AllowCustomText="True" EnableLoadOnDemand="True"
            EnableVirtualScrolling="False" AutoPostBack="True" ShowMoreResultsBox="True"
            CausesValidation="False"
            EmptyMessage="<%$Resources:ESTV.A3, MessageSearchForDossierEmpty%>" Skin="Office2010Blue"
            Width="200px" MaxHeight="100px" ItemsPerRequest="50" OnItemsRequested="ComboBoxDossierItemsRequested"
            OnSelectedIndexChanged="ComboBoxDossierOnSelectedIndexChanged">
        </telerik:RadComboBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidatorDossier" runat="server" ControlToValidate="comboBoxDossier"
            ErrorMessage="<%$Resources:ESTV.A3, MessageMandatoryField%>"></asp:RequiredFieldValidator>
    </EditItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="Address" SortExpression="FullName" HeaderText="Adressen"
    DataField="FullName" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true"
    ShowFilterIcon="false" ShowSortIcon="True">
    <ItemTemplate>
        <a href="ViewAddress.aspx?id=<%#Eval("Address.Id") %>">
            <%# Eval("Address.FullName") %>
        </a>
    </ItemTemplate>
    <EditItemTemplate>
        <telerik:RadComboBox runat="server" ID="comboBoxAddress" AllowCustomText="True" EnableLoadOnDemand="True"
            EnableVirtualScrolling="False" AutoPostBack="True" ShowMoreResultsBox="True"
            CausesValidation="False"
            EmptyMessage="<%$Resources:ESTV.A3, MessageSearchForAddressEmpty%>" Skin="Office2010Blue"
            Width="200px" MaxHeight="100px" ItemsPerRequest="50" OnItemsRequested="ComboBoxAddressItemsRequested"
            OnSelectedIndexChanged="ComboBoxAddressOnSelectedIndexChanged">
        </telerik:RadComboBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidatorAddress" runat="server" ControlToValidate="comboBoxAddress"
            ErrorMessage="<%$Resources:ESTV.A3, MessageMandatoryField%>"></asp:RequiredFieldValidator>
    </EditItemTemplate>
</telerik:GridTemplateColumn>

The Logic about this to ComboBoxes is that if I select a Value from the first one, the second one will automatically filled with the values that are in context with the first one. This is the Code that is in the OnSelectedIndexChanged Method

AddressCaseRelationBll addressCaseRelationBll = new AddressCaseRelationBll();
           AddressBll addressBll = new AddressBll();
           RadComboBox comboBoxDossiers = o as RadComboBox;
 
           if (comboBoxDossiers == null)
           {
               return;
           }
 
           try
           {
               if (string.IsNullOrEmpty(comboBoxDossiers.SelectedValue))
               {
                   List<Address> addresses = addressBll.Select();
                   RadComboBox comboBoxAddress = (RadComboBox)this.radGridAddressCaseRelation.MasterTableView.GetInsertItem().FindControl(ControlAddress);
 
                   comboBoxAddress.Items.Clear();
                   foreach (Address address in addresses)
                   {
                       comboBoxAddress.Items.Add(
                           new RadComboBoxItem(
                               address.FullName, address.Id.ToString()));
                   }
               }
               else
               {
                   List<AddressCaseRelation> addressCaseRelations = addressCaseRelationBll.SelectByCase(new Guid(comboBoxDossiers.SelectedValue));
                   RadComboBox comboBoxAddress = (RadComboBox)this.radGridAddressCaseRelation.MasterTableView.GetInsertItem().FindControl(ControlAddress);
 
                   comboBoxAddress.Items.Clear();
                   if (string.IsNullOrEmpty(comboBoxAddress.SelectedValue))
                   {
                       foreach (AddressCaseRelation addressCaseRelation in addressCaseRelations)
                       {
                           comboBoxAddress.Items.Add(
                               new RadComboBoxItem(
                                   addressCaseRelation.Address.FullName, addressCaseRelation.Address.Id.ToString()));
                       }
                   }
               }
           }

This is working fine, but if I select for example the Value A in the first comboBox, my method will add the all the items  in context with A in the second ComboBox.
Now if i open the second ComboBox see all the correct Items. At the bottom it is an Arrow for load more items.... and here is my problem. everytime when i click this arrow the items are added another time. but if i debug all my method where i have a Items.Add statement it never stops. Now i don't know where this items will bi added.

Regards

Andrey
Telerik team
 answered on 24 May 2012
1 answer
140 views
Following the advice in Veli Pehlivanov's Blog post I'm able to bind to a WCF service I created, however I can not get paging to work.  I'm able to successfully bind to the service, the ListView is pouplated with data,  I just get ALL the data when the page loads.  It doesn't appear to be honoring the AllowPaging or PageSize properties.  Since I'm using an svc-less service I followed the Veli's example for binding to any general JSON feed and the returned JSON is in the format of: 
{
    -"Result": {
        +"Data_Items": [...], 
        "Item_Count": 33
    }
}
 I'm assuming that since I'm getting data the DataPropertyName and DataCountName aren't the issue... but I'm not sure where I'm going wrong. 

Below is the markup for the ListView, the Javascript and CSS I'm using.  Does anyone know what I'm doing wrong?

Markup:
<telerik:RadListView ID="lvPostings" runat="server" AllowPaging="true" PageSize="9">
    <LayoutTemplate>
        <div id="listView">
            <a class="pagePrev" href="javascript:void(0);" title="Go to previous page"></a>
            <a class="pageNext" href="javascript:void(0);" title="Go to next page"></a>
            <div id="items">
            </div>
        </div>
    </LayoutTemplate>
    <ClientSettings>
        <DataBinding ItemPlaceHolderID="items">
            <ItemTemplate>
            <div class="item">
                <span class="name">#= UContactName #</span>
                <span class="company">#= Division #</span>
                <span class="title">#= PositionTitle #</span>
                <br />
            </div>
            </ItemTemplate>
            <EmptyDataTemplate>
                <div class="empty">
                    No Matching Data
                </div>
            </EmptyDataTemplate>
            <DataService Location="http://linkapi/SLogic/Postings/?format=json"
                     HttpMethod="Get" ResponseType="JSONP"
                DataPropertyName="Result.Data_Items" CountPropertyName="Result.Item_Count" />               
        </DataBinding>
        <ClientEvents OnDataBound="onListViewDataBound"  />
    </ClientSettings>
</telerik:RadListView>

Javascript:
<script type="text/javascript">
    var listView;
 
    function pageLoad()
    {
        listView = $find("lvPostings");
    }
 
    (function($)
    {
        $(function()
        {
            $(".pagePrev").click(function(e)
            {
                listView.page(listView.get_currentPageIndex() - 1);
            });
 
            $(".pageNext").click(function(e)
            {
                listView.page(listView.get_currentPageIndex() + 1);
            });
               
        });
    })($telerik.$);
 
    function onListViewDataBound(sender, args)
    {
        $telerik.$(".pagePrev").css("display", sender.get_currentPageIndex() === 0 ? "none" : "");
        $telerik.$(".pageNext").css("display", sender.get_currentPageIndex() === sender.get_pageCount() - 1 ? "none" : "");
    }
</script>

CSS:
#listView
{
    width: 780px;
    height: 270px;
    margin: 20px auto;
    position: relative;
}
 
.pagePrev, .pageNext
{
    width: 22px;
    height: 22px;
    position: absolute;
    top: 132px;
    background: transparent url('Common/sprite.gif') no-repeat scroll 0 0;
}
 
.pagePrev
{
    left: -40px;
}
 
.pagePrev
{
    background-position: 0 -700px;
}
 
.pagePrev:hover
{
    background-position: 0 -750px;
}
 
.pageNext
{
    right: -15px;
}
 
.pageNext
{
    background-position: 0 -850px;
}
 
.pageNext:hover
{
    background-position: 0 -900px;
}
 
.item
{
    float: left;
    background-color: #333333;
    color: #ffffff;
    cursor: pointer;
    font-size:12px;
    height: 76px;
    padding-top: 10px;
    width: 240px;
    margin: 5px;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    border-radius: 5px;
    -moz-box-shadow: 1px 1px 3px #212121;
    -webkit-box-shadow: 1px 1px 3px #212121;
    box-shadow: 1px 1px 3px #212121;
    position: relative;
}
 
.item:hover
{
    color: black;
    background-color: #9EC101;
    background-image: -moz-linear-gradient(#577D00, #89AC05);
    background-image: -webkit-linear-gradient(#577D00, #89AC05);
    background-image: -o-linear-gradient(#577D00, #89AC05);
    background-image: linear-gradient(#577D00, #89AC05);
}
.item img, .item .photo
{
    width: 57px;
    height: 70px;
    float: left;
    border: 1px solid #0E0E0E;
    margin: -3px 10px 0 7px;
    background-color: #111111;
}
 
.item .name, .item .company
{
    display: block;
    margin-bottom: 4px;
    line-height: 14px;
}
 
.item .company
{
    line-height: 12px;
    text-transform: uppercase;
}
 
.item .title
{
    position: absolute;
    right: 10px;
    bottom: 5px;
    font-size: 12px;
}
 
.empty
{
    padding: 10px;
    text-align: center;
    color: White;
    background-color: #333333;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    border-radius: 5px;
    -moz-box-shadow: 1px 1px 3px #212121;
    -webkit-box-shadow: 1px 1px 3px #212121;
    box-shadow: 1px 1px 3px #212121;
}

Antonio Stoilkov
Telerik team
 answered on 24 May 2012
1 answer
113 views
Hello everyone I hope you are very well

I hope you can help me;

Is there a sequence of steps you must take to update my Telerik controls (Q1 2011) to (Q2 2012)?

I worry that all my practices were going to damage

Thanks in advance
Happy Coding

M.
Martin
Telerik team
 answered on 24 May 2012
1 answer
82 views
Hello,

I am not able to find RadBarCode control in telerik dll.(version 2012.1.301.40).

Thanks,
Jayesh Goyani
Martin
Telerik team
 answered on 24 May 2012
1 answer
192 views
Can someone tell me why this code doesn't work? Checked the demos and documentation but didn't find an answer and the forum related to this topic are very old.

<telerik:RadRotator ID="rotator1" runat="server" Width="800px" Height="150px" SlideShowAnimation-Type="Fade" SlideShowAnimation-Duration="500" ItemHeight="63" ItemWidth="125" RotatorType="Buttons" OnClientItemShown="OnClientItemShown"></telerik:RadRotator>
var item = new Telerik.Web.UI.RadRotatorItem();
item.Controls.Add(new LiteralControl("<div>1</div>"));
rotator1.Items.Add(item);
Princy
Top achievements
Rank 2
 answered on 24 May 2012
1 answer
433 views

How I can get "Name" Column value on DeleteCommand,

aspx:
<telerik:RadGrid ID="SecurityGrid" runat="server" OnNeedDataSource="SecurityGrid_NeedDataSource"
            OnItemCommand="SecurityGrid_ItemCommand" OnPreRender="SecurityGrid_PreRender"
            OnDeleteCommand="UserGrid_DeleteCommand" OnUpdateCommand="SecurityGrid_UpdateCommand"
            OnInsertCommand="SecurityGrid_InsertCommand" AutoGenerateColumns="False" OnItemCreated="SecurityGrid_ItemCreated">
            <MasterTableView DataKeyNames="Id" CommandItemDisplay="Top" EditMode="InPlace" TableLayout="Auto"
                Width="100%">
                <Columns>
                    <telerik:GridEditCommandColumn HeaderStyle-Width="2%" UniqueName="EditCommandColumn"
                        ButtonType="ImageButton" EditImageUrl="../Images/grid_edit.png">
                    </telerik:GridEditCommandColumn>
                    <telerik:GridButtonColumn UniqueName="btnDelete" ConfirmDialogType="RadWindow" ButtonType="ImageButton"
                        CommandName="Delete" ConfirmDialogHeight="100px" ConfirmDialogWidth="300px" HeaderStyle-Width="2%" />
                    <telerik:GridTemplateColumn DataField="Id" UniqueName="Id" Visible="false">
                        <InsertItemTemplate>
                            <telerik:RadTextBox ID="RadTextBox1" runat="server" Text='<%# Bind("Id") %>' ReadOnly="true"
                                Enabled="false" />
                        </InsertItemTemplate>
                        <EditItemTemplate>
                            <telerik:RadTextBox ID="RadTextBox1" runat="server" Text='<%# Eval("Id") %>' ReadOnly="true" />
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn UniqueName="Name" DataField="Name">
                        <EditItemTemplate>
                            <asp:TextBox ID="txtName" Width="120px" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Name") %>'></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RFName" runat="server" ErrorMessage="*" CssClass="validator"
                                ControlToValidate="txtName"></asp:RequiredFieldValidator>
                            <asp:CustomValidator ID="cvName" CssClass="validator" OnServerValidate="cvName_ServerValidate"
                                Display="Dynamic" runat="server" ControlToValidate="txtName"></asp:CustomValidator>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="lblName" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Name") %>'></asp:Label>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn UniqueName="Level" DataField="Level">
                        <EditItemTemplate>
                            <telerik:RadNumericTextBox ID="txtLevel" Width="50px" runat="server" DbValue='<%# DataBinder.Eval(Container.DataItem, "Level") %>'>
                                <NumberFormat DecimalDigits="0" />
                            </telerik:RadNumericTextBox>
                            <asp:RequiredFieldValidator ID="RFLevel" runat="server" ErrorMessage="*" CssClass="validator"
                                ControlToValidate="txtLevel"></asp:RequiredFieldValidator>
                            <asp:CustomValidator ID="cvLevel" CssClass="validator" OnServerValidate="cvLevel_ServerValidate"
                                Display="Dynamic" runat="server" ControlToValidate="txtLevel"></asp:CustomValidator>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="lblLevel" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Level") %>'></asp:Label>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                </Columns>
                <CommandItemTemplate>
                    <div style="width: 100%">
                        <div style="width: 10%; margin-left: 12px; float: left">
                            <asp:LinkButton ID="LinkButton2" runat="server" CommandName="InitInsert">
                                <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/UI/Images/add.png" />
                                <asp:Label ID="lblQuickAdd" runat="server" /></asp:LinkButton>&nbsp;&nbsp;
                        </div>
                    </div>
                </CommandItemTemplate>
            </MasterTableView>
            <ClientSettings>
                <ClientEvents OnColumnHidden="onColumnHidden" OnRowDblClick="RowDblClick" />
            </ClientSettings>
        </telerik:RadGrid>


.cs


  protected void UserGrid_DeleteCommand(object sender, GridCommandEventArgs e)
        {
            string securityLevelId = ((GridDataItem) e.Item).GetDataKeyValue("Id").ToString();
            Session["ID"] = securityLevelId;

            bool hasUser = Master.Organization.SecurityLevelHasUser(Convert.ToInt16(securityLevelId));
            bool hasDocument = Master.Organization.SecurityLevelHasDocument(Convert.ToInt16(securityLevelId));

            LogConfig.SaveInFile(Level.Debug, "Show Deleted popup", null, typeof (SecurityLevel).FullName,
                                 Master.StackTrace.GetFrame(1).GetMethod().Name);


            GridDataItem dataItem = e.Item as GridDataItem;
            string contactName = dataItem["Name"].Text;-->
THIS IS NULL
          

        
        }
Shinu
Top achievements
Rank 2
 answered on 24 May 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?