Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
173 views
Hi,

I'm displaying a RadNotification control from within an async postback.  The markup for the RadNotification looks like this:

<telerik:RadNotification ID="AddToCartNotification" runat="server" Animation="Fade" AutoCloseDelay="5000" ContentIcon="" Height="100px" Opacity="80" Position="Center" Skin="Forest" Width="300px" EnableRoundedCorners="True" EnableShadow="True" LoadContentOn="EveryShow" oncallbackupdate="AddToCartNotification_CallbackUpdate" Title="Add to Cart Result" />

My code behind looks like this:
protected void OnVideoRepeaterItemCommand(object source, RepeaterCommandEventArgs e)
{
    switch (e.CommandName)
    {
        case "AddToCart":
            {
                AddItemToCart((string)e.CommandArgument);
                break;
            }
    }
}
 
private void AddItemToCart(string productSku)
{
    ShoppingCartUtilities.AddToCartResult result = ShoppingCartUtilities.AddItemToCart(productSku, 1, 1);
    string caption = "";
    string msg = "";
    string icon = "";
 
    if (result == ShoppingCartUtilities.AddToCartResult.ItemAddSucceeded)
    {
        icon = "info";
        caption = "Item Added";
        msg = "Item successfully added to cart";
    }
 
    else if (result == ShoppingCartUtilities.AddToCartResult.ItemAddFailedMaxItemCountReached)
    {
        icon = "warning";
        caption = "Maximum Count for Item Reached";
        msg = "Only one copy of this video can be added to your cart";
    }
 
    else
    {
        icon = "deny";
        caption = "Unable to Add Item to Cart";
        msg = "Add to cart failed.  Sorry for the inconvenience";
    }
 
    string value = string.Format("{0}|{1}|{2}", icon, caption, msg);
    AddToCartNotification.Value = value;
             
    AddToCartNotification.Show();
}
 
protected void AddToCartNotification_CallbackUpdate(object sender, Telerik.Web.UI.RadNotificationEventArgs e)
{
    RadNotification notification = sender as RadNotification;
  
    if(notification == null)
        return;
 
    string[] vals = notification.Value.Split('|');
 
    if (vals == null || vals.Length < 3)
        return;
 
    AddToCartNotification.TitleIcon = vals[0];
    AddToCartNotification.Title = vals[1];
    //AddToCartNotification.ContentIcon = vals[0];
    AddToCartNotification.Text = vals[2];
}

I'm able to set the Text property but not able to set the Title and TitleIcon properties.  Am I missing something or is this not possible?

Thanks -- Steve

Marin Bratanov
Telerik team
 answered on 13 Dec 2011
5 answers
169 views
Hi,
My radwindow is inside userControl named "showDetails.ascx" and that same usercontrol I have a grid.
In code behind of " "showDetails.ascx" On "grv_OnItemCommand" I need to open RadWindow Without page referesh.

showDetails.ascx
<telerik:RadWindowManager runat="server" ID="RadWindowManager1">
    <Windows>
        <telerik:RadWindow ID="radWinInvoiceDetails" runat="server" ShowContentDuringLoad="false"
            Width="400px" Height="400px" Title="Invoice Details" DestroyOnClose="true"
            Behaviors="Default">
            <ContentTemplate>
                <uc:MakePaymentControl ID="AnotherControl" runat="server" />
            </ContentTemplate>
        </telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager>
 
 
 
<grid code----
<telerik:GridTemplateColumn HeaderText="Status">
                                    <ItemTemplate>
<asp:LinkButton ID="lnkStatus" runat="server" Text="Pay" CommandName="pay" CommandArgument='<%# Eval("PaymentID") %>'></asp:LinkButton>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>

ShowDetails.ascx.cs
protected void grid_OnItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
        {
            if (e.CommandName == "pay")
            {
                string invoiceID = e.CommandArgument.ToString();
                ucMakePaymentControl.BindInvoiceDetails(Convert.ToInt64(invoiceID));
                radWinInvoiceDetails.VisibleOnPageLoad = true;
            }
        }

How can i open Radwindow on clientside/ without page refresh.
Thanks
Marin Bratanov
Telerik team
 answered on 13 Dec 2011
3 answers
261 views
Hello,

