Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
107 views
The page I'm dealing with has a RadTextBox then a RadEditor following it.  Is it possible, when the Tab key is hit, to jump from the RadTextBox to the RadEditor's body input, skipping over the formatting options (Print, spellcheck, undo, redo, etc...)?  This would allow a user to type into the RadTextBox, hit Tab, and immediately start typing into the RadEditor, instead of needing to tab multiple times, or click.

Thanks
Princy
Top achievements
Rank 2
 answered on 08 Jun 2012
0 answers
172 views
Hi
I have a user control (ascx) with a radgrid. The user control is placed in a container control and that is placed in update panel.
I always get 
$find("ctl00_phMain_FS_TreeClients_ClientsList1_RadGrid1") is null

I've tried to move the container out of the update panel but the result is the same.
here is my user control code

    <script type="text/javascript">
        function RefreshClientGrid() {
            try
            {
                var masterTable = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
                masterTable.rebind();
            }catch(Error)
            {
                alert(Error);
            }
             
        }
    </script>
<asp:Label ID="CompanyIdLabel" runat="server" Visible="False"></asp:Label>
<uc1:FSCompanyReadOnly ID="FSCompanyReadOnly1" runat="server" />
<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AllowSorting="True"
    AutoGenerateColumns="False" DataSourceID="LinqDataSource1"
    GridLines="None" Skin="Telerik"
    PageSize="15" CellSpacing="0" OnItemCommand="RadGrid1_ItemCommand"
    AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
    AllowAutomaticUpdates="True">
    <MasterTableView DataKeyNames="ClientId" CommandItemDisplay="Top" ClientDataKeyNames="ClientId">
        <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
        <RowIndicatorColumn>
            <HeaderStyle Width="20px"></HeaderStyle>
        </RowIndicatorColumn>
        <ExpandCollapseColumn>
            <HeaderStyle Width="20px"></HeaderStyle>
        </ExpandCollapseColumn>
        <Columns>
            <telerik:GridEditCommandColumn ButtonType="LinkButton" UniqueName="EditCommandColumn">
                <ItemStyle CssClass="GridImageButton" />
            </telerik:GridEditCommandColumn>
            <telerik:GridBoundColumn DataField="ClientId" DataType="System.Int32" HeaderText="ClientId"

Help please
Peter
Top achievements
Rank 1
 asked on 08 Jun 2012
2 answers
126 views
I am new to RadControls and am trying the trial version.

What I am trying to find is an example of the following (I've searched the forum for hours (over 2 days)):

Within a Grid there will be textboxes. When a textbox is clicked, I want a different grid to popup so that the user can click on an item in that second grid. The second grid will then close and the textbox (in the first grid) will populate with data that was selected from the second grid.

I think this is a fairly common behavior, in short, a Lookup of potential data that can be filled in the textbox.

Very similar to a calendar lookup, when a date is selected, the textbox fills with that date. I just want to show a grid and fill the textbox with the selected data (string, or whatever).

If there is a RadControl that does this out of the box, then I would like to know the name. I thought I had looked at all those nice tools and didn't seem to find a proper match for this functionality.

I look forward to your help :-)

Thank you in advance,

R
R
Top achievements
Rank 1
 answered on 07 Jun 2012
1 answer
106 views
Hi

I got a radGrid I update on it but now i dont want to update all my fields meaning i want a user to be restricted on accessing some textboxes during update on the grid.My problem is when i make them readonly they overwrite on database as null not keeping thier records. how would i achieve that?
Jayesh Goyani
Top achievements
Rank 2
 answered on 07 Jun 2012
1 answer
221 views
Hi, 
I am having an issue with RadComboBox not keeping the selected item on postback on my Local where as same code is working fine on the production server or any of my team's local machine. I am not sure when i started having this problem but until i was debugging a page which has a RadComboBox.
<telerik:RadComboBox ID="ddlcmd" runat="server" CheckBoxes="true" Width="300px" OnClientItemChecked="OnClientItemChecked" AllowCustomText="false">
               <Items>
                   <telerik:RadComboBoxItem Text="item1" checked="true" />
                   <telerik:RadComboBoxItem Text="item2" checked="true" />
                   <telerik:RadComboBoxItem Text="item3" />
                   <telerik:RadComboBoxItem Text="item4" checked="true" />
               </Items>
           </telerik:RadComboBox>


function OnClientItemChecked(sender, eventArgs) {
     var item = eventArgs.get_item();
     sender.set_text("You checked " + item.get_text());
 }

During runtime when i check item3 then on post back the dropdown still has just three items checked. On further investigation the RadGrid on the same page as well as other pages do not sort Ascending / Descending while the same code works find on prod or any of my teams local machine. The grouping of the RadGrid works fine though. These controls were working perfectly and the only thing i can think of is i had recently ran the Telerik.Web.UI_2012_1_411_Dev installer i downloaded from Telerik itself in order to grab and manipulate the RadEditor's Tools pop controls.

