I wasn't blogging for a while but I was concentrated at my new work ;).
Actually I had forgotten that I have blog but few collegues were joking with me that I suddenly put my blog posts (especially those focussed on radControls) on hold. They also asked me if I am going to stop writing about telerik :).
So I decided to write about telerik ;). This time from other prospect.
I was thinking a lot about this post.
If I only praise the company the readers may think I have some interest to do so.
So here is the truth.
I will first start with the interview.
It was held in telerik HQ here in Sofia (my position is also here), the people who was responsible for the interview did their job in a very professional way. The interview was very easy to handle and more like a chat with friends. No stress at all.
The technical questions were handcrafted in a way so the interviewers can get an idea of my technical skills without bothering me with a questions like : "Do you know what is the method in the System.x.y.z.Class which should be used to do access NASA space shuttle chip N1A2322AH". I mean I can remember some of them but I can't know each method in the .NET framework, all the commands in the TFS, all the things in jQuery etc.
No such questions. But real technical questions instead. I will not disclose more on that.
Some processes which I will also skip took place in a matter of week.
The first day
It was a day to get familiar with the company, the collegues etc. telerik HR manager introduced me to all the teams, I met all the people, got some other technical orientation meetings and was ready to go.
The task
I had a challenging task (challenging to me at least, it may be easy to do for other people). Anyway it kept my interest all the time until it was finished. Offcourse I will not disclose more details on this. Just to let you know that I was happy with it.
The meetings
Everything is discussed, each collegue is helpful, there are meeting rooms which are available for longer meetings and you can also go to your collegue desk for shorter discussions.
The people
As I said the people are quite friendly.
Lots of smart guys there. You can learn and teach. Also I have a lot of friends who were collegues of mine from previous companies. They really helped a lot to integrate.
So will I continue to write about radControls
Probably not. At least not that often. When I was at my previous work I had found some problems with the controls because I needed to implement some uncommon scenarios. As I stated in my posts - some of them was because of lack of knowledge in rad products. Now if I have problem I can internally ask someone from the team to help me out or if I find an issue we can discuss if we can address it or find a workaround. That wasn't quite possible before. So I may write a post on how the issue was resolved instead just pointing it out.
Disclaimer :)
The above is my personal opinion based on about a week work.
May or may not change in time. Hope it will not :).
All the stuff that bothers software developer in his everyday tasks.
Sep 8, 2009
Aug 31, 2009
Aug 27, 2009
A nice sentence I read recently
This one is from the asp.net forums:
"Where there is a will, there is a way. And where there is a team there is more then one way."
"Where there is a will, there is a way. And where there is a team there is more then one way."
Aug 25, 2009
Determine if your site is running under IIS or Casini
For the people who don't know - Casini is the built in Visual Studio server which is by default running when you debug ASP.NET project.
You can use the following to check if the site is running under IIS:
bool isUnderIIS = this.Request.ServerVariables["SERVER_SOFTWARE"].IndexOf("IIS") > -1;
Not the most clever thing I've ever done but seems to be the only way at the moment.
If you know a better way - let us know...
To clarify - IIS will return something like : "Microsoft-IIS/5.1", while Casini will let you bump your head with string.Empty.
Anyway, this covers my scenarios 100% so I can use it.
You can use the following to check if the site is running under IIS:
bool isUnderIIS = this.Request.ServerVariables["SERVER_SOFTWARE"].IndexOf("IIS") > -1;
Not the most clever thing I've ever done but seems to be the only way at the moment.
If you know a better way - let us know...
To clarify - IIS will return something like : "Microsoft-IIS/5.1", while Casini will let you bump your head with string.Empty.
Anyway, this covers my scenarios 100% so I can use it.
Етикети:
.NET C# technologies,
ASP.NET newbies,
C#,
IIS
Aug 10, 2009
A nice DOM property I bet most of you have missed ...
In my previous post on this topic I mentioned the properties you can use to detect changes in HTML input controls:
http://donchevp.blogspot.com/2009/08/nice-dom-property-i-bet-most-of-you.html
Now I want to inform you that I have found an article which has all the controls included with the property you can use to track for changes:
http://www.codestore.net/store.nsf/unid/DOMM-4UTKE6
The first thing I noticed is that it is kind of inconvenient for the SELECT DOM object for example.
You should iterate through all the items and check their selected property with their defaultSelected property ...
http://donchevp.blogspot.com/2009/08/nice-dom-property-i-bet-most-of-you.html
Now I want to inform you that I have found an article which has all the controls included with the property you can use to track for changes:
http://www.codestore.net/store.nsf/unid/DOMM-4UTKE6
The first thing I noticed is that it is kind of inconvenient for the SELECT DOM object for example.
You should iterate through all the items and check their selected property with their defaultSelected property ...
Етикети:
ASP.NET newbies,
JavaScript / Client Scripts
Aug 5, 2009
A nice DOM property I bet most of you have missed ...
Have you ever heard about the defaultValue and the defaultChecked properties?
They seems to be a standard DOM properties so the major browsers seem to support them.
What they do?
The defaultValue property is about textboxes (input type="text") and it will contain the value which the textbox has at the time it was rendered on the page.
The defaultChecked property is almost the same, it is about a checkbox and it tells you whether the checkbox was rendered checked or not.
So doing something like:
function hasTextBoxChanged(textBox) {
return textBox.defaultValue == textBox.value;
}
would tell you whether the textbox passed as an argument has changed its value since it was rendered on the page.
Same function for checkbox would be something like:
function hasCheckBoxChanged(checkbox) {
return checkbox.defaultChecked == checkbox.checked;
}
I find those properties very helpful. If you play a bit with jQuery you can find a real life application of them.
I am however wondering if there are such properties for dropdowns and some other controls.
If I find - I'll definatelly post again.
Hope it helps someone outthere ...
P.S. if the control is a part of update panel and it was udpated in the code behind it will not be counted as a change as the defaultValue / defaultChecked properties will be set again (those properties are taken to be the value of the control when it was rendered).
They seems to be a standard DOM properties so the major browsers seem to support them.
What they do?
The defaultValue property is about textboxes (input type="text") and it will contain the value which the textbox has at the time it was rendered on the page.
The defaultChecked property is almost the same, it is about a checkbox and it tells you whether the checkbox was rendered checked or not.
So doing something like:
function hasTextBoxChanged(textBox) {
return textBox.defaultValue == textBox.value;
}
would tell you whether the textbox passed as an argument has changed its value since it was rendered on the page.
Same function for checkbox would be something like:
function hasCheckBoxChanged(checkbox) {
return checkbox.defaultChecked == checkbox.checked;
}
I find those properties very helpful. If you play a bit with jQuery you can find a real life application of them.
I am however wondering if there are such properties for dropdowns and some other controls.
If I find - I'll definatelly post again.
Hope it helps someone outthere ...
P.S. if the control is a part of update panel and it was udpated in the code behind it will not be counted as a change as the defaultValue / defaultChecked properties will be set again (those properties are taken to be the value of the control when it was rendered).
Етикети:
ASP.NET newbies,
JavaScript / Client Scripts
Aug 3, 2009
Join the W3C feature suggestions group in Facebook!
You want to see a feature as a part of the W3C standard?
Join the W3C feature suggestions group in facebook:
http://www.facebook.com/srch.php#/group.php?gid=111306074563
You may find the feature already included or find a workaround ...
Join the W3C feature suggestions group in facebook:
http://www.facebook.com/srch.php#/group.php?gid=111306074563
You may find the feature already included or find a workaround ...
Aug 2, 2009
Work in a cooperation with your compiler. Always tell the truth about your datatypes!
When you have a cast you should avoid asking the compiler to figure out what kind of data should be returned. This is more about objects and the string data type.
For example I've seen (and to be honest I myself did the following mistake when getting data from DataSet. Don't laugh in .NET 1.1 and 2.0 there was no Linq :)
foreach (DataRow row in dsReportSource.Tables[0].Rows)
{
string strName = row["name"].ToString();
}
The compiler will let you think that it knows how to do the fastest transformation from object (in the dataset all the columns in a row are objects) to the destination type (in our case - string). But it will only let you think so. What will actually happen is that the compiler will slow down the data acquisition due to some internal checks and conversions ...
Instead do the following (as you are more than sure that this column is string):
foreach (DataRow row in dsReportSource.Tables[0].Rows)
{
string strName = (string)row["name"];
}
This way you tell the compiler - "Look, don't even bother to try to infer the type for me. I am telling you this is a string, so please just treat it as string). And it makes sense - after you have a column of type NVARCHAR in the database it will always come to you as a string (masked as object :).
Now there are even worse cases like:
foreach (DataRow row in dsReportSource.Tables[0].Rows)
{
int iId = int.Parse(row["id"].ToString());
}
As you can see you are parsing the id column. You know it's int. But int.Parse can only work on strings, so you are required to turn this object to string, calling its .ToString() method. This will slow down your code insignifficantly on few rows and signifficantly on more rows (few thousands for example).
The following is also wrong:
foreach (DataRow row in dsReportSource.Tables[0].Rows)
{
int iId = Convert.ToInt32(row["id"]);
}
Here you are telling your compiller that you are sure the parameter (row["id"]) will cast to Int32 without problems.
But here you are telling your compiller only 50% of the truth. After you KNOW it is int, just be honest and say:
foreach (DataRow row in dsReportSource.Tables[0].Rows)
{
int iId = (int)row["id"];
}
This applies not only to DataSets but everywhere you have a fixed datatype and you know what the type is.
Don't let your compiler do the work.
Just look at your project and try to find places where you are uncertain about fixed datatype.
Change it to be a direct cast and I am pretty sure you will experience speed improvements.
For example I've seen (and to be honest I myself did the following mistake when getting data from DataSet. Don't laugh in .NET 1.1 and 2.0 there was no Linq :)
foreach (DataRow row in dsReportSource.Tables[0].Rows)
{
string strName = row["name"].ToString();
}
The compiler will let you think that it knows how to do the fastest transformation from object (in the dataset all the columns in a row are objects) to the destination type (in our case - string). But it will only let you think so. What will actually happen is that the compiler will slow down the data acquisition due to some internal checks and conversions ...
Instead do the following (as you are more than sure that this column is string):
foreach (DataRow row in dsReportSource.Tables[0].Rows)
{
string strName = (string)row["name"];
}
This way you tell the compiler - "Look, don't even bother to try to infer the type for me. I am telling you this is a string, so please just treat it as string). And it makes sense - after you have a column of type NVARCHAR in the database it will always come to you as a string (masked as object :).
Now there are even worse cases like:
foreach (DataRow row in dsReportSource.Tables[0].Rows)
{
int iId = int.Parse(row["id"].ToString());
}
As you can see you are parsing the id column. You know it's int. But int.Parse can only work on strings, so you are required to turn this object to string, calling its .ToString() method. This will slow down your code insignifficantly on few rows and signifficantly on more rows (few thousands for example).
The following is also wrong:
foreach (DataRow row in dsReportSource.Tables[0].Rows)
{
int iId = Convert.ToInt32(row["id"]);
}
Here you are telling your compiller that you are sure the parameter (row["id"]) will cast to Int32 without problems.
But here you are telling your compiller only 50% of the truth. After you KNOW it is int, just be honest and say:
foreach (DataRow row in dsReportSource.Tables[0].Rows)
{
int iId = (int)row["id"];
}
This applies not only to DataSets but everywhere you have a fixed datatype and you know what the type is.
Don't let your compiler do the work.
Just look at your project and try to find places where you are uncertain about fixed datatype.
Change it to be a direct cast and I am pretty sure you will experience speed improvements.
Етикети:
.NET,
.NET C# technologies,
ASP.NET newbies,
C#
W3C Zoom CSS property. I really want this feature included!!!
Lot's of people are discussing this.
And the designers are often saying something like:
"I cannot imagine a scenario where you will need to use the Zoom CSS property."
To the readers that haven't yet hit this problem - the CSS Zoom property seems to be proprietary and to be working for IE (I think version 6 and above).
To all those designers - there ARE scenarios where you will want to let the user zoom everything proportionally without using the browser buttons / sliders / shortcuts, but with CSS / JS only.
I will give you few examples:
1. I needed to create an overview control of page. It should represent the page in a smaller percentage and, upon scroll, the page should scroll proportinally. I can have a div with the same DOM tree (or even an IFrame loading the same page or something). In this case I URGENTLY need the CSS Zoom property.
2. Telerik radReporting - the ReportViewer has a dropdown to let the user choose a zoom level to preview the page (web based and not after clicking print preview or something). Actually the Print Preview browser command isn't an option as the report viewer may be on the page with other controls and the user SHOULD BE ABLE to zoom in and out only the portion of the page where the report is (it is an IFrame with the data rendered as HTML, I believe). In telerik case - there seems to be some browser detection and when the browser isn't capable of zooming in / out - the dropdown with the zooming levels is simply hidden (they have no other choice unfortunatelly and I support them for this decision).
Now, as you may expect - in my scenario I cannot simply hide the overview control as the page heavilly depends on it.
Should I now have my revenge now? I've seen all those messages accross the web telling you that there are better browsers to use than IE.
Should I now display a message like:
"Sorry, your browser isn't capable of zooming in and out, only IE supports this, so please switch to IE."
I really hate those browser wars and if you really want to know my opinion - yes, IE may be harder to design. It may be messing up the containers, it may not be passing the ACID N test.
But it is the only browser that is suitable for my scenario (at least from my search in IE all the posts were following the same line - "zoom is IE proprietary, it won't work under other browsers").
Why are all other browsers sleeping then?
P.S. I have found something like -moz-zoom or something but wasn't able to make it work under FireFox (if it works under Firefox it should also probably work under Google Chrome as they are using the same engine I think).
P.P.S. - haven't tested but I think the zoom CSS property should also be available under Opera as they (as far as I know) use the IE core.
P.P.P.S - if anyone know how can we ask W3C to reconsider this for at least the next revision of CSS I would be glad to give my vote. I also advice telerik to do the same. Not only the reporting will work in all browsers but they may be able to do some other great controls using this property.
Really annoying ...
And the designers are often saying something like:
"I cannot imagine a scenario where you will need to use the Zoom CSS property."
To the readers that haven't yet hit this problem - the CSS Zoom property seems to be proprietary and to be working for IE (I think version 6 and above).
To all those designers - there ARE scenarios where you will want to let the user zoom everything proportionally without using the browser buttons / sliders / shortcuts, but with CSS / JS only.
I will give you few examples:
1. I needed to create an overview control of page. It should represent the page in a smaller percentage and, upon scroll, the page should scroll proportinally. I can have a div with the same DOM tree (or even an IFrame loading the same page or something). In this case I URGENTLY need the CSS Zoom property.
2. Telerik radReporting - the ReportViewer has a dropdown to let the user choose a zoom level to preview the page (web based and not after clicking print preview or something). Actually the Print Preview browser command isn't an option as the report viewer may be on the page with other controls and the user SHOULD BE ABLE to zoom in and out only the portion of the page where the report is (it is an IFrame with the data rendered as HTML, I believe). In telerik case - there seems to be some browser detection and when the browser isn't capable of zooming in / out - the dropdown with the zooming levels is simply hidden (they have no other choice unfortunatelly and I support them for this decision).
Now, as you may expect - in my scenario I cannot simply hide the overview control as the page heavilly depends on it.
Should I now have my revenge now? I've seen all those messages accross the web telling you that there are better browsers to use than IE.
Should I now display a message like:
"Sorry, your browser isn't capable of zooming in and out, only IE supports this, so please switch to IE."
I really hate those browser wars and if you really want to know my opinion - yes, IE may be harder to design. It may be messing up the containers, it may not be passing the ACID N test.
But it is the only browser that is suitable for my scenario (at least from my search in IE all the posts were following the same line - "zoom is IE proprietary, it won't work under other browsers").
Why are all other browsers sleeping then?
P.S. I have found something like -moz-zoom or something but wasn't able to make it work under FireFox (if it works under Firefox it should also probably work under Google Chrome as they are using the same engine I think).
P.P.S. - haven't tested but I think the zoom CSS property should also be available under Opera as they (as far as I know) use the IE core.
P.P.P.S - if anyone know how can we ask W3C to reconsider this for at least the next revision of CSS I would be glad to give my vote. I also advice telerik to do the same. Not only the reporting will work in all browsers but they may be able to do some other great controls using this property.
Really annoying ...
Aug 1, 2009
Why your HttpHandler has the Session set to NULL?
I was in a need to create HttpHandler. I also needed to use the session.
Here is my first attempt:
public class ChbHandler : IHttpHandler
{
#region IHttpHandler Members
public bool IsReusable
{
get { return true; }
}
public void ProcessRequest(HttpContext context)
{
HttpRequest req = context.Request;
HttpResponse resp = context.Response;
resp.Write("HttpHandler: Hello World!");
}
#endregion
}
In Here if you try to use the Session object you will not it is null. Why is that?
I googled a bit and found that in order to support session, your HttpHandler should inherit the
IRequiresSessionState or IReadOnlySessionState in order to have the session state in the context parameter (the one that is passed to the ProcessRequest() routine.
Luckilly both interfaces are just marker interfaces, meaning you are not required to implement any additional methods.
So something like this:
public class ChbHandler : IHttpHandler, IRequiresSessionState
{
#region IHttpHandler Members
public bool IsReusable
{
get { return true; }
}
public void ProcessRequest(HttpContext context)
{
HttpRequest req = context.Request;
HttpResponse resp = context.Response;
resp.Write("HttpHandler: Hello World!");
}
#endregion
}
Should work just fine for you.
The only change is : IRequiresSessionState in the list of Interfaces that the class will inherit.
Here is my first attempt:
public class ChbHandler : IHttpHandler
{
#region IHttpHandler Members
public bool IsReusable
{
get { return true; }
}
public void ProcessRequest(HttpContext context)
{
HttpRequest req = context.Request;
HttpResponse resp = context.Response;
resp.Write("HttpHandler: Hello World!");
}
#endregion
}
In Here if you try to use the Session object you will not it is null. Why is that?
I googled a bit and found that in order to support session, your HttpHandler should inherit the
IRequiresSessionState or IReadOnlySessionState in order to have the session state in the context parameter (the one that is passed to the ProcessRequest() routine.
Luckilly both interfaces are just marker interfaces, meaning you are not required to implement any additional methods.
So something like this:
public class ChbHandler : IHttpHandler, IRequiresSessionState
{
#region IHttpHandler Members
public bool IsReusable
{
get { return true; }
}
public void ProcessRequest(HttpContext context)
{
HttpRequest req = context.Request;
HttpResponse resp = context.Response;
resp.Write("HttpHandler: Hello World!");
}
#endregion
}
Should work just fine for you.
The only change is : IRequiresSessionState in the list of Interfaces that the class will inherit.
Етикети:
.NET,
.NET C# technologies,
ASP.NET newbies
Insignifficant inconvience in telerik radReports
This one is not a big deal but it would be good if there is a workaround.
When you create a new report and choose to create a new datasouce (Database in my case) - the classes will be created in the project root and not where the report is created.
I tried to find some option or something in order to be able to place the datasource in a different folder in my project but with no luck. The datasource was always created in the root of the project.
Here comes the Microsoft part - when you then try to move the classes in another folder (by dragging them in the solution explorer), Visual Studio seems to mess up the namespaces (although I am 99% sure I have moved classes accross the project and the result was I need to manually change the class namespace in order to reflect its path - for example I have been able to move classes from the root folder of the project to let's say a folder named Helpers and I needed to manually change the namespace from ProjectName.SomeClass to ProjectName.Helpers.SomeClass), just can't get it.
It may ofcourse be some of the endless options in the Visual Studio not checked :)
It's kind of pain when you have a large project and want to separate different files according to their role in the project.
When you create a new report and choose to create a new datasouce (Database in my case) - the classes will be created in the project root and not where the report is created.
I tried to find some option or something in order to be able to place the datasource in a different folder in my project but with no luck. The datasource was always created in the root of the project.
Here comes the Microsoft part - when you then try to move the classes in another folder (by dragging them in the solution explorer), Visual Studio seems to mess up the namespaces (although I am 99% sure I have moved classes accross the project and the result was I need to manually change the class namespace in order to reflect its path - for example I have been able to move classes from the root folder of the project to let's say a folder named Helpers and I needed to manually change the namespace from ProjectName.SomeClass to ProjectName.Helpers.SomeClass), just can't get it.
It may ofcourse be some of the endless options in the Visual Studio not checked :)
It's kind of pain when you have a large project and want to separate different files according to their role in the project.
Jul 29, 2009
radTextBox - get the client ID of the TextBox ...
As the radTextBox should be changing its behaviour depending on the mode in which the developer put it. It doesn't return the ID of the TextBox (I mean the input type="text" id) when you call something like:
rtb.ClientID.
So if you have a radTextBox with the name of
rtbName
You will need to say:
string.Format("{0}_text", rtbName.ClientID);
At least I couldn't find a property to return this information for me.
You can also write a simple extension to do the work for you. Something like:
public static string GetTextBoxID(this RadTextBox rtb)
{
return string.Format("{0}_text", rtb.ClientID);
}
So you can then call it like:
rtb.GetTextBoxID();
Hope it helps ...
rtb.ClientID.
So if you have a radTextBox with the name of
rtbName
You will need to say:
string.Format("{0}_text", rtbName.ClientID);
At least I couldn't find a property to return this information for me.
You can also write a simple extension to do the work for you. Something like:
public static string GetTextBoxID(this RadTextBox rtb)
{
return string.Format("{0}_text", rtb.ClientID);
}
So you can then call it like:
rtb.GetTextBoxID();
Hope it helps ...
telerik radReporting, am I missing something?
I was playing with the radReporting tool. I had a datasource with 1 master item, which has about 2500 child data items.
I was trying to generate a master / detail report with the telerik radReporting.
Here is what I have so far.
First of all - using their videos is a great help. I had everything I needed in order to start.
Second - the designer is really great. I am not designer and it really pisses me off when I had to do any kind of design but with the deep Visual Studio integration and all those little yellow overlap indicators even a guy like me can do the report design.
But then the ultimate test came - the speed.
I want to clarify that I am in the begining and I am more like rookie in the telerik reporting and the reporting at all so it may be my mistake and not their. But I did follow a video to show me how to do the master / details report and I feel I did everything as it was on the video so I was expecting some performance.
Unfortunatelly with the configuration above - 1 master item and about 2500 detail items I had to wait about 5-6 minutes for the report being generated as HTML in the report viewer.
It's OK, I can live with that. There is a lot of data, their matrixes are complex and it takes time to do all the calculations. So 5-6 minutes are OK. Then I selected Rich Text format from the export type dropdown to export my report to an RTF. I was expecting it to pass with the same speed or a bit slower but it took about 25 minutes to load. And sometimes the system was going in out of memory exception...
I wrote my own RTF epxort, which wasn't using telerik radReporting designer but some generations I did instead. I was the one to care about the overall layout. And guess what?
With the remakrs made above (that I need to manually create a class for the report and do the matrixes my way) it took about 10 - 15 SECONDS to load the report. This is about 150 TIMES faster.
When I managed to get a report from the telerik radReportViewer (I needed few tries until the server was in a good enough mood to provide me with one :) it was about 10 MB, while mine which is minimized and set up for just that layout was about 1 MB.
Again - I don't blame telerik as I am not quite sure if I did everything right when I was generating the reports with their designer. I am just learning how to walk in the field of reporting so I may be missing way too much things.
I can only check that my data is comming in 2-3 seconds (so it is not a slow DB issue I guess).
If I am right I may be having an idea that may be considered by them to speed up the performance. I am also now looking if I can connect to some event or override some method that will let me inject my reporting solution instead using their.
If I find a way to do this I will write another post.
If not - I will use telerik radReporting only to open the HTML report in the report viewer and replace the RTF generation with mine so the user can be happy.
Anyone who has some remarks / ideas / help is welcome to comment this post.
I was trying to generate a master / detail report with the telerik radReporting.
Here is what I have so far.
First of all - using their videos is a great help. I had everything I needed in order to start.
Second - the designer is really great. I am not designer and it really pisses me off when I had to do any kind of design but with the deep Visual Studio integration and all those little yellow overlap indicators even a guy like me can do the report design.
But then the ultimate test came - the speed.
I want to clarify that I am in the begining and I am more like rookie in the telerik reporting and the reporting at all so it may be my mistake and not their. But I did follow a video to show me how to do the master / details report and I feel I did everything as it was on the video so I was expecting some performance.
Unfortunatelly with the configuration above - 1 master item and about 2500 detail items I had to wait about 5-6 minutes for the report being generated as HTML in the report viewer.
It's OK, I can live with that. There is a lot of data, their matrixes are complex and it takes time to do all the calculations. So 5-6 minutes are OK. Then I selected Rich Text format from the export type dropdown to export my report to an RTF. I was expecting it to pass with the same speed or a bit slower but it took about 25 minutes to load. And sometimes the system was going in out of memory exception...
I wrote my own RTF epxort, which wasn't using telerik radReporting designer but some generations I did instead. I was the one to care about the overall layout. And guess what?
With the remakrs made above (that I need to manually create a class for the report and do the matrixes my way) it took about 10 - 15 SECONDS to load the report. This is about 150 TIMES faster.
When I managed to get a report from the telerik radReportViewer (I needed few tries until the server was in a good enough mood to provide me with one :) it was about 10 MB, while mine which is minimized and set up for just that layout was about 1 MB.
Again - I don't blame telerik as I am not quite sure if I did everything right when I was generating the reports with their designer. I am just learning how to walk in the field of reporting so I may be missing way too much things.
I can only check that my data is comming in 2-3 seconds (so it is not a slow DB issue I guess).
If I am right I may be having an idea that may be considered by them to speed up the performance. I am also now looking if I can connect to some event or override some method that will let me inject my reporting solution instead using their.
If I find a way to do this I will write another post.
If not - I will use telerik radReporting only to open the HTML report in the report viewer and replace the RTF generation with mine so the user can be happy.
Anyone who has some remarks / ideas / help is welcome to comment this post.
Jul 12, 2009
Nice example on the Sieve of Eratosthenes algorithm
On the following address you can find a good example on how the Sieve of Eratosthenes works on the first 100 numbers.
http://en.wikipedia.org/wiki/File:Animation_Sieve_of_Eratosth-2.gif
Brief Explanation of the picture:
1. Take the first number (2), it has 2 divisors - 1 and 2 itself. So mark all the numbers that divide by 2 (the red color).
2. Take the next number (3), that is not marked by the previous step (number 3). It has 2 divisors - 1 and 3 itself, mark all the numbers that divide by 3 (green color).
3. Take the next number that is not marked by the previous steps and check if it had exactly two divisors - 1 and the number itself (the chance this number to be prime number is bigger as all the numbers that may be divisors to this number are already marked). Mark all the numbers that divide by the number choosen.
4. Repeat step 3 until the number choosen is less than or equal to the limit you want to find the prime numbers for.
Note : I would like to excuse for my poor scientific english :).
http://en.wikipedia.org/wiki/File:Animation_Sieve_of_Eratosth-2.gif
Brief Explanation of the picture:
1. Take the first number (2), it has 2 divisors - 1 and 2 itself. So mark all the numbers that divide by 2 (the red color).
2. Take the next number (3), that is not marked by the previous step (number 3). It has 2 divisors - 1 and 3 itself, mark all the numbers that divide by 3 (green color).
3. Take the next number that is not marked by the previous steps and check if it had exactly two divisors - 1 and the number itself (the chance this number to be prime number is bigger as all the numbers that may be divisors to this number are already marked). Mark all the numbers that divide by the number choosen.
4. Repeat step 3 until the number choosen is less than or equal to the limit you want to find the prime numbers for.
Note : I would like to excuse for my poor scientific english :).
Jun 3, 2009
Telerik Style Builder
It is available, yes.
You can test it on the following address:
Telerik Style Builder

