Popup Master-Detail using GridView, DetailsView and JQuery with jqModal

by mosessaur| 08 May 2008| 34 Comments

Introduction:
Last month Matt Berseth posted very good post about how to build Master-Detail with the GridView, DetailsView and ModalPopup Controls. Today I'm going to clone his post and build the same feature using jQuery with jQuery Plugins; one for popup windows jqModal& and the other is for Color Animation. You can view a demo of this sample here [View Demo].

Prerequisites:
Because I'm using some design tips and styles posted in Matt's posts, I recommend to return to his original posts regarding styling and UI enhancement. I used the styles and design shown on his post Building a VS2008 Styled Grid with the GridView Control.

In my sample I'm using UpdatePanel, and used a client side technique to update the UpdatePanel. To read and review more about this technique please read Dave's post Easily refresh an UpdatePanel, using JavaScript.

It is important also to review documentation of jqModalas I'm not going to explain its APIs.

Implementation:
To make a long story short, I just modified Matt's sample and replaced ModalPopup control of AJAX Control Toolkit with jqModal. Also Matt used to indicate the updated row by setting a style sheet class to the updated row for certain period of time then remove it to make it look as before. I did the same, but I used some kind of animation provided by Color Animationplugin for jQuery.

MProduct Detail Modal Popup  Product List after Update with Indicator

More...




GridView Grouping Master/Detail Drill Down using AJAX and jQuery

by mosessaur| 19 April 2008| 93 Comments

Introduction:
Last month I posted about Building a grouping Grid with GridView and JQuery. And I got feedbacks about how to do the same thing using AJAX (on demand retrieving of detail data). In fact I was thinking of that too, and I had couple of ideas in mind. One of them it to use nested update panels, or use AJAX Data Controls with page method/web service method calls along with ASP.NET AJAX. You can view the [demo here].

I didn't like the nested update panel idea, although it is the easiest I think. And was started to think about the second idea but I was about to check another way other than ASP.NET AJAX as long as I'm using jQuery. So I was thinking of using jQuery AJAX. That was just after reading Dave Ward's post Using jQuery to consume ASP.NET JSON Web Services.

GridViewDrillDownJQueryAjax00  GridViewDrillDownJQueryAjax01

More...

GridView jQuery Plugin Row MouseOver And Click Styles

by mosessaur| 30 March 2008| 1 Comments

Last year on October, Matt Berseth wrote few posts about improving styles of GridView, these posts are the following:

Last month, I posted a revised version of his work using Script#. And in this post I'm going to show that same features can be applied using jQuery. And I was really amazed by the simplicty and less of code that I had to write to get the same feature on hand.

I've implemented this using jQuery plugins. So I had to author a plugin and I can call it very simple one as the idea was already done and I had it on my head. I'm not going to explore how jQuery plugins can be authored, but you can return to the following links:

You can view demos here [demo 1] & [demo 2]. I will start from the end, on how to use the plugin. Actually it is very simple, all you need to do is to add this JavaScript line to your code when the page, or as a startup script. I did that using onLoad event of the ASP.NET AJAX Application as I have ScriptManager installed on the page:

$(selector).gridviewex(options);

For example:

<script type="text/javascript">
function pageLoad(s,e)
{
    $('#gvProducts').gridviewex({hasPageRow:true,dataRowClass:'row',altDataRowClass:'altrow',
                                rowHoverClass:'rowhover', rowSelectClass:'rowselect',
                                cellHoverClass:'cellhover',cellSelectClass:'cellselect',
                                columnHoverClass:'columnhover'});
}
</script>
This will initialize the GridView with the style needed. It worth to mention that you can use this plugin with any Table based HTML.

gridviewjqueryplugin00 gridviewjqueryplugin01

More...

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...


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...

Tip: Generating Local Resource Files

by mosessaur| 17 February 2008| 1 Comments

As I was working on multingual User Interface project; it was needed to generate resource files for all aspx & ascx files.
I knew that VS.NET 2005 has a local resource file generator. But it was weird when I select my ASPX page or user control and go to Tool menu and find that there are no Generate Local Resources command on the menu!

It didn't take so much time, I found the solution on ASP.NET Forums. It was simple: "he menu 'Tools > Generate Local Resources' is available when you display an aspx page or ascx". Also you must switch to design veiw before you Generate your local resources.

kick it on DotNetKicks.com