Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
93 views
I have a treeview and a context menu based on the examples on this website, with some added functionality.

When right clicking on a node and adding a new node, the node is put into edit mode. If I change the name of the newly created node (I set a default value in code behind), the NodeEdit server side event fires, which is what I want.

However, if I do not change the name, the server side event does not fire. This is likely by design. However, in the case where I am creating new nodes, I need that server event to fire anyway.

Is there a way to do this?

Greg
Martin
Top achievements
Rank 1
 answered on 15 Jan 2013
4 answers
111 views
I have a strange problem with recurring events.

I have a recurring event scheduled once a week with no end date.

When I start my application I open the RadScheduler in week view, and the recurring event is shown as it should. But if I go to the next week the event is not shown.

If I then switch to month view the recurring event is shown, but only the one in the week I was in before I switch to month view.
Then, if I switch back to week view, the event is shown for that week, even if it wasn't before.

In my application I also have a RadCalendar, where the dates with appointments are bold. To do this, in the AppointmentDataBound event of the RadScheduler I use the e.Appointment.RecurrenceRule to add the dates to the SpecialDays collection of the RadCalendar. This works fine, so I don't think there is anything wrong with the recurring event itself, just the way it is displayed in the RadScheduler.

The same behavior also happens if I have recurring event scheduled once a day, and also if I vary the number of occurrences, end dates etc

Any ideas?

Regards, Jill-Connie Lorentsen
Plamen
Telerik team
 answered on 15 Jan 2013
1 answer
113 views
hi everyone, i am new to telerik controls, i have a rad file explorer, code of my explorer is below

 <table cellspacing="4">
        <tr>
            <td rowspan="2" style="vertical-align: top;">
                Browse to an image and double click to preview.
                <telerik:RadFileExplorer runat="server" ID="FileExplorer2" Width="520px" Height="520px"
                    OnClientItemSelected="OnClientItemSelected" 
                    OnClientDelete="OnClientDelete"                     
                    EnableAsyncUpload="True" 
                   >
                    <Configuration ViewPaths="~/Images" UploadPaths="~/Images"
                        DeletePaths="~/Images"></Configuration>
                </telerik:RadFileExplorer>
            </td>
            <td>
                <div id="decoratedZoneFiledset">
                    <fieldset style="width: 230px; height: 220px; margin-top: 14px;">
                        <legend>Preview</legend>
                        <img id="pvwImage" src="Images/Northwind/Flowers/Flower1.jpg" alt="Flower1.jpg"
                            style="display: none; margin: 10px; width: 200px; height: 180px; vertical-align: middle;" />
                    </fieldset>
                </div>
            </td>
        </tr>
        <tr>
            <td valign="top" id="decoratorZone">
               
                <asp:Button ID="Button1" runat="server" Text="Submit" />
            </td>
        </tr>
    </table>
i give uploadpath,viewpath, deletepath initially temperary as the upload button should appear,
i want this, when i click on upload button in code behind i want setting a path from my controls like dropdown.selectedvalue/textbox/imgname how i get this, any help will be appreciated. 
thanks in advance :)
Vessy
Telerik team
 answered on 15 Jan 2013
1 answer
60 views
Hi Team ,
 i have use in my website Telrik conrol and red grid.
but paging is not working in redgird.

aspx code:<telerik:RadGrid ID="gvLookupData" OnPageIndexChanged="gvLookupDataPageIndexChanged" OnSelectedIndexChanged="gvLookupData_SelectedIndexChanged" OnItemDataBound="gvLookupData_ItemDataBound" OnItemCommand="gvLookupData_ItemCommand" runat="server" AllowPaging="True" AutoGenerateEditColumn="false" AutoGenerateColumns="false" CellPadding="3"GridLines="None"PageSize="1"><MasterTableView><Columns> <telerik:GridBoundColumn UniqueName="Key_Id" HeaderText="KeyId" Visible="true"ReadOnly="true" DataField="Key_Id"></telerik:GridBoundColumn></Columns></MasterTableView></telerik:RadGrid>

