Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
111 views
Hello,

Is it possible to have the RadMaskedTextBox to start from the beginning of the textbox, instead of allowing the user to click anywhere inside of it?

Thanks.
Nikolay Rusev
Telerik team
 answered on 17 Dec 2010
1 answer
35 views
Both the header and detail tables are loaded on the page load. So all the records are shown. The detail record is one level\ line below the corresponding header record.
However, the requirement is each header record and detailed record pairs should be at same level(next to each other..like columns).
How to handle this?
Nikolay Rusev
Telerik team
 answered on 17 Dec 2010
1 answer
141 views
I have a problem, how to execute function in behind code which is i must click a radtextbox button.
Because in radtextbox button method doesn't have onclick method. If it possible, i want see some simple example...
Anyone can help me please.... Thanx before


Regards Eggy...
Nikolay Rusev
Telerik team
 answered on 17 Dec 2010
1 answer
80 views
I have a handler for "OnClientClose" event of RadWindowManager. When I finish the confirm dialog, this event hires. How can I figure out it was confirmDialog or RadWindow? Thanks in advance.
Shinu
Top achievements
Rank 2
 answered on 17 Dec 2010
2 answers
192 views
Hello Guys.

I have successfully developed the RadScheduler as per requirement.
But now there are few changes.
At present i am showing my EventTitle in the appointment like in 1st December there are two events.
But now in that Day box instead of title i want to show total the number of events on that day occur in different color box as show in 15th December.
Please see the attached Snapshot for my requirement.
I hope this functionality is possible.

My present code is mentioned below.

OpenAccessProvider

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ERMS.Entities;
using ERMS.Services;
using System.Data;
using Telerik.Web.UI;
using Telerik.Web.UI.Calendar;
using Telerik.Web.UI.Scheduler;
 
/// <summary>
/// Summary description for OpenAccessCustomProvider
/// </summary>
public class OpenAccessCustomProvider : OpenAccessProviderBase
{
    public OpenAccessCustomProvider()
    {
        //
        // TODO: Add constructor logic here
        //
    }
 
    public override void Delete(RadScheduler owner, Appointment appointmentToDelete)
    {
        throw new NotImplementedException();
    }
 
 
    #region " Declaration "
 
    Orders objOrders = new Orders();
    OrdersService objOrdersService = new OrdersService();
    TList<Orders> objOrdersList = new TList<Orders>();
 
    ViewGetSearchOrdersService objOrderView = new ViewGetSearchOrdersService();
 
    DataSet dsOrderView = new DataSet();
 
    #endregion
 
 
    #region " Variables "
 
    Int32 _int_cnt = 0;
 
    #endregion
 
 
    public override IEnumerable<Appointment> GetAppointments(RadScheduler owner)
    {
 
        List<Appointment> appList = new List<Appointment>();
 
        DateTime dtEndDate = new DateTime();
        DateTime dtStartDate = new DateTime();
 
        dsOrderView = objOrderView.GetPaged("CompanyIDF = " + (new clsPageBase()).SESSION_COMPANYID + "", "OrderDate", 0, int.MaxValue, out _int_cnt).ToDataSet(true);
 
        if (dsOrderView != null && dsOrderView.Tables.Count > 0)
        {
            for (int i = 0; i < dsOrderView.Tables[0].Rows.Count; i++)
            {
                if (!string.IsNullOrEmpty(dsOrderView.Tables[0].Rows[i]["StartDate"].ToString()))
                {
                    if (string.IsNullOrEmpty(dsOrderView.Tables[0].Rows[i]["StartTime"].ToString()) == false)
                    {
                        dtStartDate = Convert.ToDateTime(Convert.ToDateTime(dsOrderView.Tables[0].Rows[i]["StartDate"]).ToString("MM dd yyyy") + " " + dsOrderView.Tables[0].Rows[i]["StartTime"].ToString());
                    }
                }
 
                if (!string.IsNullOrEmpty(dsOrderView.Tables[0].Rows[i]["FinishDate"].ToString()))
                {
                    if (string.IsNullOrEmpty(dsOrderView.Tables[0].Rows[i]["FinishTime"].ToString()) == false)
                    {
                        dtEndDate = Convert.ToDateTime(Convert.ToDateTime(dsOrderView.Tables[0].Rows[i]["FinishDate"]).ToString("MM dd yyyy") + " " + dsOrderView.Tables[0].Rows[i]["FinishTime"].ToString());
                    }
                }              
 
                Appointment newApponitment = new Appointment();
                newApponitment.Owner = owner;
                newApponitment.ID = dsOrderView.Tables[0].Rows[i]["OrderID"].ToString();
                newApponitment.Subject = dsOrderView.Tables[0].Rows[i]["Title"].ToString();
                newApponitment.Start = dtStartDate;
                newApponitment.End = dtEndDate;
 
                Resource newResource = new Resource();
                newResource.Type = "OrderStatus";
                newResource.Key = newApponitment.ID;
                newResource.Text = dsOrderView.Tables[0].Rows[i]["OrderStatus"].ToString();
 
                newApponitment.Resources.Add(newResource);
 
                appList.Add(newApponitment);
            }
        }
 
 
        return appList;
    }
 
