Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
76 views
I am building a RadMenu client side where some of the menu items will be disabled.   The menu item gets disabled correctly. The problem is that the image still appears enabled.  Is there a way to disable the image as well?  

See screensnot

thanks, Randy
Kate
Telerik team
 answered on 23 Nov 2011
2 answers
131 views
Is it possible to fetch the values of a custom field from a Javascript in a RadFileExplorer?
I have successfully implemenented a custom content provider, but I need to get the values from the custom fields

I tried the code below, but I get no results.

function OnItemSelected(sender, args) {
 
    var fexplorer = $find("<%=FileExplorer.ClientID %>");
    var txtDocumentDescription = $find("<%=TxtActionDocumentDescription.ClientID %>");
 
    // find the description from custom fields to set it
    var grid = fexplorer.get_grid();
    var gridSelectedItems = grid.get_selectedItems();
    var gridSelectedItem = gridSelectedItems[0];
    var description = gridSelectedItem.get_dataItem()["Description"];
    txtDocumentDescription.set_value(description);
}
Markús
Top achievements
Rank 1
 answered on 23 Nov 2011
7 answers
199 views
I have a treeview, that depending on if a check box is check will display either only nodes that are flagged as "Enabled" in the database, or all nodes. Depending on if a node is set as enabled I would like to attach one of two context menu's to it. 

This is the error message I'm getting: 
"Multiple controls with the same ID 'contextMenu1' were found. FindControl requires that controls have unique IDs."

This error occurs when I toggle the check box a couple times.

Below is my code:

<span>Show All Locations:</span>
       <asp:CheckBox ID="LocationsTreeView_ChkBox" runat="server" AutoPostBack="true" OnCheckedChanged="LocationsTreeView_CheckedChanged" Checked="false" />
           <telerik:RadTreeView ID="LocationsTreeView" runat="server" EnableDragAndDrop="true"  MultipleSelect="true" EnableDragAndDropBetweenNodes="true"
           AllowNodeEditing="true" OnContextMenuItemClick="LocationsTreeView_ContextMenuItemClick" OnClientContextMenuItemClicking="onClientContextMenuItemClicking"
           OnClientContextMenuShowing="onClientContextMenuShowing" OnNodeEdit="LocationsTreeView_NodeEdit"
           OnNodeDrop="LocationsTreeView_NodeDrop" OnClientNodeDropping="onNodeDropping" OnClientNodeDragging="onNodeDragging" >
    
           </telerik:RadTreeView>


protected void LocationsTreeView_CheckedChanged(object sender, EventArgs e)
        {
            CheckBox cb = (CheckBox)sender;
 
            if (cb.Checked == true)
                LocationTreeAll();
 
            else if (cb.Checked == false)
                LocationTree();
        }


public void LocationTreeContextMenu()
       {
           // Define Context Menu 1 ## Enable Menu Item
           // Define Context Menu 2 ## Disable Menu Item
 
           RadTreeViewContextMenu contextMenu1 = new RadTreeViewContextMenu();
           RadTreeViewContextMenu contextMenu2 = new RadTreeViewContextMenu();
           contextMenu1.ID = "contextMenu1";
           contextMenu2.ID = "contextMenu2";
            
           // Build Menu's
            
           RadMenuItem menuItem1 = new RadMenuItem();
               menuItem1.Value = "Rename";
               menuItem1.Text = "Rename ...";
               menuItem1.Enabled = true;
               menuItem1.ImageUrl="images/icons/edit_48.png";
               contextMenu1.Items.Add(menuItem1);
               contextMenu2.Items.Add(menuItem1);
           RadMenuItem menuItem2 = new RadMenuItem();
               menuItem2.IsSeparator = true;
               contextMenu1.Items.Add(menuItem2);
               contextMenu2.Items.Add(menuItem2);
           RadMenuItem menuItem3 = new RadMenuItem();
               menuItem3.Value = "addLocation";
               menuItem3.Text = "Add Location";
               menuItem3.Enabled = true;
               menuItem3.ImageUrl = "images/icons/add_16.png";
               contextMenu1.Items.Add(menuItem3);
               contextMenu2.Items.Add(menuItem3);
           RadMenuItem menuItem4 = new RadMenuItem();
               menuItem4.Value = "enableLocation";
               menuItem4.Text = "Enable Location";
               menuItem4.Enabled = true;
               contextMenu1.Items.Add(menuItem4);
           RadMenuItem menuItem5 = new RadMenuItem();
               menuItem5.Value = "disableLocation";
               menuItem5.Text = "Disable Location";
               menuItem5.Enabled = true;
               contextMenu2.Items.Add(menuItem5);
           RadMenuItem menuItem6 = new RadMenuItem();
               menuItem6.Value = "editDetails";
               menuItem6.Text = "Edit Details";
               menuItem6.Enabled = true;
               menuItem6.PostBack = true;
               contextMenu1.Items.Add(menuItem6);
               contextMenu2.Items.Add(menuItem6);
 
           // Add The context menu to the tree
           LocationsTreeView.ContextMenus.Add(contextMenu1);
           LocationsTreeView.ContextMenus.Add(contextMenu2);
 
           // Check to see which node gets which context menu
           foreach (RadTreeNode node in LocationsTreeView.GetAllNodes())
           {
               string check = "";
               string getStatus = "SELECT Enabled FROM dbo.Locations WHERE ID='" + node.Value.ToString() + "'";
 
               SqlCommand cmd = new SqlCommand(getStatus,connection);
               connection.Open();
               check = cmd.ExecuteScalar().ToString();
               connection.Close();
               cmd.Dispose();
 
               if (check == "True")
               {
                   node.ContextMenuID = "contextMenu2";
               }
               else if (check == "False")
               {
                   node.ContextMenuID = "contextMenu1";
               }
           }
       }
