Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
110 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
58 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
57 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
83 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
159 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
242 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
56 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
96 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
1 answer
102 views
I am in the process of taking all my Sql reports in sql reporting and moving to Telerik reporting.  Went to it becuase it was easy but its hard to maintain another server.  So what I would like is help in developing my first chart.  what I need to do is pull my information from a database and then rotate through it to add my data.  My first chart is pretty simple I need to create the side lengend based on amount of personnel it pulls from the database and then create a legend based on if they had have certain reviews done on them.
Annual
Ready
Not COmpleted

These should be in bar chart to show this.  My question is how to do this.  Are these seperate series or one series, i don't get the linog on the asp.net side.

How can i rotate through my datatable to get all this.

<telerik:RadChart ID="RadChart1" runat="server" Width="500px" >
            <Legend>
                <Items>
                
                </Items>
            </Legend>
        </telerik:RadChart>

Select Total, Readiness, Annual, NoComplete from #TempCount

So total would be the bar charts left legend for total # of personnel subdivided into 20 personl incriments,
then you would have 3 bars Readines, Annual and noComplete.
MasterChiefMasterChef
Top achievements
Rank 2
 answered on 14 Jan 2013
2 answers
105 views
Hello forums,

We are having a weird issue with RadChart in that sometimes the chart goes wonky when it is placing the labels for the dots on a line chart.  Yes, the dots are a bit close together, but it doesn't seem like they are all that terribly close together.  It's possible that this is just a RadChart bug.  We are currently using RadChart (ASP.net AJAX) version 2012.2.828.40.  Attached are some sample graphs for you to peruse.  Any suggestions of things we could try to tweak to keep this from happening would be welcome.

Thanks in advance,

Scott
Missing User
 answered on 14 Jan 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?