    public override IEnumerable<ResourceType> GetResourceTypes(RadScheduler owner)
    {
        ResourceType[] resourceTypes = new ResourceType[1];
 
        resourceTypes[0] = new ResourceType("OrderStatus", false);
 
        return resourceTypes;
    }
 
    public override IEnumerable<Resource> GetResourcesByType(RadScheduler owner, string resourceType)
    {
        List<Resource> OrderResources = new List<Resource>();
 
        TList<OrderStatus> objOrderStatusList = new TList<OrderStatus>();
 
        foreach (OrderStatus item in (new OrderStatusService()).GetAll())
        {
            Resource newResource = new Resource();
            newResource.Type = "OrderStatus";
            newResource.Key = item.Id;
            newResource.Text = item.Status;
            OrderResources.Add(newResource);
        }
 
        return OrderResources;
    }
 
    public override void Insert(RadScheduler owner, Appointment appointmentToInsert)
    {
        throw new NotImplementedException();
    }
 
    public override void Update(RadScheduler owner, Appointment appointmentToUpdate)
    {
        throw new NotImplementedException();
    }
}

Html-Souce

<telerik:RadScheduler runat="server" ID="RadScheduler1" Skin="Default" ShowFooter="true" OverflowBehavior="Scroll" SelectedView="MonthView" Height="100%" NumberOfHoveredRows="1" DataKeyField="ID" DataSubjectField="Subject" DataStartField="Start" DataEndField="End"
TimelineView-UserSelectable="false" Culture="(Default)" StartInFullTime="true"
AllowDelete="false" AllowEdit="false" AllowInsert="false" ShowViewTabs="true"
OnAppointmentDataBound="RadScheduler1_AppointmentDataBound" ProviderName="OpenAccessProvider" OnAppointmentCreated="RadScheduler1_AppointmentCreated">
  <Localization AdvancedAllDayEvent="All day" />
  <AdvancedForm DateFormat="M/d/yyyy" TimeFormat="h:mm tt" />
  <AppointmentTemplate>
  <asp:LinkButton ID="lnkSubject" runat="server"></asp:LinkButton>
  </AppointmentTemplate>
</telerik:RadScheduler>

Code-Behind

protected void RadScheduler1_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
    {
        Label lblRed = (Label)e.Container.FindControl("lblRed");
        LinkButton lnkSubject = (LinkButton)e.Container.FindControl("lnkSubject");
        lnkSubject.Text = clsGeneral.ShowSingleQuote(e.Appointment.Subject);
        //lnkSubject.Attributes.Add("onClick", "return DoFilter('" + e.Appointment.ID.ToString() + "','" + e.Appointment.Resources.GetResourceByType("OrderStatus").Text + "');");
        lnkSubject.Attributes.Add("onclick", "return DisplayEventInformation(" + e.Appointment.ID.ToString() + " );");
        lnkSubject.Attributes.Add("onmouseover", "javascript:ddrivetip('<b>Click here to manage this Event</b>',250);");
        lnkSubject.Attributes.Add("onmouseout", "javascript:hideddrivetip();");
        e.Appointment.ToolTip = "";
        lblRed.Text = e.Appointment.Resources.GetResourceByType("OrderStatus").Text;
    }   
 
    protected void RadScheduler1_AppointmentDataBound(object source, SchedulerEventArgs e)
    {
 
        Int64 OrderID = 0;
 
        OrderID = Convert.ToInt64(e.Appointment.ID);
 
        objOrders = objOrdersService.GetById(OrderID);
 
        DateTime dtOrder = Convert.ToDateTime(objOrders.OrderDate);
        DateTime dtStartOn = Convert.ToDateTime(e.Appointment.Start);
        DateTime dtToday = DateTime.Now;
        Int64 days = 0;
        Int64 days1 = 0;
 
 
        days = clsGeneral.DateDiff(clsGeneral.DateInterval.Hour, dtToday, dtStartOn);
        days = days / 24;
 
        days1 = clsGeneral.DateDiff(clsGeneral.DateInterval.Hour, dtOrder, dtStartOn);
        days1 = days1 / 24;
 
        //For the Highest Priority Order,Consider Today Date and StartUp Date
 
        //For the Rush Order,Consider the Order Date to Start Date Difference
        if (days1 <= 5)
        {
            e.Appointment.CssClass = "rsCategoryBlue";
        }
        else
        {
            if (days <= 5)
            {
                e.Appointment.CssClass = "rsCategoryRed";
            }
            else if (days > 5)
            {
                e.Appointment.CssClass = "rsCategoryYellow";
            }
        }
         
    }