I usually just make reference to the Telerik Dlls in the project so I uninstalled the Telerik control thinking that would fix the issue and deleted asp.net temporary files, restarted IIS couple of times, Clean, Rebuild etc but no luck . The only option i have right now is to uninstall the VS2010 and reset up my machine(which is a pain) for team development --but i'd like to know if there is an easier way to resolve this issue??
Ivana
Telerik team
 answered on 07 Jun 2012
0 answers
97 views

i have a Telerik RadGrid in a ASP.Net page, my solution is using MVP pattern. i need implementing MVP pattern for CRUD operations for my RadGrid. any body knows about this?

many thanks.

amir
Top achievements
Rank 1
 asked on 07 Jun 2012
1 answer
67 views
Hello.
I have the following question.
I have one RadPane which includes three RadPanes. First internal RadPane includes RadSlidingPane.
Is it possible to maximize (and then minimize) this RadSlidingPane in the way that it will be fit into external RadPane ?
Thanks in advance.
Niko
Telerik team
 answered on 07 Jun 2012
7 answers
114 views
Hi there,

I am thinking about a way to extend the Document/Image managers in the Editor to allow a user to store actual metadata about each item somewhere. It is similar in a way to the concept of your custom content provider:
http://demos.telerik.com/aspnet-ajax/editor/examples/dbfilebrowsercontentprovider/defaultcs.aspx

But really I am more interested in reading additional data about a file into fields on the properties tab and then allowing a way for the user to save it. I'm thinking the easiest route might be to have an xml document somewhere that I can store this metadata per item in. Then I need to override the Dialogs and build in code that loads the info into extra fields on the properties tab.

Is there any existing framework I can tie into? Client-side or Server-side events? Or any existing examples of something similar to this?

Many thanks
Gavin
Phil
Top achievements
Rank 1
 answered on 07 Jun 2012
3 answers
116 views

Hi!

I've a radgrid with autogeneratecolumn=true, i'm using advenced databinding to bind the data.

when i change the page or apply filter/sorting the radgrid throws exception during the binding (eg column not found).

the problem occures when change the datasource and reloaded the page.

I tried to set enableviewstatecolumn=false but not works.

Can I help me?

Eyup
Telerik team
 answered on 07 Jun 2012
1 answer
38 views
So here's the scenario that I have:

I have a dashboard that has multiple radgrids in it.  These rad grids are one offs (in other words no update, delete, add).  I want to be able to let the users click on a row and redirect to a report page.  All of this works until I want to have each radgrid update every 5 seconds.  The calls are made from code behind. I thought about adding a ticker like the example here:

http://demos.telerik.com/aspnet-ajax/grid/examples/client/livedata/defaultcs.aspx

However this doesn't work because the data I am pulling is designed to work for an increasing number of rad grids so if the client decided they want to add another radgrid they can.  I use a lambda expression to parse the object from code behind.  Which isn't really possible to do from javascript and ajax (that I am aware of).  If I add the static classes this makes the display to brittle and will require maintenance more often than I wanted. 

So I decided to go with the update panel binding the ajaxmanager to the radgrid at instantiation of the radgrid.  Here's my current problem.  If I bind the update panel I need to assign an ID to reference the control.  If I pass in the control during instantiation then I have to create concrete NeedDataSource classes.  Is there any way to create n number of rad grids from code behind and then have the following abilities:

1.   Allow row clicked events
2.   update every interval

I keep getting i.get_postBackElement() is undefined. Here's a look at some of the code I have (that doesn't work):

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="LoadingPanel1" runat="server" />
    <fieldset id="Facility" class="dashboardFieldsetDisplay">
        <legend>Facility Data</legend>
        <asp:Panel ID="FacilityGrids" runat="server" CssClass="dashboardGrid"></asp:Panel>
    </fieldset>
    <fieldset id="Company" class="dashboardFieldsetDisplay">
        <legend>Company Data</legend>
        <asp:Panel ID="CompanyGrids" runat="server" CssClass="dashboardGrid"></asp:Panel>
    </fieldset>
    <fieldset id="Region" class="dashboardFieldsetDisplay">
        <legend>Region Data</legend>
        <asp:Panel ID="RegionGrids" runat="server" CssClass="dashboardGrid"></asp:Panel>
    </fieldset>
    <div class="clearBoth"></div>
    <div class="displayNone">
        <asp:Timer ID="Ticker" runat="server" OnTick="Ticker_Ticked"></asp:Timer>
    </div>
</asp:Content>