Cs code:
 protected void gvLookupDataPageIndexChanged(object sender, Telerik.Web.UI.GridPageChangedEventArgs e)
    {
        int index = e.NewPageIndex;
        int current = gvLookupData.CurrentPageIndex;
    }

 public void BindGrid( )
    {
        DataSet ds = (new Linx2DB()).RED_GetLookupHierarchicalData().ExecuteDataSet();
        gvLookupData.DataSource = ds;    
        gvLookupData.CurrentPageIndex = gvLookupData.MasterTableView.CurrentPageIndex;
        gvLookupData.DataBind();
        
    }

 

protected void Page_Load(object sender, EventArgs e)
    {BindGrid();
}

    }

 

Regards
Ashish

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


Princy
Top achievements
Rank 2
 answered on 15 Jan 2013
1 answer
59 views
I have some users in that for one users set_text property is not working 
for renaming users it is working Hear is my code.Unable to find any 
script errors also.

    var cellMachinery = MasterTable.getCellByColumnUniqueName(row, "MachineryName");
    var cellApplPoint = MasterTable.getCellByColumnUniqueName(row, "ApplPoint");
    var text = cellMachinery.textContent.trim() + "  " + cellApplPoint.textContent.trim();
    var combo = $find("<%= ddlMapModel.ClientID %>");
    combo.set_text(text);
Boyan Dimitrov
Telerik team
 answered on 15 Jan 2013
0 answers
85 views
Hi,

I have 2 projects:

1) Simple test project - I create RadContextMenu that is associated with grid's row and it appears normally. I create it programmatically in Page_Init event. I don't use ContextMenuControlTarget. Telerik's grid and RadContextMenu are inside user control. The code looks as following:

public partial class GridUserControlDynamic : System.Web.UI.UserControl
{
    public RadContextMenu contextMenu = new RadContextMenu();
 
