GridView with Select All CheckBox using JQuery

by mosessaur| 25 March 2008| 16 Comments

One of the handy features that one might with to put on GridView is the Select All checkbox which is similar to the one on Hotmail and Yahoo. You click the checkbox on the header and all items (checkboxes underneath) get checked. [View Demo]

I've seen several implementation for this feature long time ago. Myself wrote one. And all solutions were using some good amount of JavaScript. Today I was thinking, why not revisit the idea again, but this time using all mighty JQuery.

And as expected, the amount of code used to implement this simple feature is really small. I'm going to explore the JQuery code expecting you already know ASP.NET and how to use GridView along with SqlDataSource.

My GirdView looks exactly like this one:
GridView With CheckBoxes

More...


Displaying Row Details Tooltip on GridView using JQuery

by mosessaur| 14 March 2008| 24 Comments

Continuing exploring JQuery! I decided to implement a feature to display some kind of details related to a row displayed on GridView. For example when displaying employees details on GridView some information might not fit in the GridView because it will make it huge and wide. These infomration can be diplayed as Tooltip. Or when you want to display a picture and some kind of formated text to be diplayed as tooltip when mouse hover on the image.

My sample here will show how to implement such feature using JQuery. Again, I'm using same data and designed presented in my previous posts:

  1. Building a grouping Grid with GridView and ASP.NET AJAX toolkit CollapsiblePanel.
  2. Building a grouping Grid with GridView and JQuery.

I'll display customer orders as tooltip. of course so much data to be diplayed as tooltip, but this is just demonstration [View Demo].

jquerytooltip

More...

Building a grouping Grid with GridView and JQuery

by mosessaur| 08 March 2008| 21 Comments

Nothing really new on this post, just another way to implement mater/detail representation with nested GridViews with assistance of JQuery. Previously I posted about building same feature using ASP.NET AJAX CollapsiblePanel Extender. that was another example of what Matt Berseth presented in his post about building a grouping grid using ASP.NET 3.5 ListView and Linq.

In this post I'll show how same feature can be implemented using JQuery. Very simple and straight forward.

Requirements:
It is required to download latest version of JQueryin order to be able to use this sample [View Demo].

More...


BlogEngine.Net Extensions How-To part 02, Enhancing Post View Count Extension

by mosessaur| 04 March 2008| 8 Comments

Couple of days ago, I've walked through how to build simple BlogEngine Extension. Today I'll explore an advanced feature of BlogEngine Extensions which is provided settings your own extensions.

What is Extension Settings:
Settings are parameters user can provide to an extension to manage its behaviour. For example in my PostViews Extension, I'll provide settings that will allow user to exclude rage of IP addresses from accumulating any post view count. This setting is provided by the extension, and defined/filled by user.

Extension Setting Types:
I was able to categorize extension settings into 2 types:

  1. Scalar Extension Settings:
    Only single value per parameter will be added. This will be reflected on the settings web form as one text box per parameter which will only accept single value. To enable this feature you should set ExtensionSettings.IsScalar=true
  2. Multi Valued Extension Settings:
    Will allow multi value per parameter to be added. Just as Tabular settings. This will be reflected on the settings web form as list of values displayed on GridView. You can add new settings, edit or delete existing ones. To enable this feature you should set ExtensionSettings.IsScalar=false which is currently the default value.

PostViews Extension we are exploring now, has Scalar Extension Settings. The final results of your settings will be displayed as web from with simple text box entry fields:
PostViewsExtensionSettingsForm

More...






BlogEngine.Net Extensions How-To part 01, Simple Post View Count Extension

by mosessaur| 01 March 2008| 6 Comments

In this post and following one, I'll explore how to build BlogEngine.Net Extension. In my previous post I showed a simple Extension. Here I'll start again with how to build simple Extension to view total view counts of a post.

Step 1 - Create your class and mark it with Extension Attribute:
Just in the App_Code/Extensions folder, create your extension class and mark it with Extension attribute just as the following:

   1: [Extension("Counts and display number of views for a post", "1.0", "<a href=\"http://www.mosesofegypt.net\">Moses</a>")]
   2: public class PostViewes
   3: {
   4: }

The Extension attribute is very simple, it accepts 3 parameters, Description of the Extension, Extension version and the name of the Author who developed this extension. All are strings of course.

More...


Building A BlogEngine Extension, ModeratedComments Extension

by mosessaur| 26 February 2008| 10 Comments

If you are BlogEngine.Net fan, then you should heard or used BlogEngine.Net Extensions; the extensibility feature in BlogEngine.Net. My story with Extensionsstarted just last week. I enabled the comment moderation setting on my blog. And I faced a small issue, I wanted a page to view all moderated comments -waiting for approval-. I proposed that to my friend Amr, he suggested to me to have a look at BlogEngine.Net Extensions