Code Behind:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using PCSGroup.Freund;
using Telerik.Web.UI;
 
 
public partial class _default : Base
{
    private List<DateTime> dateRange = new List<DateTime>();
    private List<RegionalSales> allRegionalSales = new List<RegionalSales>();
    private List<FacilitySales> allFacilitySales = new List<FacilitySales>();
    private List<CompanySales> allCompanySales = new List<CompanySales>();
    private List<RadGrid> listOfGrids = new List<RadGrid>();
    private int dashboardWidth = 235;
 
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);
        int count = 0;
        while(count < 5)
        {
            dateRange.Add(DateTime.Now.Date.AddDays(count));
            count++;
        }
 
        foreach (DateTime day in dateRange)
        {
            //loops through the region sales object and creates a list of regionalsales if any exist for that date
            RegionalSales regionOrders = new RegionalSales(day);
            allRegionalSales.AddRange(regionOrders.SelectOrders());
 
            //loops through the facility sales object and creates a list of facilitysales if any exist for that date
            FacilitySales facilityOrders = new FacilitySales(day);
            allFacilitySales.AddRange(facilityOrders.SelectOrders());
 
            //loops through the company sales object and creates a list of companysales if any exist for that date
            CompanySales companyOrders = new CompanySales(day);
            allCompanySales.AddRange(companyOrders.SelectOrders());
        }
    }
 
    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);
        Ticker.Interval = 3000;
        foreach (Region region in new Region().SelectAllRegionsNotDeleted())
        {
            Panel gridWrapper = new Panel();
            gridWrapper.Width = 250;
            gridWrapper.CssClass = "floatLeft";
            Literal regionHead = new Literal();
            regionHead.Text = String.Format("<h2>{0}</h2>", region.RegionName);
            gridWrapper.Controls.Add(regionHead);
            gridWrapper.Controls.Add(GetRegionChart(region.RegionID));
            RegionGrids.Controls.Add(gridWrapper);
        }
        foreach (Facility facility in new Facility().SelectAllFacilitiesNotDeleted())
        {
            Literal facilityHead = new Literal();
            facilityHead.Text = String.Format("<h2>{0}</h2>", facility.FacilityName);
            FacilityGrids.Controls.Add(facilityHead);
            FacilityGrids.Controls.Add(GetFacilityChart(facility.FacilityID));
        }
        foreach (Company company in new Company().SelectAllCompaniesNotDeleted().Where(i => i.CompanyID != 2).ToList())
        {
            Panel gridWrapper = new Panel();
            gridWrapper.Width = 250;
            gridWrapper.CssClass = "floatLeft";
            Literal companyHead = new Literal();
            companyHead.Text = String.Format("<h2>{0}</h2>", company.CompanyName);
            gridWrapper.Controls.Add(companyHead);
            gridWrapper.Controls.Add(GetCompanyChart(company.CompanyID));
            CompanyGrids.Controls.Add(gridWrapper);
        }
    }
 
    protected void Company3_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {
        RadGrid company = listOfGrids.FirstOrDefault(i => i.ID == "Company_3");
        company.DataSource = allCompanySales.Where(i => i.CompanyID == 3);
    }
 
    public void Ticker_Ticked(object sender, EventArgs e)
    {
        foreach (RadGrid grid in listOfGrids)
        {
            grid.Rebind();
        }
    }
 
    private RadGrid GetRegionChart(int ID)
    {
        string[] keys = { "RegionID", "DeliveryDate" };
        RadGrid thisView = new RadGrid();
        thisView.CssClass = "roundedCorners";
        thisView.Skin = Skin;
        thisView.Width = dashboardWidth;
        thisView.AutoGenerateColumns = false;
        thisView.GridLines = GridLines.None;
        thisView.MasterTableView.Width = Unit.Percentage(100);
        thisView.MasterTableView.NoMasterRecordsText = string.Empty;
        thisView.MasterTableView.ClientDataKeyNames = keys;
        thisView.ClientSettings.ClientEvents.OnRowClick = "RegionRowClick";
 
        thisView.DataSource = allRegionalSales.Where(i => i.RegionID == ID);
 
        GridBoundColumn boundColumn;
 
        boundColumn = new GridBoundColumn();
        thisView.MasterTableView.Columns.Add(boundColumn);
        boundColumn.DataField = "DeliveryDate";
        boundColumn.HeaderText = "Date";
        boundColumn.DataFormatString = "{0:MM/dd}";
 
        boundColumn = new GridBoundColumn();
        thisView.MasterTableView.Columns.Add(boundColumn);
        boundColumn.DataField = "NewCount";
        boundColumn.HeaderText = "New";
 
        boundColumn = new GridBoundColumn();
        thisView.MasterTableView.Columns.Add(boundColumn);
        boundColumn.DataField = "RenewedCount";
        boundColumn.HeaderText = "Renewed";
 
        boundColumn = new GridBoundColumn();
        thisView.MasterTableView.Columns.Add(boundColumn);
        boundColumn.DataField = "CancelledCount";
        boundColumn.HeaderText = "Cancelled";
 
        listOfGrids.Add(thisView);
        return thisView;
    }
 
    private RadGrid GetFacilityChart(int ID)
    {
        string[] keys = { "FacilityID", "DeliveryDate" };
        RadGrid thisView = new RadGrid();
        thisView.CssClass = "roundedCorners";
        thisView.Skin = Skin;
        thisView.Width = dashboardWidth;
        thisView.AutoGenerateColumns = false;
        thisView.GridLines = GridLines.None;
        thisView.ID = String.Format("FacilityID_{0}", ID);
        thisView.MasterTableView.Width = Unit.Percentage(100);
        thisView.MasterTableView.NoMasterRecordsText = string.Empty;
        thisView.MasterTableView.ClientDataKeyNames = keys;
        thisView.ClientSettings.ClientEvents.OnRowClick = "FacilityRowClick";
 
        thisView.DataSource = allFacilitySales.Where(i => i.FacilityID == ID);
 
        GridBoundColumn boundColumn;
 
        boundColumn = new GridBoundColumn();
        thisView.MasterTableView.Columns.Add(boundColumn);
        boundColumn.DataField = "DeliveryDate";
        boundColumn.HeaderText = "Date";
        boundColumn.DataFormatString = "{0:MM/dd}";
 
        boundColumn = new GridBoundColumn();
        thisView.MasterTableView.Columns.Add(boundColumn);
        boundColumn.DataField = "NewCount";
        boundColumn.HeaderText = "New";
 
        boundColumn = new GridBoundColumn();
        thisView.MasterTableView.Columns.Add(boundColumn);
        boundColumn.DataField = "RenewedCount";
        boundColumn.HeaderText = "Renewed";
 
        boundColumn = new GridBoundColumn();
        thisView.MasterTableView.Columns.Add(boundColumn);
        boundColumn.DataField = "CancelledCount";
        boundColumn.HeaderText = "Cancelled";
 
        listOfGrids.Add(thisView);
        return thisView;
    }
 
    private RadGrid GetCompanyChart(int ID)
    {
        string[] keys = { "CompanyID", "DeliveryDate" };
        RadGrid thisView = new RadGrid();
        thisView.CssClass = "roundedCorners";
        thisView.Skin = Skin;
        thisView.Width = dashboardWidth;
        thisView.AutoGenerateColumns = false;
        thisView.GridLines = GridLines.None;
        thisView.ID = String.Format("Company_{0}", ID);
        thisView.MasterTableView.Width = Unit.Percentage(100);
        thisView.MasterTableView.NoMasterRecordsText = string.Empty;
        thisView.MasterTableView.ClientDataKeyNames = keys;
        thisView.ClientSettings.ClientEvents.OnRowClick = "CompanyRowClick";
        /*
         !!!!              Here's the code that doesn't work                  !!!!
                      I am creating a reference to a method
                      that does makes my code very brittle.
       */
        if (ID == 3)
        {
            thisView.NeedDataSource += new GridNeedDataSourceEventHandler(Company3_NeedDataSource);
        }
 
        RadAjaxManager1.DefaultLoadingPanelID = "LoadingPanel1";
        RadAjaxManager1.AjaxSettings.AddAjaxSetting(Ticker, thisView, null);
 
        // End Broken Code
 
        thisView.DataSource = allCompanySales.Where(i => i.CompanyID == ID);
 
        GridBoundColumn boundColumn;
 
        boundColumn = new GridBoundColumn();
        thisView.MasterTableView.Columns.Add(boundColumn);
        boundColumn.DataField = "DeliveryDate";
        boundColumn.HeaderText = "Date";
        boundColumn.DataFormatString = "{0:MM/dd}";
 
        boundColumn = new GridBoundColumn();
        thisView.MasterTableView.Columns.Add(boundColumn);
        boundColumn.DataField = "NewCount";
        boundColumn.HeaderText = "New";
 
        boundColumn = new GridBoundColumn();
        thisView.MasterTableView.Columns.Add(boundColumn);
        boundColumn.DataField = "RenewedCount";
        boundColumn.HeaderText = "Renewed";
 
        boundColumn = new GridBoundColumn();
        thisView.MasterTableView.Columns.Add(boundColumn);
        boundColumn.DataField = "CancelledCount";
        boundColumn.HeaderText = "Cancelled";
 
        listOfGrids.Add(thisView);
        return thisView;
    }
}
Josh
Top achievements
Rank 1
 answered on 07 Jun 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
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
Bronze
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?