Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
334 views
Hi

I am currently working on upgrading our application to your latest controls. We are moving from using Telerik.WebControls (Class controls) to the Telerik.Web.UI (Ajax controls)

I have got the application compiling and I am working through the errors the application is throwing.

I have come into a stumbling block when the pages load which contain the below syntax:

RadAjaxManager.AjaxSettings.AddAjaxSetting(RadAjaxManager, updatePanel, AjaxLoadingPanel);

Obviously the parameters that are passed are different between pages however i am constantly getting an Object reference not set to an instance of an object error message and have been unable to find any relevant help on this.

The AddAjaxSetting is varying between being defined in the Page_Load, On_Init and On_PreRender methods.

If you need any more information please let me know.

Regards,
Jonathan

Blop
Top achievements
Rank 1
 answered on 24 May 2012
1 answer
104 views
Hi all,
I am updating my grid data using update command. I use edit form template,I want the parent item of the edited item.How can I get this?
Please help.

Thanks in advance.
Shinu
Top achievements
Rank 2
 answered on 24 May 2012
1 answer
431 views

Hi Team,

We are using masked textbox in few important places in our system for different type of input validation.

Now, i am dead stuck with how to i validate the "Valid" Decimal value with masked text box.

"#" or "9" format must need the that many number of digits.

e.g. valid decimal numbers are:
111.124
11.12455
11111.12455

Making mask "######.######" like that, must require user to type in leading "0(zero)", which is real pain.

If you could be of any help solving this mystry will be great help.

Thanks,
J. Ramesh
Martin
Telerik team
 answered on 24 May 2012
3 answers
1.6K+ views
Hi, I’m updating an ASP.NET AJAX application so that the jQuery library loaded by the Telerik.Web.UI assembly can be re-used by other scripts. I have two questions which I’d appreciate some advice on:

I have a RadScriptManager on my master page and need to include a private javascript file that can be used by all content pages. Should I include the script as a reference within the RadScriptManager or should I use conventional script tags after the RadScriptManager? I’ve illustrated both methods below. Both seem to work but what is the recommended approach?

METHOD 1
<telerik:RadScriptManager ID="rsmMain" runat="server" >
<Scripts>
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
</Scripts>
</telerik:RadScriptManager>
<script type="text/javascript" src="../Scripts/Utility.js"></script>

METHOD 2
<telerik:RadScriptManager ID="rsmMain" runat="server" >
<Scripts>
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
<asp:ScriptReference Path="~/Scripts/Utility.js" />
</Scripts>
</telerik:RadScriptManager>

My second question relates to adding a client-side script from a page programmatically. Previously I used the RegisterStartupScript() method of ClientScriptManager to add a script from code behind but I note from some forum posts that it’s suggested you should use RadScriptManager.RegisterStartupScript() instead. What’s the difference and is there a recommended approach?

Regards, Ian
Genady Sergeev
Telerik team
 answered on 24 May 2012
6 answers
162 views
Hi!

I am using RadGrid. There is GridButtonColumn(CommandName = "DeleteCommand") for deleting a row.    
onCommand: function (sender, eventArgs) {
   var commandName = eventArgs.get_commandName();
   if (commandName == "DeleteCommand") {
      var dataItems = eventArgs.get_tableView().get_dataItems();
      var dataItem = dataItems[eventArgs.get_commandArgument()].get_dataItem();
      deleteRow(dataItem);
   }

It works, but after deleting grid is rebinded. How can I turn off auto rebind?
I've found "Commands that invoke Rebind() implicitly" topic and change the command name. But It doesn't work.
I tried to use eventArgs.set_cancel(true). But It doesn't work too.

Thanks for your help! 
Den
Top achievements
Rank 1
 answered on 24 May 2012
1 answer
475 views
Hello Team,

I am using Telerik Image Editor. I want to save and overwrite file on custom path using RadImageEditor_ImageSaving Server side event.

 when I modify image and try to save it on same path, I am getting error "A generic error occurred in GDI+"

 Please Note: I want to maintain only two versions of file 1) Original file 2) Updated file

  protected void RadImageEditor1_ImageSaving(object sender, ImageEditorSavingEventArgs args)
        {


           
            var context = new EBABBLEEntities();


            Account Lo_Account = (from acc in context.Accounts where acc.Id == cls_Session.User.Id select acc).FirstOrDefault();
            System.Drawing.Image newImage = args.Image.Image;


            string filename = Path.GetFileNameWithoutExtension(ImageURL);
            int indexer = filename.IndexOf("_Edited");


            if (indexer != -1)
            {
                newImage.Save(Server.MapPath("~" + Lo_Account.files_path + "/My_DigiGLUS/") + filename.Substring(0, (filename.Length) - 7) + "_Edited" + Path.GetExtension(ImageURL));


            }
            else
            {
                newImage.Save(Server.MapPath("~" + Lo_Account.files_path + "/My_DigiGLUS/") + Path.GetFileNameWithoutExtension(ImageURL) + "_Edited" + Path.GetExtension(ImageURL));
            }


          
            args.Cancel = true;
            DigiId = Convert.ToInt32(Request.QueryString["digigluId"].ToString());
            DigiGLUs Editdigiglu = (from digi in context.DigiGLUs where digi.Id == DigiId select digi).FirstOrDefault();


            if (indexer != -1)
            {
                Editdigiglu.NewImageName = filename.Substring(0, (filename.Length) -7) + "_Edited" + Path.GetExtension(ImageURL);




            }
            else
            {
                Editdigiglu.NewImageName = Path.GetFileNameWithoutExtension(ImageURL) + "_Edited" + Path.GetExtension(ImageURL);
            }




            context.SaveChanges();
}
Please review the code, help me to find where I am doing wrong. I really appreciate your help to solve this issue....
Rumen
Telerik team
 answered on 24 May 2012
