Telerik Forums
UI for ASP.NET AJAX Forum
17 answers
417 views

Hi..

Again .. I have a custom skinned window. But the CLOSE button does not appear on the 'title'. If I remove the skin. It shows the close.

Any ideas?  thx again!!

 


            <telerik:RadWindow  Skin="Flom" EnableEmbeddedSkins="false" rendermode="Lightweight" runat="server" ID="RadWindow_NavigateUrl" NavigateUrl="About.aspx" Height="300" Width="350" EnableShadow="true"  IconUrl="images/GlobeSmall.png"  
                  Modal="true" Behaviors="Close" ShowContentDuringLoad="true" RestrictionZoneID="NavigateUrlZone"  Animation="FlyIn" VisibleStatusbar="False">
            </telerik:RadWindow>

 

          

 

    if (e.CommandName == "btnPrint")
            {
                GridEditableItem editedItem = (GridEditableItem)e.Item;

                Session["PO_NO"] = editedItem.GetDataKeyValue("po_no").ToString();
       
                RadWindow_NavigateUrl.NavigateUrl = "ReportViewer.aspx";

                string _title = String.Concat("Flom PO ", " - ", editedItem.GetDataKeyValue("po_no").ToString());

                RadAjaxManager1.ResponseScripts.Add(String.Format("var wnd = $find('{0}'); wnd.show(); wnd.set_title('{1}')", RadWindow_NavigateUrl.ClientID, _title));

            }

     

 


Jonathan
Top achievements
Rank 1
Iron
Veteran
 answered on 16 Jul 2018
3 answers
160 views

What I would like to do is when a user clicks on a GridHyperLinkColumn within the radGrid, the default behavior is to be prompted with the "Save As" dialog.  Thus far I have been unsuccessful in doing this.  Attempted to use the HTML5 download option but GridHyperLinkColumn doesn't understand that.  This is my current code but it doesn't work on every file as some open up.  The file types may be varied (PDF, XLS, XLSX, DOC, DOCX, TXT, ZIP).  Would it be possible to display a RadContextMenu when clicking on the link with "Save As" the only option?

 

<telerik:GridHyperLinkColumn SortExpression="FileName" DataTextFormatString="{0}"
    DataNavigateUrlFields="file_name" UniqueName="file_name" DataNavigateUrlFormatString="/Repository/FTPCloud/{0}"
    HeaderText="File" DataTextField="file_name">
</telerik:GridHyperLinkColumn>

 

Private Sub grdCloudFiles_ItemDataBound(sender As Object, e As GridItemEventArgs) Handles grdCloudFiles.ItemDataBound
    If TypeOf e.Item Is GridDataItem Then
        Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)
        Dim link As HyperLink = DirectCast(item("file_name").Controls(0), HyperLink)
        link.Attributes.Add("onclick", String.Format("javascript:document.execCommand('SaveAs','true','{0}');", MapPath(".") & link.NavigateUrl))
    End If
 
End Sub

 

Kurt Kluth
Top achievements
Rank 1
 answered on 16 Jul 2018
1 answer
93 views

I have a grid with many columns in it. The first two have display="false". They're IDs used to create links for other columns in the Grid_ItemDataBound event. Anyway, The report shows correctly when created with the browser maximized, but if I restore and then maximize again, the hidden columns show up. When they work, the TH has style="display:none" and after restoring and maximizing the style is gone. This is happening in 2 out of maybe 50 reports and most of them have hidden fields, so it's probably related to the layout of these particular grids.

Any ideas?

 

Eyup
Telerik team
 answered on 16 Jul 2018
1 answer
237 views

Hi there,

my web application worked for years fine but after my computer crashes and I installed and set up a new computer, now I try to publish my web application again on IIS, there are some difficulties and UI does not work as expected. For example some menu items can not  be selected or double click on a control that must be open a dialog has no action and so on and there are no error during rebuild or publish. The important thing is that the web application works fine in debugging mode and problems exist only after publishing the application. I'm using  Visual Studio 2017 and the application uses .NET framework 4 and windows 10 as OS and Telerik UI for ASP.NET AJAX R2 2018 is now installed. 

Can anyone tell me, is it possible that some incompatibility between telerik UI version and  windows 10 probably caused these problems?

Any other Idea? Thanks in advanced

Alireza

Rumen
Telerik team
 answered on 16 Jul 2018
2 answers
243 views
Hello Sir/Madam,
How to delete row from RadGrid  using C# code.
I dont want to used ObjectDataSource because i want to manage in code using 5 or more delete or update sql query according to time and condition. This can more flexible. I see delete row using ObjectDataSource in Terelik Advertise but this is not work in my condition.
please help me without using ObjectDataSource control.

And
please check below