    protected void Page_Init(object sender, EventArgs e)
    {
        contextMenu.ID = this.GridControl.ID + "_RadMenu";
        RadMenuItem item1 = new RadMenuItem("Add");
        RadMenuItem item2 = new RadMenuItem("Edit");
        RadMenuItem item3 = new RadMenuItem("Delete");
        RadMenuItem item4 = new RadMenuItem("Parus");
        contextMenu.Items.Add(item1);
        contextMenu.Items.Add(item2);
        contextMenu.Items.Add(item3);
        contextMenu.Items.Add(item4);
        contextMenu.ItemClick += contextMenu_ItemClick;
        Controls.Add(contextMenu);

2) Complex project - I create RadContextMenu that should be associated with grid's row but it doesn't appear at all. I create it without ContextMenuControlTarget programmatically in OnInit method. But when I use ContextMenuControlTarget it appears but it's available not only on grid's row but in grid's header too. I don't need it in grid's header. The code looks as following:

protected override void OnInit(EventArgs e)
{
    base.OnInit(e);
 
    ...
 
    // Grid context menu section
    var contextMenu = new Parus.Controls.GridContextMenu();
    var target = new ContextMenuControlTarget();
    target.ControlID = this.Grid.ID;
    contextMenu.ID = this.Grid.ID + "_RadMenu";
    CreateContextItems(contextMenu.Items, this.Frame.ViewFrameData.ActionItems);
    contextMenu.LinkedControlClientId = ServerRequest.ClientID;
    contextMenu.OnClientItemClicked = "GridContextMenu_ActionsHandler";
    contextMenu.Targets.Add(target);
    this.PostbackPanel.ContentTemplateContainer.Controls.Add(contextMenu);

The CreateContextItems method add items to context menu.

How to get rid of context menu appearance in grid's header?

Goran
Goran
Top achievements
Rank 1
 asked on 15 Jan 2013
1 answer
162 views
Hi all,

This is my first posting here and I could use your help.  I am trying to figure out how to keep my values when using a radcombo box when filtering my grid.  Each time I select an option, the selected value always go back to the first in the list.  So I added some code in the cs file to retain the value, but I get an error.  I could use your expertise!  I have cut/pasted the code and the error message below.

Here is the Aspx:

 

<telerik:RadGrid ID="RadGrid1" runat="server" CellSpacing="0" DataSourceID="FastTrackDataSource" GridLines="None" Skin="Outlook" AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" OnItemDataBound="RadGrid1_ItemDataBound" EnableLinqExpressions="false">
        <ClientSettings>
            <Scrolling AllowScroll="True" UseStaticHeaders="True" />
        </ClientSettings>
        <MasterTableView AutoGenerateColumns="False" DataKeyNames="ID,PersonId,LastName,FirstName,PositionId,BduId,bureau_name,division_name,unit_name,Status" DataSourceID="FastTrackDataSource">
            <CommandItemSettings ExportToPdfText="Export to PDF">
            </CommandItemSettings>
            <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                <HeaderStyle Width="20px"></HeaderStyle>
            </RowIndicatorColumn>
            <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                <HeaderStyle Width="20px"></HeaderStyle>
            </ExpandCollapseColumn>
            <Columns>
                <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                </telerik:GridEditCommandColumn>
                <telerik:GridBoundColumn DataField="EmployeeId" FilterControlAltText="Filter EmployeeId column" HeaderText="Employee ID" SortExpression="EmployeeId" UniqueName="EmployeeId" DataType="System.Int32" ReadOnly="true">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="LastName" FilterControlAltText="Filter LastName column" HeaderText="Last Name" SortExpression="LastName" UniqueName="LastName" ReadOnly="True">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="FirstName" FilterControlAltText="Filter FirstName column" HeaderText="First Name" ReadOnly="True" SortExpression="FirstName" UniqueName="FirstName">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="JobTitle" FilterControlAltText="Filter JobTitle column" HeaderText="Job Title" SortExpression="JobTitle" UniqueName="JobTitle">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="division_name" FilterControlAltText="Filter division_name column" HeaderText="Division" ReadOnly="True" SortExpression="division_name" UniqueName="division_name">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="unit_name" FilterControlAltText="Filter unit_name column" HeaderText="Unit" ReadOnly="True" SortExpression="unit_name" UniqueName="unit_name">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Status" DataType="System.Int32" FilterControlAltText="Filter Status column" HeaderText="Status" SortExpression="Status" UniqueName="Status">
                 <FilterTemplate>
                        <telerik:RadComboBox ID="StatusCombo" runat="server" OnSelectedIndexChanged="StatusCombo_SelectedIndexChanged" AutoPostBack="true">
                            <Items>
                                <telerik:RadComboBoxItem Text="All" Value="ALL" />
                                <telerik:RadComboBoxItem Text="Active" Value="1"></telerik:RadComboBoxItem>
                                <telerik:RadComboBoxItem Text="Inactive" Value="0"></telerik:RadComboBoxItem>
                            </Items>
                        </telerik:RadComboBox>
                    </FilterTemplate>
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Start_date" DataType="System.DateTime" FilterControlAltText="Filter Start_date column" HeaderText="Start Date" SortExpression="Start_date" UniqueName="Start_date">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="End_date" DataType="System.DateTime" FilterControlAltText="Filter End_date column" HeaderText="End Date" SortExpression="End_date" UniqueName="End_date">
                </telerik:GridBoundColumn>
            </Columns>
            <EditFormSettings>
                <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                </EditColumn>
            </EditFormSettings>
        </MasterTableView>
        <FilterMenu EnableImageSprites="False">
        </FilterMenu>
    </telerik:RadGrid>
    <asp:EntityDataSource ID="FastTrackDataSource" runat="server" ConnectionString="name=FastTrackEntities" DefaultContainerName="FastTrackEntities" EnableFlattening="False" EntitySetName="CPS_SocialWorkers" EnableUpdate="True">
    </asp:EntityDataSource>

Here is the code-behind:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CPSTrainingLog.DAL;
using Telerik.Web.UI;
using System.Drawing;
  
namespace CPSTrainingLog
{
    public partial class CPSSocialWorkersListing : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
              
        }
         
        protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                GridDataItem item = (GridDataItem)e.Item;
                if (item["Status"].Text == "1")
                {
                    item["Status"].Text = "Active";
                    item["Status"].ForeColor = Color.Green;
                }
                else if (item["Status"].Text == "0")
                {
                    item["Status"].Text = "Inactive";
                    item["Status"].ForeColor = Color.Red;
                }
            }
  
        }
  
        protected void StatusCombo_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            GridFilteringItem item = RadGrid1.MasterTableView.GetItems(GridItemType.FilteringItem)[0] as GridFilteringItem;
            RadComboBox radComboBoxFilterStatus = item["Status"].Controls[0] as RadComboBox;
            string filterStatus = Convert.ToString(radComboBoxFilterStatus.SelectedValue);
            RadGrid1.MasterTableView.FilterExpression = string.Empty;
            if (e.Value.Equals("1") || e.Value.Equals("0"))
            {
                RadGrid1.MasterTableView.FilterExpression = RadGrid1.MasterTableView.FilterExpression + string.Format("it.[Status] = {0}", Convert.ToInt32(e.Value));
            }
            GridColumn columnID = RadGrid1.MasterTableView.GetColumnSafe("Status");
            columnID.CurrentFilterValue = filterStatus;
            RadGrid1.Rebind();
             
        }
  
          
  
         
    }
}

