Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
441 views
How do I go to the last row of the RadGrid? the line must be visible and selected. I did so but it does not work (Prerender event):
                int c = rdg.Items.Count;
                GridDataItem item = rdg.Items[c - 1];

                rdg.ClientSettings.Scrolling.AllowScroll = true;
                item.Font.Bold = true;
                item.Selected = true;
                item.Display = true;
                item.Visible = true;
Eyup
Telerik team
 answered on 07 Jun 2016
1 answer
137 views

We had the following problems when a RadDropDownList has properties set to:

<telerik:RadComboBox  runat="server" ID="cmbStation" Width="100%" AutoPostBack="true" CausesValidation="false" EmptyMessage="Choose one" MarkFirstMatch="true" DataSource='<%# Stations %>' />

 

Once we clicked "clear" the content of the RadComboBox with the "X" button in IE or clear manually, no postback was raised from the control.

Instead have a "telerik" way, we just set the client event "OnClientDropDownClosing" the following javascript fonction:

function CheckIfCleared(sender, eventArgs) {
    if (sender._value == "" && sender._filterText == "") {
        sender.clearSelection();
        sender._applyEmptyMessage();
        __doPostBack(sender._uniqueId, 'SelectedIndexChanged');
    }
    return true;
}

Is there a "Telerik" way, for current or next release, embedded in this control to do it ?
Nencho
Telerik team
 answered on 07 Jun 2016
5 answers
305 views
Hi,

I have a PivotGrid, which has the following layout:

<telerik:RadPivotGrid ID="RadPivotGrid1" runat="server" AllowFiltering="false" RowGroupsDefaultExpanded="false"  RowTableLayout="Compact"
    ShowColumnHeaderZone="false" ShowDataHeaderZone="false" ShowFilterHeaderZone="false" ShowRowHeaderZone="false"
    OnNeedDataSource="RadPivotGrid1_NeedDataSource" OnCellDataBound="RadPivotGrid1_CellDataBound">
    <ClientSettings EnableFieldsDragDrop="false">
        <Scrolling AllowVerticalScroll="false"></Scrolling>
    </ClientSettings>
    <TotalsSettings RowsSubTotalsPosition="Last" ColumnsSubTotalsPosition="None" />
    <Fields>
        <telerik:PivotGridRowField DataField="Customer" ZoneIndex="0">
        </telerik:PivotGridRowField>
        <telerik:PivotGridRowField DataField="Contract" ZoneIndex="1">
        </telerik:PivotGridRowField>
        <telerik:PivotGridColumnField DataField="Quater">
        </telerik:PivotGridColumnField>
        <telerik:PivotGridColumnField DataField="SalesTax">
        </telerik:PivotGridColumnField>
        <telerik:PivotGridAggregateField DataField="Amount" Aggregate="Sum">
        </telerik:PivotGridAggregateField>
        <telerik:PivotGridAggregateField DataField="Changed" Aggregate="Sum" IsHidden="true">
        </telerik:PivotGridAggregateField>
    </Fields>
</telerik:RadPivotGrid>

The AggregateField "Amount" is type of decimal and "Changed" is type of bool. 

My aim is to format the Field "Amount" with an ending "*" or a special color, if the Field "Changed" is true. How could I achieve this?


Thanks,
Jan-Bernd
Angel Petrov
Telerik team
 answered on 07 Jun 2016
2 answers
141 views

Hello,

I just started using your scheduler and cant get through this issue. I bound my scheduler with a custom webservice which send me an array of "tasks". Thing is, these "tasks" have many custom attributes that i'd like to be able to display/edit. So i modified the MyAppointmentInfo class with my own needs as follow :