Thanks
Pushkar
Pushkar
Top achievements
Rank 1
 answered on 17 Dec 2010
3 answers
104 views
I have a rad grid on my web page and what I want to do is inline editing on only a few cells in a row.  When the quantity cell is changed, I would like to be able to make some calculations and change some of the other cells in the grid that are read only.  I have the grid up and have the edit button, but I don't know how to get those values to change the other cells before it updates the database.  I've tried a couple different ways and the only values I get are &nbsp; for every cell. 
Here's my source code for the grid and sqldatasource.

<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" 
            Skin="Telerik" AllowAutomaticDeletes="True" 
            DataSourceID="SqlDataSourceQuoteItems" GridLines="None" 
            AllowAutomaticInserts="True" OnItemDeleted="RadGrid1_ItemDeleted" OnItemInserted="RadGrid1_ItemInserted">
<MasterTableView DataSourceID="SqlDataSourceQuoteItems" CommandItemDisplay="TopAndBottom" AutoGenerateColumns="False"
                DataKeyNames="id">
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
  
<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
    <Columns>
     <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                        <ItemStyle CssClass="MyImageButton" />
                    </telerik:GridEditCommandColumn>
        <telerik:GridBoundColumn DataField="id" DataType="System.Int32" HeaderText="id" 
            ReadOnly="True" SortExpression="id" UniqueName="id" Visible="False">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="QuoteNo" HeaderText="QuoteNo" 
            SortExpression="QuoteNo" UniqueName="QuoteNo" Visible="False">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Room" HeaderText="Room" 
            SortExpression="Room" UniqueName="Room" ColumnEditorID="GridTextBoxRoom">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Elevation" HeaderText="Elevation" 
            SortExpression="Elevation" UniqueName="Elevation" ColumnEditorID="GridTextBoxElevation">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="PartNo" HeaderText="PartNo" 
            SortExpression="PartNo" UniqueName="PartNo" ColumnEditorID="GridTextBoxPartNo" ReadOnly="true">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Qty" DataType="System.Double" 
            HeaderText="Qty" SortExpression="Qty" UniqueName="Qty" ColumnEditorID="GridNumericQty">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="ListPrice" DataType="System.Double" 
            HeaderText="Price" SortExpression="ListPrice" UniqueName="ListPrice" ColumnEditorID="GridTextBoxListPrice" ReadOnly="true">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="TotalPrice" DataType="System.Double" 
            HeaderText="Total Price" SortExpression="TotalPrice" UniqueName="TotalPrice"  ColumnEditorID="GridTextBoxTotalPrice" ReadOnly="true">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="EachWeight" DataType="System.Double" 
            HeaderText="Weight" SortExpression="EachWeight" UniqueName="EachWeight" ColumnEditorID="GridTextBoxEachWeight" ReadOnly="true">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="TotalWeight" DataType="System.Double" 
            HeaderText="Total Weight" SortExpression="TotalWeight" UniqueName="TotalWeight" ColumnEditorID="GridTextBoxTotalWeight" ReadOnly="true">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="EachCubes" DataType="System.Double" 
            HeaderText="Cubes" SortExpression="EachCubes" UniqueName="EachCubes" ColumnEditorID="GridTextBoxEachCubes" ReadOnly="true">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="TotalCubes" DataType="System.Double" 
            HeaderText="Total Cubes" SortExpression="TotalCubes" UniqueName="TotalCubes" ColumnEditorID="GridTextBoxTotalCubes" ReadOnly="true">
        </telerik:GridBoundColumn>
        <telerik:GridButtonColumn ConfirmText="Delete this product?" ConfirmDialogType="RadWindow"
                        ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                        UniqueName="DeleteColumn">
                        <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
                    </telerik:GridButtonColumn>
    </Columns>
     <EditFormSettings ColumnNumber="7" CaptionDataField="PartNo" CaptionFormatString="Edit properties of Product {0}">
        <FormTableItemStyle Wrap="False"></FormTableItemStyle>
                    <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>
                    <FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="3" BackColor="White"
                        Width="100%" />
                    <FormTableStyle CellSpacing="0" CellPadding="2" Height="110px" BackColor="White" />
                    <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>
                    <EditColumn ButtonType="ImageButton" InsertText="Insert Product" UpdateText="Update record"
                        UniqueName="EditCommandColumn1" CancelText="Cancel edit">
                    </EditColumn>
                    <FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>
     </EditFormSettings>
