Monday, November 30, 2009
Tuesday, October 13, 2009
Silverlight Data Pagination without knowing the page count
I had a typical situation today where i need to write my own custom silverlight data pager control which
1) needs to speak to my web services to fetch incremental data. i.e. each page click should send a request to the web service.
2)** The services were not in my control . All i get is data if i pass start & end index to the service.
Breif info on existing silverlight pager controls
1) the one that comes with silverlight toolkit is a client side one.So its more of a fetch all data & distribute among pages approach which i dont want.
2)Some custom pagers which fetch data from services on every page click.But these paging controls needs to have the page count before hand to build the pager & display the number of pages.
But in my case
I dont want client side pager.
I dont know the total records count before hand so i cant tell you the number of pages.
So How i go about hsi problem
- All that i have is 2 buttons 'Previous' & 'Next' Button.
How the logic works here
1) first disable previous & next buttons
2)fetch double the pagesize. say if ur page size is 20 then go & fetch (0,40) records.
On fetch if count of records < pagesize in our case 20 then disable next button.
if fetched records count > 20 then enable next button.
The logic has some checks & all we do at end of each page fetch is adding those records to a pagedcollectionview. So ur back button press is a offline query to the collection that you hold.Even though this kind of an approach saves ur web service request hits its not recommended.Because all we are interested is 'LIVE' Data.
Anyways i will be posting a custom pager in the next few days once i am done.
1) needs to speak to my web services to fetch incremental data. i.e. each page click should send a request to the web service.
2)** The services were not in my control . All i get is data if i pass start & end index to the service.
Breif info on existing silverlight pager controls
1) the one that comes with silverlight toolkit is a client side one.So its more of a fetch all data & distribute among pages approach which i dont want.
2)Some custom pagers which fetch data from services on every page click.But these paging controls needs to have the page count before hand to build the pager & display the number of pages.
But in my case
I dont want client side pager.
I dont know the total records count before hand so i cant tell you the number of pages.
So How i go about hsi problem
- All that i have is 2 buttons 'Previous' & 'Next' Button.
How the logic works here
1) first disable previous & next buttons
2)fetch double the pagesize. say if ur page size is 20 then go & fetch (0,40) records.
On fetch if count of records < pagesize in our case 20 then disable next button.
if fetched records count > 20 then enable next button.
The logic has some checks & all we do at end of each page fetch is adding those records to a pagedcollectionview. So ur back button press is a offline query to the collection that you hold.Even though this kind of an approach saves ur web service request hits its not recommended.Because all we are interested is 'LIVE' Data.
Anyways i will be posting a custom pager in the next few days once i am done.
Thursday, July 30, 2009
Good posts .net related
Interface vs. Abstract Class in C#
http://digcode.com/default.aspx?page=ed51cde3-d979-4daf-afae-fa6192562ea9&article=b9103da3-5c99-4831-8bf0-dc6bd810b480
Abstract Factory Design Pattern c#
http://www.geekdaily.net/2009/01/06/c-design-patterns-abstract-factory-pattern/
http://www.codeproject.com/KB/aspnet/SoftArchInter1.aspx
http://digcode.com/default.aspx?page=ed51cde3-d979-4daf-afae-fa6192562ea9&article=b9103da3-5c99-4831-8bf0-dc6bd810b480
Abstract Factory Design Pattern c#
http://www.geekdaily.net/2009/01/06/c-design-patterns-abstract-factory-pattern/
http://www.codeproject.com/KB/aspnet/SoftArchInter1.aspx
Thursday, April 9, 2009
Theming support added
We resumed our outlook add -on project after a gap of 3 months.
Ribbon Bar for our outlook add-on now has theming/Skinning support with 4 themes(Sky Blue, Communist Red and my own Black Chrome and Go Green themes.
I at first doubted my ability to work without wireframes but at last the wireframes created in my mind were translated into themes in WPF.
I will post a snapshot of how the ribbon bar looks like.
Thanks to WPF Toolkit.
Ribbon Bar for our outlook add-on now has theming/Skinning support with 4 themes(Sky Blue, Communist Red and my own Black Chrome and Go Green themes.
I at first doubted my ability to work without wireframes but at last the wireframes created in my mind were translated into themes in WPF.
I will post a snapshot of how the ribbon bar looks like.
Thanks to WPF Toolkit.
Wednesday, February 11, 2009
ExtJs problems with Date control
While working with extjs date control , I experienced a lots of problems.
-Auto increment of date in extjs
take a look at
http://extjs.com/deploy/dev/examples/form/xml-form.html
In that example when u put some value like 13 in months field of date control then on shift of focus,date control gets auto incremented.I dont know how this can be useful to any one ?? So i felt like correcting this mistake of user rather notify him of his error.
so all i has to do is handle this function
Ext.form.DateField.prototype.beforeBlur = function() { };
and keep my custom validator in place
function dateValidator(value)
{
if((parseInt(value.substring(0,2)) <=0 ) || (parseInt(value.substring(0,2)) > 12))
{
var message= 'Please Enter a Proper Number for ' + ' Month ' +' in ' + this.fieldLabel+' field ';
return message;
}
else if((parseInt(value.substring(3,5)) <=0 ) || (parseInt(value.substring(3,5)) > 31))
{
var message= 'Please Enter a Proper Number for ' + ' Day ' +' in ' + this.fieldLabel+' field ';
return message;
}
else
return true;
}
-Keys inside Date Control
Another important feature i needed was to allow user to submit the forum on enter even when he was in date field and the important thing was to get the edited(dirty) value of date filed.
Normally when u apply key events for a form , try to submit that form say on Enter key , then when u 'enter' while focus inside date field then you end up getting the value of date field which may not be the exact value u have entered in currently focused date field .The way extjs does is
-value : proper value
-rawvalue : dirty value which may or may not be valid
So in my case of user entering while inside datefield, i use getRawValue().
Refer to example in attachment.
http://www.box.net/shared/lkal6x9sr7
-Auto increment of date in extjs
take a look at
http://extjs.com/deploy/dev/examples/form/xml-form.html
In that example when u put some value like 13 in months field of date control then on shift of focus,date control gets auto incremented.I dont know how this can be useful to any one ?? So i felt like correcting this mistake of user rather notify him of his error.
so all i has to do is handle this function
Ext.form.DateField.prototype.beforeBlur = function() { };
and keep my custom validator in place
function dateValidator(value)
{
if((parseInt(value.substring(0,2)) <=0 ) || (parseInt(value.substring(0,2)) > 12))
{
var message= 'Please Enter a Proper Number for ' + ' Month ' +' in ' + this.fieldLabel+' field ';
return message;
}
else if((parseInt(value.substring(3,5)) <=0 ) || (parseInt(value.substring(3,5)) > 31))
{
var message= 'Please Enter a Proper Number for ' + ' Day ' +' in ' + this.fieldLabel+' field ';
return message;
}
else
return true;
}
-Keys inside Date Control
Another important feature i needed was to allow user to submit the forum on enter even when he was in date field and the important thing was to get the edited(dirty) value of date filed.
Normally when u apply key events for a form , try to submit that form say on Enter key , then when u 'enter' while focus inside date field then you end up getting the value of date field which may not be the exact value u have entered in currently focused date field .The way extjs does is
-value : proper value
-rawvalue : dirty value which may or may not be valid
So in my case of user entering while inside datefield, i use getRawValue().
Refer to example in attachment.
http://www.box.net/shared/lkal6x9sr7
Sunday, February 8, 2009
ExtJs Grid Extension with Copy,Paste of selected Cell,Row and Grid
Grid is a very crucial component while building business applications.
One very required feature of grids is context menu with copy cell,row and entire grid. In our application we needed this feature to be there in almost all the grids in the application. So inspired by this post on extjs forums
http://extjs.com/forum/showthread.php?t=13340
I have made a grid extension which has copy cell,row and grid features. The reason behind making this extension is re-usability since i cant write the same code for every grid just to get these functions(cell,row,table copy).
For Mozilla Browsers I made use of a workaround on this post
http://www.jeffothy.com/weblog/clipboard-copy.
So here i am posting the code of ExtJs grid extension with copy cell,row and grid,sample html with extjs grid . take care of css ,images paths of extjs.
http://www.box.net/shared/i9m7i36llx
Note :
For Asp.net users please take care of Date.Format issues when your column type is Date Type.
One very required feature of grids is context menu with copy cell,row and entire grid. In our application we needed this feature to be there in almost all the grids in the application. So inspired by this post on extjs forums
http://extjs.com/forum/showthread.php?t=13340
I have made a grid extension which has copy cell,row and grid features. The reason behind making this extension is re-usability since i cant write the same code for every grid just to get these functions(cell,row,table copy).
For Mozilla Browsers I made use of a workaround on this post
http://www.jeffothy.com/weblog/clipboard-copy.
So here i am posting the code of ExtJs grid extension with copy cell,row and grid,sample html with extjs grid . take care of css ,images paths of extjs.
http://www.box.net/shared/i9m7i36llx
Note :
For Asp.net users please take care of Date.Format issues when your column type is Date Type.
Monday, January 5, 2009
Introduce Myself!!
Hey I am jagdeesh karicherla.I am a software developer.
I work with the following Frameworks
-WPF
-ExtJS
-Silverlight
For any queries
-Jagdeesh@acsellerate.net
-Jagdeesh.net@gmail.com
I work with the following Frameworks
-WPF
-ExtJS
-Silverlight
For any queries
-Jagdeesh@acsellerate.net
-Jagdeesh.net@gmail.com
Subscribe to:
Posts (Atom)