in .ASPX code
<telerik:RadGrid ID="gvDetails" Skin="Outlook" BorderWidth="0" AllowFilteringByColumn="True"
                                 runat="server" AutoGenerateColumns="False" ShowStatusBar="true" EnableLinqExpressions="false"      
                                OnSortCommand="gvDetails_SortCommand"  onupdatecommand="gvDetails_UpdateCommand" oneditcommand="gvDetails_EditCommand"
                                 OnItemDeleted="gvDetails_ItemDeleted" OnSelectedIndexChanged="gvDetails_SelectCommand"  oncancelcommand="gvDetails_CancelCommand"   onprerender="gvDetails_PreRender"  >
                                
                                <MasterTableView AllowFilteringByColumn="true" DataKeyNames="ID" TableLayout="Fixed">
                                    <NoRecordsTemplate>
                                        <div style="font-weight: bold; color: Red;">
                                            No Record Found.</div>
                                    </NoRecordsTemplate>
                                    <Columns>
                                        <telerik:GridTemplateColumn UniqueName="Description" DefaultInsertValue="" HeaderText="Description"
                                           DataField="Description"  SortExpression="Description" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"
                                            ShowFilterIcon="false"
                                            AllowFiltering="true" FilterControlWidth="99%" HeaderStyle-Width="70%">                                
                                            <ItemTemplate>
                                                <asp:Label ID="lbltasktype" runat="server" Text='<%# Eval("Description")%>'> </asp:Label>
                                            </ItemTemplate>
                                            <EditItemTemplate>                                   
                                                <asp:TextBox ID="txtstatusname1" runat="server" SkinID="textbox" Text='<%# Eval("Description")%>'
                                                    MaxLength="100"></asp:TextBox>
                                            </EditItemTemplate>                                
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridEditCommandColumn UniqueName="EditCommandColumn"  />
                                        <telerik:GridButtonColumn ConfirmText="Delete this product?" ButtonType="ImageButton"
                                        CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">
                                        <HeaderStyle Width="20px" />
                                        <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
                                    </telerik:GridButtonColumn>
                                    </Columns>
                                </MasterTableView>
                           <%--     <ClientSettings AllowColumnsReorder="True">
                                    <Resizing AllowColumnResize="true" />
                                </ClientSettings>--%>
                                </telerik:RadGrid>

in ASPX.CS  Code
protected void gvDetails_ItemDeleted(object source, Telerik.Web.UI.GridDeletedEventArgs e)
    {
        GridDataItem editedItem = (GridDataItem)e.Item;
        String id = editedItem.GetDataKeyValue("ID").ToString();
        lblMsg.Text = "";
        DAL.DAL obj = new DAL.DAL(DAL.DAL.DBType.SqlServer, sConString);
        if (Request.QueryString["prbls"] == "Severity")
        {
            String strdel = "UPDATE EMRProblemsSeverity SET Active=0 WHERE Id=" + id;
            obj.ExecuteNonQuery(CommandType.Text, strdel);
            BindSeverity();

        }
        else if (Request.QueryString["prbls"] == "Context")
        {
            String strdel = "UPDATE EMRProblemsContext SET Active=0 WHERE Id=" + id;
            obj.ExecuteNonQuery(CommandType.Text, strdel);
            BindContext();
        }
        else if (Request.QueryString["prbls"] == "Quality")
        {
            String strdel = "UPDATE EMRProblemsQuality SET Active=0 WHERE Id=" + id;
            obj.ExecuteNonQuery(CommandType.Text, strdel);
            BindQuality();
        }
        else if (Request.QueryString["prbls"] == "Duration")
        {
            String strdel = "UPDATE EMRProblemsDuration SET Active=0 WHERE Id=" + id;
            obj.ExecuteNonQuery(CommandType.Text, strdel);
            BindDuration();
        }
        else if (Request.QueryString["prbls"] == "Location")
        {
            String strdel = "UPDATE EMRProblemsLocation SET Active=0 WHERE Id=" + id;
            obj.ExecuteNonQuery(CommandType.Text, strdel);
            BindLocation();
        }
        else if (Request.QueryString["prbls"] == "Condition")
        {
            String strdel = "UPDATE EMRProblemsCondition SET Active=0 WHERE Id=" + id;
            obj.ExecuteNonQuery(CommandType.Text, strdel);
            BindCondition();
        }
    }
but delete event not fired.
how it will fired the delete event.


Please help me as soon as possible because i need urgently.
Help me urgently.
thanks you
Jiten Kumar
Akhil Systems Pvt Ltd.
Caoimhin
Top achievements
Rank 1
 answered on 13 Jul 2018
3 answers
903 views
Hi I need to export data via the radgrid to excel - problem is the key field is a ten digit number which the first six is the patient date of birth ...

Problem is when excel opens with the export the leading zero is missing therefore no longer the patient number