class MyAppointmentInfo
   {
       private int _id;
       private string _scode;
       private string _subject;
       private DateTime _start;
       private DateTime _end;
       private string _recurrenceRule;
       private string _recurrenceParentId;
       private string _reminder;
       private int? _userID;
       private int? _ressourceid;
       private int _backcolor;
       private string _description;
       private double _dtlength;
       private int _itimeslotbegin;
       private int _itimeslotend;
       private int _ifrozen;
       private double _dtvaliditybegin;
       private double _dtvalidityend;
       private double _dtrealbegin;
       private double _dtrealend;
       private int _itype;
       private int _isubtype;
       private int _istatus;
       private int _iresid;
       private string _sresname;
       private int _igroid;
       private int _isiteid;
       private int _iurgency;
       private int _iresfixed;
       private int _ialarm;
       private int _icolor;
       private int _iprofilsending;
       private string _saddress;
       private string _saddress2;
       private string _szipcode;
       private string _scity;
       private string _scountry;
       private double _dlati;
       private double _dlongi;
       private int _iradius;
       private int _igeoquality;
       private double _dkmbefore;
       private double _dttimebefore;
       private string _sspecialities;
       private double _dquantity;
       private int _tag;
       private string _smotifdeletion;
       private int _iuseridcreation;
       private double _dtusercreation;
       private int _iuseridlastchange;
       private double _dtuseridlastchange;

I then have a getter/setter for each of these properties. I do not display all of these properties on the advanced form only some of those but all these datas will be used later.

So i tried to create custom attributes for the properties i wanted to display/edit in the advanced form. I did this operation using :

CustomAttributeNames="sAddress,sAddress2,sZipCode,sCity,sCountry"

Even if i set EnableCustomAttributeEditing to true, no control is created in my advanced form. So i created it using (one for each of the properties above) : 

<telerik:RadTextBox runat="server" ID="sAddress2" TextMode="SingleLine" Columns="50" LabelCssClass="rfbLabel" Rows="5" Width="80%" Label="Adresse 2" Text='<%# Eval("sAddress2")%>' RenderMode="Lightweight" />

This way, when i get appointments from my webservice, these are displayed correctly on my scheduler and when clicked, displays the datas i want (including the custom attributes) in the advanced form.

But when i create a new appointment, i cant find any of these attributes in my e.appointment object when AppointmentInsert is triggered. The attribute count is 0.

Here is my RadScheduler1_AppointmentInsert code :

protected void RadScheduler1_AppointmentInsert(object sender, SchedulerCancelEventArgs e)
        {
             // I create a "task" from the e.Appointment object
             // before sending it to my WebService
             WS_Task.TRMSTaskData newTask = GetTaskFromAppointment(e.Appointment);
             //Send newTask to my WebService           
 
        }
 private WS_Task.TRMSTaskData GetTaskFromAppointment(Appointment a)
        { // create an object "task" from an "Appointment"
            WS_Task.IRMSTaskservice ws = new WS_Task.IRMSTaskservice();
            WS_Task.TRMSSession se = new WS_Task.TRMSSession();
            se.UserId = 71;
            se.SessionId = 1;
            WS_Task.TRMSTaskData newTask = ws.GetNewTask(se);
            newTask.sName = a.Subject;
            newTask.id = Convert.ToInt32(a.ID);
            newTask.sDescr = a.Description;
            newTask.dtBegin = (a.Start).ToOADate();
            newTask.dtEnd = (a.End).ToOADate();
            newTask.dtLength = newTask.dtEnd - newTask.dtBegin;
            newTask.sResName = a.Resources.GetResourceByType("Ressource").Text;
            newTask.iResId = Convert.ToInt32(a.Resources.GetResourceByType("Ressource").Key);
            newTask.iGroId = GetResourceFromID(newTask.iResId).iGroupId;
            newTask.iUrgency = 0;
            newTask.iResFixed = 0;
            newTask.iAlarm = 0;
            //Here i cant find a way to get the address field content
            //newTask.sAddress = ???
 
            return newTask;
 
        }

I followed the instructions from this example : http://docs.telerik.com/devtools/aspnet-ajax/controls/scheduler/design-time/custom-resources-and-attributes but cant get this to work...

Let me know if you need any more details and thank you for your time

Plamen
Telerik team
 answered on 07 Jun 2016
3 answers
124 views

Hi all,

I'm having a difficulties here. I create a RadGrid and use an EditFormSettings for inserting new data. Within the EditFormSettings , I have a RadAutoCompleteBox ID="plant" which will get the value from database. I want,  when Users choose the Plant in RadAutoCompleteBox, system will parse the value of Latitude & Longitude to the RadTextBox which defined.

My challenge here, I'm able to retrieve the Latitude & Longitude value but unable to assign to the respective textbox. 

Please help..

My code as below;
C#

protected void Plant_TextChanged(object sender, Telerik.Web.UI.AutoCompleteEntryEventArgs e)
{
   string a = e.Entry.Text;
   foreach (GridEditableItem item in RadGrid2.EditItems)
    {  
        RadTextBox lati = (RadTextBox)item.FindControl("plantLat2");
        RadTextBox longi = item.FindControl("plantLong2") as RadTextBox;
        SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ibmsConnectionString"].ToString());
        SqlCommand cmd = new SqlCommand("plant_GPS_list", con);
        SqlDataAdapter da = new SqlDataAdapter(cmd);
        con.Open();
        da.SelectCommand.CommandType = CommandType.StoredProcedure;
        da.SelectCommand.Parameters.Add("@Plant", SqlDbType.VarChar, 50);
        da.SelectCommand.Parameters["@Plant"].Value = a;
        SqlDataReader dr = da.SelectCommand.ExecuteReader();
        try
        {
            if (dr.Read())
            {
                lati.Text = dr["Latitude"].ToString();
                longi.Text = dr["Longitude"].ToString();
            }
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.Message);
        }
        con.Close();
    }
}