1 answer
276 views

Hi there

Can anybody assist with this problem? I have a radEditor in an ASP.NET page using a MasterPage, which as you will know, uses ContentPlaceHolder controls to hold other controls, and which also prefixes the declared control id with that of the ContentPlaceHolder in question, e.g., from a server-side id of 'myRadEditor' the client-side id would end up being something along the lines of:

'ct100_myContentplaceholder_myRadEditor'

When it comes to using the client-side $find command, all of the examples I can find show the use of the following syntax:

<%= myServerSideID.ClientID %> 

but as far as I know, this is only valid for Javascript embedded within the <SCRIPT></SCRIPT> 'node' of the the .aspx file. However, I have a set of external Javascript script files added dynamically and programmatically, rather than specified declaratively in the aspx files in question.

So my question is, how would I go about using the $find command to get a reference to a radEditor control, or indeed any telerik control, using a wildcard search for the server-side id (e.g., 'myRadEditor') from within an 'external' Javascript file, given that the

<%= ... %> syntax is not available?

Thanks very much if you can advise!

Regards

Martin
Telerik team
 answered on 24 May 2012
0 answers
152 views

 How could i datetime filed convert to number format
  e.g:
       DateTime StartOfWeek = DateTime.Today.AddDays(-(int)DateTime.Today.DayOfWeek);
       DateTime EndOfLastWeek = StartOfWeek.AddDays(-1);
 
Thanks
Tamim
Tamim
Top achievements
Rank 1
 asked on 24 May 2012
1 answer
138 views
This is my code. I have 3 series, but the third serie the legend does not appear. The graph does not appear, but is posible does not have a value. Why does not legend appear? Below my code.