William
Top achievements
Rank 1
 answered on 23 Nov 2011
5 answers
1.4K+ views
Hi,

I was wondering if there was a way to set the default date on the pop up calendar of a date picker without entering the date in the input box?

Regards
Roger
Maria Ilieva
Telerik team
 answered on 23 Nov 2011
1 answer
60 views
I have customized my AppointmentTemplate by adding some controls (Labels and ImageButtons).
I need to access those controls to change values based on info I have in my Appointment object.
My first approach was just using Eval() to toggle the visibility of a LinkButton in the markup based on a custom attribute like this:
            <AppointmentTemplate>
                <p>
                    <h2><%# Eval("Subject") %></h2><br />
                </p>
                <p>
                    <h3><%# string.IsNullOrEmpty(Eval("Attributes['gst_name']").ToString().Trim()) ? "" : "with: " + Eval("Attributes['gst_name']") %></h3>
                </p>
                <p>
                     <asp:ImageButton id= "ibNotes" ImageUrl="~/Images/note.png" runat="server" CommandName="GetNote" Visible = "<%# Eval("Attributes['notelength']") = "0" ? "false" : "true" %>"/>

                </p>
                <p>
                    <h3>AppointmentTemplate<%# Eval("Attributes['modifiers']") %></h3>
                </p>
            </AppointmentTemplate>

But I can't build with it this way. I get an error: "The server tag is not well formed." Referring to my ImageButton location.

So I tried another approach, to get to it in codebehind, but I can't get anything working there either.
What server side event should I use? I'm thinking I'd need to use FindControl() but can't find anything in Intellisense.

Anyone got an example?

Thanks!

Matt
Peter
Telerik team
 answered on 23 Nov 2011
5 answers
98 views
hi,

I have a scheduler on an MVC page, doing web-services mode.

In my case the week view and the month view need a different row height. The days have a row corresponding to 5 minutes, which works well with a small row height. This results in the month view looking awful.

I want to change the row height when switching view. There is an event on switching view, this is a server-side. My scheduler is running client-side (no choice doing mvc). I'm looking for a way to hook into the view-change client side.

Any help appreciated

Peter 
Peter
Telerik team
 answered on 23 Nov 2011
3 answers
181 views
Hi,
I have a RadToolBarSplitButton where I set buttons in runtime.
I calcule the dropdown height from the number of  button.

But everyime the vertical scroll bar are visible.

How do you remove this scroll bar ?

int dropDownHeight = (int)(Annees.Buttons.Count * 25);
if (dropDownHeight > 250)
{
   dropDownHeight = 250;
   //show vertical scroll bar
}
else
{
  //not show vertical scroll bar
}
                         
Annees.DropDownHeight = Unit.Pixel(dropDownHeight);
Stephane
Top achievements
Rank 1
 answered on 23 Nov 2011
5 answers
181 views
hi,

I'm using a scheduler in an MVC page, doing web services mode.

I do have a issue with the localization.
The locale of scheduler, bowser and page are all set to Dutch 
My localized resources work fine
The popup calendar for selecting a date is in Dutch
The format of date and time follows my custom formats

Nevertheless the names of the day of the week and the month names are still in English. How can I tame this detail ?

Peter
Peter
Telerik team
 answered on 23 Nov 2011
9 answers
368 views

Hello.

In my web application, a page is displayed with the RadScheduler component, whose ColumnWidth property has been set to a certain number of pixels.

When an appointment is displayed, it does not fill the entire cell; a certain space is left on the right side, just like in the following demo: http://demos.telerik.com/aspnet-ajax/scheduler/examples/customization/defaultcs.aspx.

What should I do to set the width of the appointment equal to RadScheduler ColumnWidth?

Thank you.

Paulo

Peter
Telerik team
 answered on 23 Nov 2011
1 answer
175 views
I put in what I thought was some simple code:

           <div id="divRight1stRow" class="float_right" style="padding: 6px;">
                <div class="float_right">
                     <telerik:RadButton Width="25px" Height="26px" ID="btnAdmin" runat="server" Text="Administration" OnClientClicked="btnAdmin_Click">
                    <Image ImageUrl="~/images/administration_25x26.png"/>
                    </telerik:RadButton><br />
                </div>
                <div class="float_right">
                     <telerik:RadButton Width="75px" Height="26px" ID="btnLogout" runat="server" Text="Logout" OnClick="btnLogout_Click" CssClass="margin_right">
                    <Image ImageUrl="~/images/logout_v1_75x26.png" />
                     </telerik:RadButton><br />
                </div>
                <div class="float_right">
                    User: <asp:Label ID="lblUserName" runat="server" Text="" CssClass="margin_right"></asp:Label>
                </div>
                <div class="float_right">
                    <asp:Label ID="LblDept" runat="server" Text="Department:&nbsp;" CssClass="margin_right"></asp:Label>
                    <telerik:RadComboBox ID="RadCbBoxDepts" runat="server" AutoPostBack="true" OnSelectedIndexChanged="RadCbBoxDepts_SelectedIndexChanged1"  CssClass="margin_right">
                    </telerik:RadComboBox>
                </div>
            </div>

The problem is I do not see the buttons until i mouse over the area. Any Ideas what is going on?

Slav
Telerik team
 answered on 23 Nov 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?