</MasterTableView>
  
 <ClientSettings>
                <ClientEvents OnRowDblClick="RowDblClick" />
            </ClientSettings>
        </telerik:RadGrid>
          
         <telerik:GridTextBoxColumnEditor ID="GridTextBoxRoom" runat="server" TextBoxStyle-Width="25px" />
            <telerik:GridTextBoxColumnEditor ID="GridTextBoxElevation" runat="server" TextBoxStyle-width="25px" />
             <telerik:GridTextBoxColumnEditor ID="GridTextBoxPartNo" runat="server" TextBoxStyle-width="90px" />
            <telerik:GridTextBoxColumnEditor ID="GridTextBoxListPrice" runat="server" TextBoxStyle-width="45px" />
            <telerik:GridTextBoxColumnEditor ID="GridTextBoxTotalPrice" runat="server" TextBoxStyle-width="45px" />
             <telerik:GridTextBoxColumnEditor ID="GridTextBoxEachWeight" runat="server" TextBoxStyle-width="35px" />
            <telerik:GridTextBoxColumnEditor ID="GridTextBoxTotalWeight" runat="server" TextBoxStyle-width="35px" />
            <telerik:GridTextBoxColumnEditor ID="GridTextBoxEachCubes" runat="server" TextBoxStyle-width="40px" />
            <telerik:GridTextBoxColumnEditor ID="GridTextBoxTotalCubes" runat="server" TextBoxStyle-width="40px" />
            <telerik:GridTextBoxColumnEditor ID="GridNumericQty" runat="server" TextBoxStyle-width="35px" />
            <telerik:RadWindowManager ID="RadWindowManager2" runat="server"></telerik:RadWindowManager>
          
        <asp:SqlDataSource ID="SqlDataSourceQuoteItems" runat="server" 
            ConnectionString="Data Source=DWDATA2;Initial Catalog=DWJobInfo;Integrated Security=True" 
            ProviderName="System.Data.SqlClient" 
              
            SelectCommand="SELECT * FROM [tblMetalCabsQuoteItems] WHERE ([QuoteNo] = @QuoteNo) ORDER BY [Room], [Elevation]" 
            DeleteCommand="DELETE FROM tblMetalCabsItems WHERE id = @id">
            <SelectParameters>
                <asp:ControlParameter ControlID="lblQuoteNo" Name="QuoteNo" PropertyName="Text" 
                    Type="String" />
            </SelectParameters>
            <DeleteParameters>
                <asp:Parameter Name="id" Type="Int16" />
            </DeleteParameters>
        </asp:SqlDataSource>

I know I have to add some parameters for the update sqldatasource yet.  But I figured I have to figure out this problem before i can even think about doing that part of it yet.  So, when I click edit and change the values I need to, how do I grab all the values to do some calculations and then to update the database to then refresh the grid?
Princy
Top achievements
Rank 2
 answered on 17 Dec 2010
3 answers
152 views

Folks, Using Telerik ASP.NET Ajax 2010 built 3 with VS 2010.

I have a hierachal radgrid. I would like to prevent users with an alert message to expand the Row without selecting the Row 1st.

For example, if Parent row 1 is selected, then if I click to expand Parent row 2 without selecting Parent row 2
-- Although Parent row 1 is still selected, but Parent row 2 expands.

I understand from this for single/expand:
http://www.telerik.com/help/aspnet-ajax/grdsingleexpandinhierarchicalgrid.html

Basically

- Attached file is my desire result (Child Expanded After Parent Row Highlighted.JPG)

- Attached file is NOT my desire result (Child Expanded without Parent Row Highlighted.JPG)

Thanks.
GC_0620

Princy
Top achievements
Rank 2
 answered on 17 Dec 2010
13 answers
1.1K+ views
Hi,

I have a GridClientSelectColumn in a RadGrid. When a client selects a row, I would like to retrieve a value from the selected row and save it to a variable. I have tried using the ItemCreated, ItemCommand, and ItemEvent. So far I've had no luck... any suggestions would be appreciated.

Thanks,

Jack   
Catherine
Top achievements
Rank 1
 answered on 17 Dec 2010
1 answer
71 views
Hi,

Is export option is there with tree list.if so how?
Daniel
Telerik team
 answered on 17 Dec 2010
1 answer
106 views
Hi all,

I was wondering is it possible to export the RadGrid to Excel like the one in this demo (http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/nestedviewtemplate/defaultvb.aspx). (See 1.png and 2.png attachments)

At the moment, my page replicates the demo pretty closely. Unlike the demo, the three RadTabs all contains a RadGrid with relations to the main RadGrid. I want to be able to export each of these RadGrids independently. Each RadPageView will contain a button and a RadGrid. The button will export the RadGrid in that RadPageView only.

My problem right now is I cannot address the button or RadGrid inside the NestedViewTemplate from code behind. Could this be done?

Thanks,
Gary
Daniel
Telerik team
 answered on 17 Dec 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?