I have 2 dropdowns, 2 textboxes and two buttons in my form. OnClick the button does certain things. before that, I need to validate a condition. the condition is that if only the txtbox2 is clicked, and no other parameter is selected / entered, then I should show a pop up saying the "txtBox 2 alone can't be entered, and Please also select item from first dropdown!".. Logic needed is not complicated. I am having a problem in finding the object in my javascript function.

I ahve called IsTREmpty() on OnClientClick event for the button. I am getting the error saying object required. How can I access the form element in my javascript.?

function

IsTREmpty() {  

var tr = document.getElementById('rdCmbTR').value;  

var tt = document.getElementById('rdCmbTT').value;  

var tid = document.getElementById('rdTxtTId').value;  

var tDesc = document.getElementById('rdTxtTDesc').value; 
alert(tDesc.length); 

if (tDesc.length > 0) {  

if (tt == -1 && tid.length == 0 && tr == -1) {  

alert('Please Select T R'); }

}

}

Slav
Telerik team
 answered on 13 Dec 2011
1 answer
242 views
Hi,

   I want to  parse the recurrence rule to extract all occurrences in SQL server2008, by using user defined functions or stored procedures or any other way. I request you guys to help me out in this as early as possible if possible. Its very urgent requirement for me. Thanks in advance.

Regards,
Maddela
Peter
Telerik team
 answered on 13 Dec 2011
3 answers
71 views
Hi All,
In my application I want that if appointment subject is very long then it do not go to next line but in same line '....' should appear in the last. How it will be possible?
Peter
Telerik team
 answered on 13 Dec 2011
1 answer
70 views
I have a grid using GridBoundColumns.  The first column is a GridButtonColumn whose Text property is blank.  When the user clicks the button, the user's login Id is stored in a database table and the button's text is set to the user's login Id.  This all happens in the grid's ItemCommand event.  The code is:

        If e.CommandName = "Assign" Then
            Dim item As GridDataItem = CType(e.Item, GridDataItem)
            Dim strJobNumber As String = e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("Job_Number")
            Dim strButtonText As String = CType(item("button").Controls(0), Button).Text
            Dim NTLoginID As String = GetCurrentUser()
              
            If String.IsNullOrEmpty(strButtonText) Then
                Dim _db As New MyAssembly.DataContext(ConfigurationManager.ConnectionStrings("MyCNString").ConnectionString)
                Dim rslt = _db.TMSearchAssignments.Where(Function(x) x.JobNumber.Equals(strJobNumber)).FirstOrDefault
                If Not rslt Is Nothing Then
                    CType(item("button").Controls(0), Button).Text = rslt.NTLoginID
                    Exit Sub
                Else
                    db.StoredProcedureRepo.sp_Insert_TMSearchAssignment(strJobNumber, NTLoginID, False)
                    CType(item("button").Controls(0), Button).Text = NTLoginID
                End If
            End If
End If

That code works great and the button's text is updated as desired. The problem is when the user goes to the next page in the grid and the returns to the previous page, the text is gone.  How can I keep the text from disappearing?

Thanks,

James
James
Top achievements
Rank 1
 answered on 13 Dec 2011
3 answers
71 views
I'm getting data from database. I have two tables which create appointments. The classes which represent these tables differ by one boolean variable.

I'm trying to color the cells from one of the table green.

My css is here:
.rsMonthView .rsAptContent 
                {  
                  background: #D0ECBB;  
                }
                
                .rsDayView .rsAptContent 
                {  
                  background: #D0ECBB;  
                }
                
                .rsWeekView .rsAptContent 
                {  
                  background: #D0ECBB; 
                }
                
                .rsTimelineView .rsAptContent 
                {  
                  background: #D0ECBB;  
                }


How to check which table from is the cell?
Peter
Telerik team
 answered on 13 Dec 2011
7 answers
133 views
Hi Every one,
I want to build a class inherits from charts to make my charting dynamic. But when i try to make such class and add properties of chart control , it fails to set the properties and shows it read only.
Regards
Muhammad Shoaib.

Ves
Telerik team
 answered on 13 Dec 2011
1 answer
104 views
how can we use Raddock in mvc3 application.
Slav
Telerik team
 answered on 13 Dec 2011
5 answers
130 views
In the month view, Is there a way to prevent the user from clicking on the day number to look at the individual day?  I am not using this as a traditional scheduler, but rather a monthly read only informational page.  I have everything disabled so far except clicking on the number in the top left corner of each day.

Thanks.
Ivana
Telerik team
 answered on 13 Dec 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?