private RadChart criaChart1(DesempenhoMensalBL bl)
        {
            RadChart radChart1 = new RadChart();

            radChart1.Height = 200;
            radChart1.Width = 1000;
            radChart1.ChartTitle.TextBlock.Text = "Evolução Mensal Aprovadas Débito";
            radChart1.ChartTitle.TextBlock.Appearance.Position.AlignedPosition = Telerik.Charting.Styles.AlignedPositions.Center;
            radChart1.ChartTitle.TextBlock.Appearance.TextProperties.Font = new System.Drawing.Font("Arial", 15, System.Drawing.FontStyle.Bold);
            radChart1.ChartTitle.Appearance.Dimensions.AutoSize = false;
            radChart1.ChartTitle.Appearance.Dimensions.Height = 25;
            radChart1.ChartTitle.Appearance.Dimensions.Width = 750;
            radChart1.ChartTitle.Appearance.Dimensions.Margins.Left = Telerik.Charting.Styles.Unit.Percentage(20);
            radChart1.ChartTitle.Appearance.Dimensions.Margins.Right = Telerik.Charting.Styles.Unit.Percentage(8);

            //Muda a cor de fundo do gráfico para transparente
            radChart1.Appearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.Solid;
            radChart1.Appearance.FillStyle.MainColor = System.Drawing.Color.Transparent;
            radChart1.PlotArea.Appearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.Solid;
            radChart1.PlotArea.Appearance.FillStyle.MainColor = System.Drawing.Color.Transparent;

            radChart1.Legend.Appearance.Position.AlignedPosition = Telerik.Charting.Styles.AlignedPositions.Bottom;
            radChart1.Legend.Appearance.Overflow = Telerik.Charting.Styles.Overflow.Row;

           
            radChart1.SeriesOrientation = ChartSeriesOrientation.Vertical;

            radChart1.Legend.Appearance.Position.AlignedPosition = Telerik.Charting.Styles.AlignedPositions.Bottom;
            radChart1.Legend.Appearance.Overflow = Telerik.Charting.Styles.Overflow.Row;
            radChart1.Legend.Appearance.Dimensions.AutoSize = false;
            radChart1.Legend.Appearance.Dimensions.Height = 25;
            radChart1.Legend.Appearance.Dimensions.Width = 400;
            radChart1.Legend.Appearance.Border.Color = System.Drawing.Color.Transparent;
            radChart1.Legend.Appearance.Position.AlignedPosition = Telerik.Charting.Styles.AlignedPositions.Bottom;
            radChart1.Legend.TextBlock.Appearance.Position.AlignedPosition = Telerik.Charting.Styles.AlignedPositions.Center;

            radChart1.PlotArea.Appearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.Solid;
            radChart1.PlotArea.Appearance.FillStyle.MainColor = System.Drawing.Color.Transparent;
            radChart1.PlotArea.Appearance.Border.Visible = false;

            radChart1.PlotArea.Appearance.Dimensions.Margins.Top = Telerik.Charting.Styles.Unit.Percentage(20);
            radChart1.PlotArea.Appearance.Dimensions.Margins.Bottom = Telerik.Charting.Styles.Unit.Percentage(30);
            radChart1.PlotArea.Appearance.Dimensions.Margins.Left = Telerik.Charting.Styles.Unit.Percentage(5);
            radChart1.PlotArea.Appearance.Dimensions.Margins.Right = Telerik.Charting.Styles.Unit.Percentage(5);
            radChart1.PlotArea.Appearance.Dimensions.Width = 800;

            radChart1.PlotArea.XAxis.LayoutMode = Telerik.Charting.Styles.ChartAxisLayoutMode.Inside;
            radChart1.PlotArea.XAxis.AutoScale = false;
            radChart1.PlotArea.XAxis.IsZeroBased = false;
            radChart1.PlotArea.XAxis.Appearance.ValueFormat = Telerik.Charting.Styles.ChartValueFormat.LongDate;
            radChart1.PlotArea.XAxis.Appearance.CustomFormat = "MMM/yy";
            radChart1.PlotArea.XAxis.Appearance.MajorGridLines.Visible = false;
            //radChart.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = (float)45;
            radChart1.PlotArea.XAxis.Appearance.TextAppearance.AutoTextWrap = Telerik.Charting.Styles.AutoTextWrap.True;
            radChart1.PlotArea.XAxis.Appearance.LabelAppearance.Position.AlignedPosition = Telerik.Charting.Styles.AlignedPositions.Top;
            radChart1.PlotArea.XAxis.Appearance.TextAppearance.TextProperties.Font = new System.Drawing.Font("Arial", 10);

            radChart1.PlotArea.XAxis.AddRange(bl.datetimeDataInicial.ToOADate(), bl.datetimeDataFinal.ToOADate(), bl.dayStep);
            radChart1.Legend.Appearance.ItemMarkerAppearance.Dimensions.Width = 25;

            radChart1.Legend.Appearance.ItemMarkerAppearance.Figure = Telerik.Charting.Styles.DefaultFigures.Rectangle;

            radChart1.Legend.Appearance.ItemMarkerAppearance.Dimensions.Width = 25;
            radChart1.Legend.Appearance.ItemMarkerAppearance.Figure = Telerik.Charting.Styles.DefaultFigures.Rectangle;

            radChart1.PlotArea.YAxis.Appearance.CustomFormat = "0\\%";
            radChart1.PlotArea.YAxis.AutoScale = false;
            radChart1.PlotArea.YAxis.AddRange(0, 6000, 1200);
            radChart1.AutoLayout = true;

            ChartSeries chartSeries1 = radChart1.CreateSeries("Débito-Master", System.Drawing.Color.Red, System.Drawing.Color.Red, ChartSeriesType.Bar);
            ChartSeries chartSeries3 = radChart1.CreateSeries("Débito-Visa", System.Drawing.Color.Silver, System.Drawing.Color.Silver, ChartSeriesType.Bar);
            ChartSeries chartSeries5 = radChart1.CreateSeries("Meta de Aprovação 90%", System.Drawing.Color.Black, System.Drawing.Color.Black, ChartSeriesType.Line);

            chartSeries1.Type = ChartSeriesType.Bar;
            chartSeries3.Type = ChartSeriesType.Bar;
            chartSeries5.Type = ChartSeriesType.Line;

            chartSeries1.SetValues(bl.listaDebitoMaster.ToArray());
            chartSeries3.SetValues(bl.listaDebitoVisa.ToArray());
            chartSeries5.SetValues(bl.metaAprovacao);

            for (int i = 0; i < 3; i++)
            {
                radChart1.Series[i].Appearance.LabelAppearance.LabelLocation = Telerik.Charting.Styles.StyleSeriesItemLabel.ItemLabelLocation.Inside;
                radChart1.Series[i].Appearance.LabelAppearance.RotationAngle = (float)270;
            }

            return radChart1;
        }


Paulo
Top achievements
Rank 1
 answered on 24 May 2012
3 answers
182 views
Hi all,

How to give background color to RadToolBarButton?
Princy
Top achievements
Rank 2
 answered on 24 May 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?