and here is the error i get after filtering on the Status column:

Server Error in '/' Application.
--------------------------------------------------------------------------------
  
Object reference not set to an instance of an object. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
  
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
  
Source Error: 
  
  
Line 41:             GridFilteringItem item = RadGrid1.MasterTableView.GetItems(GridItemType.FilteringItem)[0] as GridFilteringItem;
Line 42:             RadComboBox radComboBoxFilterStatus = item["Status"].Controls[0] as RadComboBox;
Line 43:             string filterStatus = Convert.ToString(radComboBoxFilterStatus.SelectedValue);
Line 44:             RadGrid1.MasterTableView.FilterExpression = string.Empty;
Line 45:             if (e.Value.Equals("1") || e.Value.Equals("0")) 
  
Source File: c:\Users\huntra\Documents\Visual Studio 2012\Projects\CPSTrainingLog\CPSTrainingLog\CPSSocialWorkersListing.aspx.cs    Line: 43 
  
Stack Trace: 
  
  
[NullReferenceException: Object reference not set to an instance of an object.]
   CPSTrainingLog.CPSSocialWorkersListing.StatusCombo_SelectedIndexChanged(Object sender, RadComboBoxSelectedIndexChangedEventArgs e) in c:\Users\huntra\Documents\Visual Studio 2012\Projects\CPSTrainingLog\CPSTrainingLog\CPSSocialWorkersListing.aspx.cs:43
   Telerik.Web.UI.RadComboBox.OnSelectedIndexChanged() +191
   Telerik.Web.UI.RadComboBox.RaisePostDataChangedEvent() +37
   Telerik.Web.UI.RadDataBoundControl.System.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent() +13
   System.Web.UI.Page.RaiseChangedEvents() +132
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1644
   
  
  
--------------------------------------------------------------------------------


Shinu
Top achievements
Rank 2
 answered on 15 Jan 2013
9 answers
250 views
I have an autocompletebox in a div with display:none set. If I change the display on the div to make the autocompletebox visible it does not work. However if when the page loads the div is not hidden it works perfectly.
Matthew Botting
Top achievements
Rank 1
 answered on 15 Jan 2013
1 answer
58 views
Hi,
I need to build 3 autocompletebox related each other (Region, Province and City) with webservices. I dont understand how to build relation becouse I found only samples about related combo boxes.

Thanks
MasterChiefMasterChef
Top achievements
Rank 2
 answered on 14 Jan 2013
1 answer
102 views
Hi,

I have a RadDateTimepicker and changed the font size to 20px and when I assign a date/time to it using SelectedDate, the text is truncated.  See attached picture and notice the PM is missing.  I have pasted my code.

Datey.SelectedDate = now

Browser: IE 10

When I change the font to 15px, all shows fine.

Thanks.
Tim

<telerik:RadDateTimePicker ID="Datey" Style="vertical-align: middle;" Width="300px" runat="server" Skin="Default" Culture="English (United States)" EnableTyping="False">
                                                                            <DateInput runat="server" Font-Size="20px" >
                                                                            </DateInput>
                                                                            <Calendar ID="Calendar1" UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x" Skin="Telerik" ShowRowHeaders="False" runat="server">
                                                                                <SpecialDays>
                                                                                    <telerik:RadCalendarDay Repeatable="Today">
                                                                                        <ItemStyle CssClass="rcToday" />
                                                                                    </telerik:RadCalendarDay>
                                                                                </SpecialDays>
                                                                            </Calendar>
                                                                        </telerik:RadDateTimePicker>



										
MasterChiefMasterChef
Top achievements
Rank 2
 answered on 14 Jan 2013
Narrow your results
Selected tags
Tags
+? 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?