.Net, Ajax, ASP.NET, Checkbox, Dialog, GridView, JavaScript, JQuery, Programming, VB.NET, Web Development, WebForms

Use a JQuery Modal Form Dialog to Add Rows to a GridView Control

JQuery Form Dialog with GridView
JQuery Form Dialog with GridView

Hooking up a JQuery Form Dialog Widget to an ASP.NET GridView Control

Let’s face it: the stock ASP.NET GridView control has some behaviors and limitations that aren’t exactly optimal. For starters, the lack of a nice way for users to add new rows to the grid is unfortunate. There are, of course, several different work-arounds for this all of which have their pros and cons.

I have been testing out using the JQuery Modal Form dialog widget as an input mechanism for new GridView rows. This has the benefit of not requiring the use of ASP.NET’s heavyweight ViewState and constant back and forth communication with the Web Server. Also, the modal nature of the widget on the Web form is a benefit.

The obvious drawback of using client side code is that the newly added rows are not stored in ViewState and you will need to handle them yourself. This really isn’t a big deal if you consider using Ajax calls to a Web Service rather than a complete form submission.

Continue reading “Use a JQuery Modal Form Dialog to Add Rows to a GridView Control”

.Net, ASP.NET, Checkbox, Dialog, GridView, JavaScript, JQuery, Programming, Web Development

Using a JQuery Modal Dialog with Checkboxes in an ASP.NET GridView

GridView with a JQuery Dialog
GridView with a JQuery Dialog

Recently I wanted to use the stock JQuery UI modal dialog confirmation widget with an ASP.NET GridView control. The image above shows the basic setup that I wanted the GridView to have.

As you can see, the grid should have several data columns followed by a column containing Checkboxes. The JQuery dialog should be triggered by the click event of each Checkbox. When the user clicks on a Checkbox in the GridView, the JQuery dialog should appear only if a Checkbox has already been selected. Furthermore, the user should be given two buttons as actions. The OK button will allow the check to happen, but the Cancel button will undo the check of the Checkbox.

Continue reading “Using a JQuery Modal Dialog with Checkboxes in an ASP.NET GridView”

.Net, ASP.NET, Checkbox, Programming, RadioButtonList, VB.NET, Web Development, WebForms

RadioButtonList Binding Overview for ASP.NET WebForms

RadioButtonList in ASP.NET
RadioButtonList in ASP.NET

The RadioButtonList control is situationally useful. Although I don’t find myself using it often, when I do need it, I have to look up the basic functionality and how to apply it. This has led me to write this article as a guide and a code-reference.

Set up the WebForm

For starters, drag and drop a DataSource onto your Web form. In my case I will use a SQLDataSource and I will populate its Select, Update, and Delete commands with stored procedures I have created. My goal is to create a  RadioButtonList  that lists saved default searches for a user and to add a LinkButton control to use as a general delete button.

The following snippet illustrates adding the SQLDataSource:

Continue reading “RadioButtonList Binding Overview for ASP.NET WebForms”