ASPX

<telerik:RadGrid ID="RadGrid2" runat="server" DataSourceID="SqlDataSource2" OnDetailTableDataBind="RadGrid2_DetailTableDataBind"
    OnNeedDataSource="RadGrid2_NeedDataSource" AllowFilteringByColumn="True" AllowPaging="True"
    OnItemCreated="RadGrid2_ItemCreated" OnInsertCommand="RadGrid2_InsertCommand"
    OnItemDataBound="RadGrid2_ItemDataBound" OnItemCommand="RadGrid2_ItemCommand">
    <GroupingSettings CollapseAllTooltip="Collapse all groups" />
    <MasterTableView AutoGenerateColumns="False" DataSourceID="SqlDataSource2" DataKeyNames="Plant"
        CommandItemDisplay="Top">
        <CommandItemTemplate>
            <div style="padding: 10px 10px; color: #2B373D !important; font-weight: bold;">
                <asp:LinkButton ID="LinkButton2" runat="server" CommandName="InitInsert" Visible='<%# !RadGrid2.MasterTableView.IsItemInserted %>'>
                    <i class="fa fa-plus"></i> Add Platform / Plant
                </asp:LinkButton>
            </div>
        </CommandItemTemplate>
        <Columns>
            ....
        </Columns>
        <DetailTables>
            <telerik:GridTableView Name="BpName">
                .......
            </telerik:GridTableView>
        </DetailTables>
        <EditFormSettings EditFormType="Template">
            <FormTemplate>
                <div class="form-horizontal">
                    <div class="form-group">
                        <div class="col-md-2 control-label">
                            Plant :</div>
                        <div class="col-md-10">
                            <div class="form-inline">
                                <div class="form-group">
                                    <telerik:RadAutoCompleteBox ID="plant" runat="server" DataSourceID="dsPlant" DataTextField="Plant"
                                        OnEntryAdded="Plant_TextChanged" DataValueField="Plant" InputType="Token" Width="300px"
                                        AllowCustomEntry="true" AutoPostBack="True">
                                        <TextSettings SelectionMode="Single" />
                                    </telerik:RadAutoCompleteBox>
                                </div>
                                <div class="form-group">
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="plant"
                                        ErrorMessage="* Please insert Plant." Font-Bold="True" ForeColor="Red" SetFocusOnError="True">
                                    </asp:RequiredFieldValidator>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-2 control-label">
                            GPS Location :</label>
                        <div class="col-md-10">
                            <div class="form-horizontal">
                                <div class="form-group">
                                    <label class="col-sm-12 col-md-1 control-label">
                                        Latitude
                                    </label>
                                    <div class="col-sm-12 col-md-10">
                                        <telerik:RadTextBox ID="plantLat2" runat="server" Text='<%# Bind( "Latitude") %>'>
                                        </telerik:RadTextBox>
                                        <asp:RangeValidator ID="LatRangeValidator2" runat="server" ControlToValidate="plantLat2"
                                            ErrorMessage="* Choose a coordinate between -90 and 90 degrees inclusive." Font-Bold="true"
                                            ForeColor="Red" MaximumValue="90" MinimumValue="-90" EnableClientScript="False"
                                            Type="Double" SetFocusOnError="True">
                                        </asp:RangeValidator>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class=" col-sm-12 col-md-1 control-label">
                                        Longitude
                                    </label>
                                    <div class="col-sm-12 col-md-10">
                                        <telerik:RadTextBox ID="plantLong2" runat="server" Text='<%# Bind( "Longitude") %>'>
                                        </telerik:RadTextBox>
                                        <asp:RangeValidator ID="LongRangeValidator2" runat="server" ControlToValidate="plantLong2"
                                            ErrorMessage="* Choose a coordinate between -180 and 180 degrees inclusive."
                                            Font-Bold="true" ForeColor="Red" MaximumValue="180" MinimumValue="-180" EnableClientScript="False"
                                            Type="Double" SetFocusOnError="True">
                                        </asp:RangeValidator>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-md-2 control-label">
                        </div>
                        <div class="col-md-10">
                            <asp:Button ID="plantUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                CssClass="btn btn-warning" runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>
                            </asp:Button
                            <asp:Button ID="plantCancel" Text="Cancel" runat="server" CausesValidation="False"
                                CssClass="btn btn-info" CommandName="Cancel"></asp:Button>
                        </div>
                    </div>
                </div>
            </FormTemplate>
        </EditFormSettings>
    </MasterTableView>