The Story:
Well, the story was that I wanted to view all unapproved comments on my blog. There was only one solution in my mind before Amrsuggest to me to use BlogEngine.Net Extensions. That solution was to add new methods to exiting APIs or use the existing ones. I liked the idea of using existing ones, but the issue is that I will have to loop through all posts to find out if any as unapproved comments. And of course I didn't like the idea of adding new methods to existing APIs because it is just not acceptable at the time being, I am not one of BlogEngine developer's team, so will be hard for me to integrate my code in the upcoming releases.

The Extension Solution:
"Extensions allows you to write a class that can hook up to all the various events that are exposed in the application in a very simple manor" -Creating Extensions on BlogEngine Wiki-. Yes this sound like something to me. I need every time a comment is added to my blog to bookmark the post as it has pending comments waiting for approval. So I will handle Post.CommentAdded event and bookmark the post. Later, I'll build a page to view bookmarked posts and retrieve their moderated comments. To Bookmark a post, I just used simple XML file to store the unique identifier of the post.

More...



Building a grouping Grid with GridView and ASP.NET AJAX toolkit CollapsiblePanel

by mosessaur| 24 February 2008| 78 Comments

UPDATE: I've posted an update to this post to apply on demand loading of Details data using ASP.NET AJAX PageMethods. I'm demonstrating the usage if CollapsiblePanelExtender client events on the new post. Check it out.

I admit, Matt Berseth is really inspiring me! Few days ago I pass through 2 of his great posts:

The first one is pure design tips one which I used for making good presentation of my demo here. The 2nd post is actually the idea.

Here I'll do the same idea Matt presented in his post, but I'll user ASP.NET 2.0 simple stuff plus ASP.NET AJAX Toolkit CollapsiblePanel control.It is required that you have ASP.NET AJAX Extensions installed to be able to run the sample code.

I'll not go through the presentation tips mentioned in Matt's post, I'll just show my technique to implement grouping idea with GridViews and CollapsiblePanel along with SqlDataSource which of course can be replaced with ObjectDataSource. I should mention that I'm using same style sheets provided in Matt's sample code along with images [View Demo]. More...

Building GridView With ASP.NET AJAX Enabled Control with Script#

by mosessaur| 20 February 2008| 9 Comments

Introduction:
I was thinking of building ASP.NET AJAX Supported controls inorder to practice both ASP.NET AJAX extensions as well as Script# tool.

Actually I liked the work done by Matt Berseth regarding ASP.NET AJAX very much. So I decided to use his ideas, convert them with Script# and add extra view things. So 99% of this post credit returns to him, I will just show how to use Script# and work around few things [Demo].

Original Reference:
I picked a control Matt built as GridView Extender (Behavior).And he provided few posts about and here they are:

Simply the idea is to improve the look and feel of the simple GridView with extra styles. For example when hover over a grid cell/row or when click on a row. The control was built as AJAX Extender also known as Behavior that can be applied on a GridView. More...



Applying localization From MasterPages

by mosessaur| 18 February 2008| 15 Comments

The scenario here is I want to apply localization to my web application and place language selection on MasterPage. I have made my own solution and applied this with assistance of cookies. View demo.

I'll demonstrate that in my sample. The sample has a MasterPage bellow is a snippet from its ASPX code:

   1: <form id="form1" runat="server">
   2:     <div>
   3:         <asp:DropDownList ID="cmbCulture" runat="server" AutoPostBack="True" 
   4:             OnSelectedIndexChanged="cmbCulture_SelectedIndexChanged">
   5:             <asp:ListItem Value="en-US">English</asp:ListItem>
   6:             <asp:ListItem Value="ar-EG">Arabic</asp:ListItem>
   7:             <asp:ListItem Value="de-DE">German</asp:ListItem>
   8:         </asp:DropDownList>        
   9:         <asp:ContentPlaceHolder ID="cph" runat="server"/>
  10:     </div>
  11: </form>

Simply when the user selects his language from the DropDownList the page post backs and change the language. More...

WebResourceAttribute And VB.NET, Not Like in C#!

by mosessaur| 17 February 2008| 0 Comments

Refering to my previous post "Working with System.Web.UI.WebResourceAttribute". During surfing in ASP.NET forums I noticed a question about this issue! and in the question it is mentioned that the way I descriped didn't work. I noticed also that the guy was using VB.NET not C# on which I was working on!!

The deference, or the issue came up because C# & VB.Net treat or compile resources in deferent ways -this is my own observation-. Return to the issue post on ASP.NET Forums to know what was exactly the problemand how it was resolved.

kick it on DotNetKicks.com