example before export - number 0101071111 
                        after export - number 101071111

Any ideas?
Peter Milchev
Telerik team
 answered on 13 Jul 2018
6 answers
1.1K+ views

I am creating RadHTMLChart programmatically to generate a single line chart with date on the x-axis and integers on the Y axis.. Everything seems to be working correctly but when I look closer to the data points the graph does not seem to be drawing every singles data point from the source. I am attaching an screenshot of the generated chart . I know that between the firs tool tip ("58") and the second tool tip ("31) . I have some data points that fluctuate to 59 then back to 58 and then 59 again but I do not see this reflected on my graph. Does HtmlChart takes an avarage to draw the graph or how does it work? Please any help would be appreciate it.

 The data source of the graph is obtained of a filtered CSV file.

Here is my code:

RadHtmlChart PowerChart = new RadHtmlChart();
            PowerChart.ID = "PowerChart";
            PowerChart.Width = Unit.Pixel(1200);
            PowerChart.Height = Unit.Pixel(500);
            PowerChart.Transitions = true;
            PowerChart.Skin = "Silk";
            PowerChart.Appearance.FillStyle.BackgroundColor = System.Drawing.Color.White;
            PowerChart.ChartTitle.Appearance.Align = Telerik.Web.UI.HtmlChart.ChartTitleAlign.Center;
            PowerChart.ChartTitle.Appearance.BackgroundColor = System.Drawing.Color.Transparent;
            PowerChart.ChartTitle.Appearance.Position = Telerik.Web.UI.HtmlChart.ChartTitlePosition.Top;
            LineSeries PowerChartLineSeries = new LineSeries();
            //PowerChartLineSeries.DataFieldY = "BatteryCapacity"; // ??? mayb non global
            PowerChart.PlotArea.XAxis.DataLabelsField = "DateandTime";
            PowerChart.PlotArea.XAxis.Type = Telerik.Web.UI.HtmlChart.AxisType.Date;
            PowerChart.PlotArea.XAxis.TitleAppearance.Text = "Date";
            PowerChart.PlotArea.XAxis.MajorGridLines.Color = System.Drawing.ColorTranslator.FromHtml("#EFEFEF");
            PowerChart.PlotArea.XAxis.MajorGridLines.Width = 1;
            PowerChart.PlotArea.XAxis.MinorGridLines.Color = System.Drawing.ColorTranslator.FromHtml("#F7F7F7");
            PowerChart.PlotArea.XAxis.MinorGridLines.Width = 1;
            PlotBand yAxisPlotBandDanger = new PlotBand();
            yAxisPlotBandDanger.Color = System.Drawing.ColorTranslator.FromHtml("#CC0000");
            yAxisPlotBandDanger.Alpha = 190;
            PlotBand yAxisPlotBandDanger2 = new PlotBand();
            yAxisPlotBandDanger2.Color = System.Drawing.ColorTranslator.FromHtml("#CC0000");
            yAxisPlotBandDanger2.Alpha = 190;
            PlotBand yAxisPlotBandWarning = new PlotBand();
            yAxisPlotBandWarning.Color = System.Drawing.Color.Yellow;
            yAxisPlotBandWarning.Alpha = 190;
            PlotBand yAxisPlotBandWarning2 = new PlotBand();
            yAxisPlotBandWarning2.Color = System.Drawing.Color.Yellow;
            yAxisPlotBandWarning2.Alpha = 190;
PowerChart.ChartTitle.Text = "Batttery Capacity in the last month";
                PowerChart.PlotArea.XAxis.BaseUnit = Telerik.Web.UI.HtmlChart.DateTimeBaseUnit.Days;
                PowerChart.PlotArea.YAxis.Step = 10;
                PowerChart.PlotArea.YAxis.MinValue = 0;
                PowerChart.PlotArea.YAxis.MaxValue = 120;
                yAxisPlotBandDanger.From = 0;
                yAxisPlotBandDanger.To = 5;
                yAxisPlotBandWarning.From = 5;
                yAxisPlotBandWarning.To = 10;
                PowerChart.PlotArea.YAxis.TitleAppearance.Text = "Battery Capacity";
                PowerChart.PlotArea.YAxis.LabelsAppearance.DataFormatString = "{0}%";
                PowerChart.PlotArea.YAxis.PlotBands.Add(yAxisPlotBandDanger);
                PowerChart.PlotArea.YAxis.PlotBands.Add(yAxisPlotBandWarning);
                PowerChartLineSeries.DataFieldY = "BatteryCapacity";
                PowerChart.PlotArea.Series.Add(PowerChartLineSeries);
                HtmlChartHolder.Controls.Add(PowerChart);
                PowerChart.DataSource = GetDataTableToGraph(4, "BatteryCapacity");
                PowerChart.DataBind();
 
public DataTable GetDataTableToGraph(int option, string powerVariable)
        {
             
            DateTime olddate;           
            DataTable sourceTable = new DataTable();
            sourceTable.Columns.AddRange(new DataColumn[] {
                new DataColumn("DateandTime", typeof(DateTime)),
                new DataColumn("BatteryCapacity", typeof(int)),
                new DataColumn("BatteryChargeState", typeof(string)),
                new DataColumn("BatteryStatus", typeof(string)),
                new DataColumn("BatteryVoltage", typeof(double)),
                new DataColumn("Temperature", typeof(double)),
                new DataColumn("InputVoltage", typeof(double)),
                new DataColumn("InputFrequency", typeof(double)),
                new DataColumn("OutputCurrent", typeof(double)),               
                new DataColumn("OutputLoad", typeof(int)),
                new DataColumn("OutputSource", typeof(string)),
                new DataColumn("OutputVoltage", typeof(double)),
                new DataColumn("LRTLB", typeof(string))                           
                });
            try
            {
                string directory = ReadPowerDisplayRegistry("Dir") + "Service\\PWRDATA.csv";
                string[] fileContent = File.ReadAllLines(directory);
                for (int i = 2; i < fileContent.Count(); i++)
                {
                    string[] rowData = fileContent[i].Split(',');
                    sourceTable.Rows.Add(rowData);
                }
 
                string[] selectedColumns = new[] { "DateandTime", powerVariable };
                DataTable newDt = new DataView(sourceTable).ToTable(false, selectedColumns);
 
 
                if (option == 0)
                {
                    olddate = DateTime.Now.AddMinutes(-30);
                }
                else if (option == 1)
                {
                    olddate = DateTime.Now.AddMinutes(-60);
                }
                else if (option == 2)
                {
                    olddate = DateTime.Now.AddDays(-1);
                }
                else if (option == 3)
                {
                    olddate = DateTime.Now.AddDays(-7);
                }
                else
                {
                    olddate = DateTime.Now.AddMonths(-1);
                }
 
                newDt.DefaultView.RowFilter = String.Format(CultureInfo.InvariantCulture.DateTimeFormat,
                    "[DateandTime] >#{0}#", olddate);
                //newDt.DefaultView.RowFilter = string.Format
 
                return newDt;
            }
 
            catch
            {
                return null;
            }
             
        }

Marin Bratanov
Telerik team
 answered on 13 Jul 2018
1 answer
97 views
Can anyone point me in the direction of either documentation, a demo, or even an old forum post that details how to setup a RadGrid (that's operating in Batch edit) that uses the GridTextBoxColumnEditor control to use the RadSpell control for spell check?
Rumen
Telerik team
 answered on 13 Jul 2018
8 answers
292 views

I have a .NET 4.0 web application which implements an error handler within the Application_Error event of Global.asax.

When an exception occurs this intercepts it and sends me an email including a variety of information like the logged in user, the page the error occurred on, the contents of the session etc.

This is all great but there is some fundamental detail missing which I seem unable to locate, i.e. the name of the control or the value that caused it to be out of range:


Selection out of range
Parameter name: value

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.ArgumentOutOfRangeException: Selection out of range
Parameter name: value

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 

[ArgumentOutOfRangeException: Selection out of range
Parameter name: value]
   Telerik.Web.UI.RadComboBox.PerformDataBinding(IEnumerable dataSource) +172
   Telerik.Web.UI.RadComboBox.OnDataSourceViewSelectCallback(IEnumerable data) +491
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +33
   Telerik.Web.UI.RadComboBox.OnDataBinding(EventArgs e) +1256
   Telerik.Web.UI.RadComboBox.PerformSelect() +37
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +74
   Telerik.Web.UI.RadComboBox.DataBind() +70
   System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +66
   System.Web.UI.WebControls.BaseDataBoundControl.OnPreRender(EventArgs e) +22
   Telerik.Web.UI.RadDataBoundControl.OnPreRender(EventArgs e) +36
   Telerik.Web.UI.RadComboBox.OnPreRender(EventArgs e) +87
   System.Web.UI.Control.PreRenderRecursiveInternal() +103
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2496
Subash
Top achievements
Rank 1
 answered on 13 Jul 2018
6 answers
568 views

Hi Everyone,

I'm sure this is an obvious question but how do I set a default time when a user selects a date.

I have 2 RadDateTimePicker controls on a page where the user selects a daterange.
When the user selects a From date I want to automatically set the time portion of the returned date to 0:00 and when the user selects a To date I want to default the time to 23:59.

What am I missing, surely there is a default Time property somewhere that controls the time portion of the date returned from the Calendar.

Many thanks

Antony

Donald McLean
Top achievements
Rank 2
 answered on 12 Jul 2018
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?