</telerik:RadGrid>

Peter Milchev
Telerik team
 answered on 07 Jun 2016
6 answers
246 views
Greetings

In asyncupload, When I select few files for upload, all the file names are displayed above the control with a green icon. My requirement is. along with the individual file name, can I show the file size? I tried a couple of times but didn't work out and I want to confirm if its possible.

Please be kind enough to reply soon.
Veselin Tsvetanov
Telerik team
 answered on 07 Jun 2016
1 answer
184 views

Hi,

I'm having one chart with two type in it. one is stacked bar and other is Line Series. I want Stacked Bar chart should preferred left side Y axis value and Line series should preferred Right Side Y axis. 

I want to show following:

1. Both Y axis should have different value step. 

2. Stacked bar should refer Left Y axis 

3. Line Series should refer Right Y axis

attached screen shot

 

    

Pratik
Top achievements
Rank 1
 answered on 07 Jun 2016
1 answer
38 views
I have a problem with the resources not being found for the telerik controls. I have narrowed down the problem to .net 4.5 or installing kb 2836939 for .net 4.0. If I have a .net 4.0 installation on a windows 2008 r2 server without kb 2836939 it works fine. As soon as I install it, I get the 404 errors. If I uninstall it, it goes back to working. We are using Telerik.web.ui version 2013.2.717.35. I do not need .net 4.5 at this time so fixing the .net 4.0 error would be just as useful. I need kb 2836939 to fix postback errors in IE11. If purchasing a newer version of your controls will guarantee to fix the problem even if means installing asp.net 4.5, please let me know.
Joel
Top achievements
Rank 1
 answered on 06 Jun 2016
12 answers
495 views
Hi,
i have a problem using RadHtmlChart here my code:
in .aspx

<telerik:RadHtmlChart runat="server" ID="PieChart4"  Width="425px" Height="280px" Transitions="true" Style="float: left;" Skin="black" DataSourceID="SqlDataSource1">
                <Appearance >
                    <FillStyle BackgroundColor="Transparent" />               
               </Appearance>
                <ChartTitle Text="Resons Count">
                        <Appearance Align="Center" Position="Top" />
                    </ChartTitle>
                <PlotArea>
                    <Series>
                        <telerik:PieSeries  StartAngle="90" DataField="count" Name="sReason">
                            <LabelsAppearance Position="Circle" DataFormatString="{0} times" />
                           
                        </telerik:PieSeries>
                    </Series>
                    
                </PlotArea>
            </telerik:RadHtmlChart>

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="...."
        SelectCommand="SELECT sReason,count from (SELECT     dbo.AccountingType.iAccountingTypeID, dbo.AccountingType.sReason, COUNT(dbo.AccountingType.iAccountingTypeID) AS count
                        FROM         dbo.Accounting INNER JOIN
                      dbo.AccountingType ON dbo.Accounting.iAccountingTypeID = dbo.AccountingType.iAccountingTypeID INNER JOIN
                      dbo.ConsistCycle ON dbo.Accounting.iConsistCycleID = dbo.ConsistCycle.iConsistCycleID
                      WHERE    (NOT (dbo.AccountingType.sReason IS NULL)) AND (CONVERT(datetime, CONVERT(varchar, dbo.ConsistCycle.dt7MileArrivalActual, 101), 101) >= CONVERT(DATETIME, @dt7MileArrivalActualFrom, 102)) AND (CONVERT(datetime, CONVERT(varchar, dbo.ConsistCycle.dt7MileArrivalActual, 101), 101) <= CONVERT(DATETIME, @dt7MileArrivalActualTo, 102)) GROUP BY dbo.AccountingType.iAccountingTypeID, dbo.AccountingType.sReason) as tab1">
        <SelectParameters>
            <asp:Parameter Name="dt7MileArrivalActualFrom" DefaultValue="" />
            <asp:Parameter Name="dt7MileArrivalActualTo" DefaultValue="" />
        </SelectParameters>
    </asp:SqlDataSource>


and this is the result



What i can do to show the Name property of each series in the legend?
Pls help me!
Thanks
Danail Vasilev
Telerik team
 answered on 06 Jun 2016
1 answer
113 views

How do I remove a particular series item from client side using javascript.

I am adding the series items from the code behind.

Dim planSeries As ColumnSeries

 planSeries = .PlotArea.Series(0)
 planSeries .Items.Add(New SeriesItem(Session("PlanTitle")))
                

As shown in the attached screenshot, RadCombobox is populated with the names of all the series items. On ClientClick of a Radbuttion, I want the selected series item to be removed from the chart. 

 

Any help in this regard is highly appreciated. 

 

 

Ianko
Telerik team
 answered on 06 Jun 2016
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?