I think this is a great service, that will help the collaboration between designers and developers a lot.
Currently only few of the controls have the fine tune interface implemented but I think it is a very good start.
You can test it on the following address:
Telerik Style Builder
I think this is a great service, that will help the collaboration between designers and developers a lot.
Currently only few of the controls have the fine tune interface implemented but I think it is a very good start.
radGrid - check if there was a row selected, before selecting another one [2]
The previous post on this topic was about pointing some solution, which doesn't always work.
I think I was able to identify the problem for this issue.
It is becasue the chain of events is the following when you select a new row:
1. RowDeselected.
2. RowSelecting.
3. RowClick.
3. RowSelected.
I am not quite able to find the logic here.
I think in normal english I should be able to say:
"I am clicking on a row."
"I am in a process of selecting a row." (if not canceled)
"I am deselecting the old row."
"I have selected the new row."
At least the RowClick in my opinion should be fired prior the events described above as it occurs before everything else. You are initiating the above chain of events by clicking on a row so all of them should follow in my opinion.
To me the fact that RowDeselected is before RowSelecting is not such a bad solution. I just can't get why the RowClick is between RowSelecting and RowSelected events.
Any clues?
I think I was able to identify the problem for this issue.
It is becasue the chain of events is the following when you select a new row:
1. RowDeselected.
2. RowSelecting.
3. RowClick.
3. RowSelected.
I am not quite able to find the logic here.
I think in normal english I should be able to say:
"I am clicking on a row."
"I am in a process of selecting a row." (if not canceled)
"I am deselecting the old row."
"I have selected the new row."
At least the RowClick in my opinion should be fired prior the events described above as it occurs before everything else. You are initiating the above chain of events by clicking on a row so all of them should follow in my opinion.
To me the fact that RowDeselected is before RowSelecting is not such a bad solution. I just can't get why the RowClick is between RowSelecting and RowSelected events.
Any clues?
Jun 2, 2009
radGrid - check if there was a row selected, before selecting another one.
Okay, we had the radGrid with AllowMultiRowSelection property turned off.
But we needed to check if there is already a selection in the grid (on the client side), then get the item and do some calculations.
So far so good.
But it appeared that it is very difficult to get the previous item selected in a grid when selecting a new one.
The OnRowSelected event as you may suspect is raised too late in order to get this information as the selection is already changed.
So I thought the OnRowSelecting event will be the best time to perform this.
Guess what? It wasn't. At least for me.
Each time I checked the
sender.MasterTableView.get_selectedItems().length > 0
The statement evaluated to false (which means to me that when the OnRowSelecting event is raised AFTER the selection is Clear()).
So I found a workaround to help myself persist the previous selected item of the grid:
var lastRow = null;
function RowDeselected(sender, eventArgs) {
lastRow = sender;
}
function RowSelecting(sender, eventArgs) {
if (lastRow) {
// There was a selection before we try to select. Do whatever you need here.
}
else {
// There wasn't any selected item, this is the first one.
}
}
To me it seems that problems may arise. I will test some more to see for side effects and will report back.
Any comments are appreciated.
But we needed to check if there is already a selection in the grid (on the client side), then get the item and do some calculations.
So far so good.
But it appeared that it is very difficult to get the previous item selected in a grid when selecting a new one.
The OnRowSelected event as you may suspect is raised too late in order to get this information as the selection is already changed.
So I thought the OnRowSelecting event will be the best time to perform this.
Guess what? It wasn't. At least for me.
Each time I checked the
sender.MasterTableView.get_selectedItems().length > 0
The statement evaluated to false (which means to me that when the OnRowSelecting event is raised AFTER the selection is Clear()).
So I found a workaround to help myself persist the previous selected item of the grid:
var lastRow = null;
function RowDeselected(sender, eventArgs) {
lastRow = sender;
}
function RowSelecting(sender, eventArgs) {
if (lastRow) {
// There was a selection before we try to select. Do whatever you need here.
}
else {
// There wasn't any selected item, this is the first one.
}
}
To me it seems that problems may arise. I will test some more to see for side effects and will report back.
Any comments are appreciated.
May 29, 2009
telerik radGrid - be careful with the virtual scrolling under Firefox
Again some issues under Firefox.
We have found a great example of how to populate on demand a radGrid (when scrolling grid scrollbar down to the end it will make ajaxRequest and ask for some more items to fill in the grid with).
We loved this feature and decided to incorporate it into one of our projects.
Unfortunatelly I discovered it won't work pretty well under the FireFox browser.
Let me briefly explain what does the code and then what is the problem, then I will suggest a simple fix.
Here is the demo:
http://www.telerik.com/help/aspnet-ajax/grdvirtualscrollpaging.html
Now, it shows you how to request the items and then reload the grid. So far everything works perfect.
If you however reach the end of the grid items (meaning you are at the last page, or the page count is 1), when you pull the scrollbar down to the bottom, firefox will execute the function which should pull some more records.
Then it will append them and.
So far everything is great!
But it will then magically decide to fire the OnScroll event once again, it will not pull any more records as you already have them in the grid.
And then it will append them.
Then it will again fire the OnScroll event ....
... then it will again fire the OnScroll event ...
Hm, sounds like endless trips to the server and back. That's what happened when we tested.
Now here is the code we had to achieve this:
<ClientEvents OnScroll="HandleScrolling" />
And here is the JS HandleScrolling function:
function HandleScrolling(sender, eventArgs) {
if (eventArgs.get_isOnBottom()) {
$find("<%= RadAjaxManager.GetCurrent(this.Page).ClientID %>").ajaxRequest(sender.get_masterTableView().get_name());
}
}
Now to be hones - I never have even dream of achieving such functionality with 4 lines of code. Kudos to telerik team for architecting the controls this way.
The fix to this issue also bring another feature ;) (not bad but good) - you will not need to go to the server when you already have all the records in your radGrid.
Here is the fixed version of the HandleScrolling javascript function:
function HandleScrolling(sender, eventArgs) {
if (eventArgs.get_isOnBottom() && sender.get_masterTableView().PageCount > 1) {
$find("<%= RadAjaxManager.GetCurrent(this.Page).ClientID %>").ajaxRequest(sender.get_masterTableView().get_name());
}
}
Did you spot the difference?
All i did was to add logical "and" operator to check if the masterTableView page is only one (which means that we don't have anything on the server which should be loaded on the client) and voilla!
Hope this helps someone!
We have found a great example of how to populate on demand a radGrid (when scrolling grid scrollbar down to the end it will make ajaxRequest and ask for some more items to fill in the grid with).
We loved this feature and decided to incorporate it into one of our projects.
Unfortunatelly I discovered it won't work pretty well under the FireFox browser.
Let me briefly explain what does the code and then what is the problem, then I will suggest a simple fix.
Here is the demo:
http://www.telerik.com/help/aspnet-ajax/grdvirtualscrollpaging.html
Now, it shows you how to request the items and then reload the grid. So far everything works perfect.
If you however reach the end of the grid items (meaning you are at the last page, or the page count is 1), when you pull the scrollbar down to the bottom, firefox will execute the function which should pull some more records.
Then it will append them and.
So far everything is great!
But it will then magically decide to fire the OnScroll event once again, it will not pull any more records as you already have them in the grid.
And then it will append them.
Then it will again fire the OnScroll event ....
... then it will again fire the OnScroll event ...
Hm, sounds like endless trips to the server and back. That's what happened when we tested.
Now here is the code we had to achieve this:
<ClientEvents OnScroll="HandleScrolling" />
And here is the JS HandleScrolling function:
function HandleScrolling(sender, eventArgs) {
if (eventArgs.get_isOnBottom()) {
$find("<%= RadAjaxManager.GetCurrent(this.Page).ClientID %>").ajaxRequest(sender.get_masterTableView().get_name());
}
}
Now to be hones - I never have even dream of achieving such functionality with 4 lines of code. Kudos to telerik team for architecting the controls this way.
The fix to this issue also bring another feature ;) (not bad but good) - you will not need to go to the server when you already have all the records in your radGrid.
Here is the fixed version of the HandleScrolling javascript function:
function HandleScrolling(sender, eventArgs) {
if (eventArgs.get_isOnBottom() && sender.get_masterTableView().PageCount > 1) {
$find("<%= RadAjaxManager.GetCurrent(this.Page).ClientID %>").ajaxRequest(sender.get_masterTableView().get_name());
}
}
Did you spot the difference?
All i did was to add logical "and" operator to check if the masterTableView page is only one (which means that we don't have anything on the server which should be loaded on the client) and voilla!
Hope this helps someone!
Firefox with Plugins may lead to some problems with telerik controls
I had an issue with the telerik radTabStrip control.
It wouldn't switch the tabs. In some cases you are only able to navigate between the first and the last tab, in some cases you may not be able to change tabs at all.
I was very surprised as telerik is famous for supporting cross browser functionality for all the controls.
I thought the problem may be in my TV but wasn't able to find anything.
A collegue of mine also had some problems using firefox full of plugins with the telerik controls but we never thought the problem may be in the plugins.
In my case the problem was in Interclue add-on used to preload a page for you (when you point a link, the plug in will give you a screenshot of the page that stands behind the link).
So if you ever have problems using telerik controls under FF - please check your plugins first.
It wouldn't switch the tabs. In some cases you are only able to navigate between the first and the last tab, in some cases you may not be able to change tabs at all.
I was very surprised as telerik is famous for supporting cross browser functionality for all the controls.
I thought the problem may be in my TV but wasn't able to find anything.
A collegue of mine also had some problems using firefox full of plugins with the telerik controls but we never thought the problem may be in the plugins.
In my case the problem was in Interclue add-on used to preload a page for you (when you point a link, the plug in will give you a screenshot of the page that stands behind the link).
So if you ever have problems using telerik controls under FF - please check your plugins first.
May 20, 2009
Some casing problems I experienced.
As far as I understand, the settings for the code format are in the following Visual Studio menu:
Tools -> Options ->Text Editor
There you have the ability to change things.
I was having some problems reguarding the way my markup is formatted (few of the tags are made lowercase when I hit CTRL + K + D (format whole document)).
So I think the settings for this should be under the HTML -> Format, or the whole path for the menu should be :
Tools -> Options ->Text Editor -> HTML -> Format
I then checked the "Server Tag:" dropdown. It says "Assembly definition", the other options are "As entered", "Lowercase", "Uppercase" but I don't like them :).
Now the issue comes when I have a radGrid with <ClientSettings> or <PagerStyle> sections. To me they must be in Pascal notation (as all other sections and properties), but when I hit CTRL + K + D they are re-formatted to be lowercase.
The issues may be in
1. The telerik assembly itself.
2. Some AddIn conflicts.
It is not a big issue, just decided to share with you.
Please share your thoughts if you faced such issues.
Tools -> Options ->Text Editor
There you have the ability to change things.
I was having some problems reguarding the way my markup is formatted (few of the tags are made lowercase when I hit CTRL + K + D (format whole document)).
So I think the settings for this should be under the HTML -> Format, or the whole path for the menu should be :
Tools -> Options ->Text Editor -> HTML -> Format
I then checked the "Server Tag:" dropdown. It says "Assembly definition", the other options are "As entered", "Lowercase", "Uppercase" but I don't like them :).
Now the issue comes when I have a radGrid with <ClientSettings> or <PagerStyle> sections. To me they must be in Pascal notation (as all other sections and properties), but when I hit CTRL + K + D they are re-formatted to be lowercase.
The issues may be in
1. The telerik assembly itself.
2. Some AddIn conflicts.
It is not a big issue, just decided to share with you.
Please share your thoughts if you faced such issues.
Етикети:
Telerik,
Telerik Rad Controls,
Visual Studio
Subscribe to:
Posts (Atom)