Tag | GridView Posts

So, on Christmas day I was just checked how to add some more cool effects to the GridView control using JQuery. In this post I will display parent-child data in the GridView control with some help of the wonderful JQuery library. Let's first populate the GridView control. private void BindData() { string connectionString = "Server=localhost;Database=... SqlConnection myConnection = new SqlConnection(connectionStr... SqlDataAdapter ad = new SqlDataAdapter("SELECT ...

I just published a new video on www.KoffeeKoder.com. In this video I will perform the edit, update, cancel and delete events on the GridView control.

Check out the video using the link below:

GridView Edit, Update, Cancel and Delete
Validating user input is a very common task that we perform during web page development, and in the ASP.NET world we have a handful amount of choices to perform validation. ASP.NET Validation Controls ASP.NET ships with a handful amount ASP.NET Validation controls such as RequiredFieldValidator, CompareValidator, RangeValidator, RegularExpressionValidator, CustomValidator and ValidationSummary. These controls are very easy to hook up with other ASP.NET controls, and if properly configured they check ...

I am starting a new screencast series for ADO.NET beginners. In this first part I will explain how to connect to the SQL SERVER database and populate a DataSet which is later displayed on the screen using the GridView control.

Creating Database Connection and Displaying Data Using DataSet

Just solved a problem, and wanted to document the solution. Problem: SharePoint MOSS 2007 Central Administrations site. Select Application Management --> InfoPath Forms Services --> Manage form templates. This runs the page _admin/ManageFormTemplates.... Response is the ever-helpful SharePoint screen: Error. Unknown Error. Thanks, guys. How do I turn on custom errors in SharePoint? And how do I get Manage form templates to work? Disclaimer: `No warrantees, express or implied, are granted with ...
When designing a web application we need to squeeze the performance out of our application in every possible way. Here are some tips on how to increase the performance of your web application. 1) Caching: This is on the top of the list. Caching when used wisely can increase the performance of the web application by more than 100%! Steven Smith is an expert in caching and has provided many articles and videos in which he showed how to use caching effectively. Check out this video on Caching on DNR ...
Well, I blogged about Visual Studio 2008 and have just started a series on Whats new in Visual Studio 2008 for Web Developers. However, I also wanted to write on ASP.NET 3.5 which is released along with .NET 3.5. ASP.NET 3.5 has the following key features Built-in ASP.NET AJAX - System.Web.Extensions has the version 3.5.0.0 and yes it can happily co-exist with ASP.NET AJAX 1.0 with System.Web.Exntesions version 1.0.61025.0 which works well with ASP.NET 2.0 List View Server Control a Databound control ...
Extension Methods is a new feature of the C# language (I think it is called C# 3.0). Extension methods allows you to extend the CLR types. This includes all the types which inherit from the System.Object class. Let's see a small example where I have extended a String to add a new "Reverse" method which gives me the string in reverse. public static string Reverse(this string s) { string r = String.Empty; for (int i = s.Length -1; i >= 0; i--) { r += s[i].ToString(); } return r; } I am using the ...
Well, most of the web developers today develop Enterprise Web Applications. While the challenge lies on different parameters like designing the different layers, transferring data between the different layers etc., let us examine how Visual Studio 2005 and ASP.NET 2.0 help you create Enterprise Web Applications quite easily. Designing your Data Layer The first step in designing your application would obviously be designing your database and I would leave that part entirely at your discretion. Once ...
I have talked about DLINQ and layering issue and I think SubSonic also suffers from the same problem. I used SubSonic during the long weekend and found out that it has rich entity class modal which also does the work of calling the DAL layer. Now, the question is that how can you make your class library portable. If you export your class library as a DLL you will also need to include the SubSonic.dll which is fine. But what if you want the users of your library to make use of your methods and NOT ...
I wanted to make two of 3.5 framework additions to work together. I decided to make a WCF Web Service and LINQ. I had a few pitfalls with the LINQ. So, I created it in SQL first, then I re-did it in using LINQ. Creating a WCF web service is fairly simple. Open the newest and greatest version of Visual Studio to date; VS 2008. File, New, Web Site and highlight WCF Service. Choose how you want it to work, meaning file system or point to a web; I choose file system and uploaded to my web site. After ...

I have just published a new video in which I demonstrated how to access the DropDownList contained inside the GridView control. You can view the video using the following link:

Accessing DropDownList Value Inside the GridView Control

One of the good practice while developing high performance web application is to reduce the database roundtrip as much as possible. In the current trend of web applications, its a very common to enable users to delete multiple items in a list user interface at a time. To perform this type of batch delete operation, one common mistake that happens by beginner developers are to calling the data access method repetitively for each item with in a loop as below: For Each row As GridViewRow In gvEmployees.Rows ...
I am looking for passionate people to write intermediate or advanced .NET articles. Your article will be published on www.koffeekoder.com and GridViewGuy. Here are the details:The article can be about ASP.NET, SQL SERVER, C#, JavaScript, WPF, Silverlight, WCF, WebServices and other .NET related technologies. We pay $10 - $15 per article through the paypal account. The rates will increase with the passage of time and the quality of the articles provided. This is a long term contract and the good author ...

I have just added Ajax enabled feedback features to www.koffeekoder.com website. Now, you can click the "Reply" button which will open a small window where you can submit a feedback. The window opens using a "FadeIn" effect using the JQuery  library. I hope you like this feature :)

Check out the demo below:

Well, that was a very strong statement but atleast DLINQ won the Weekly Poll. The poll started a week ago (duh weekly poll) in which I asked "Which ORM framework would you prefer?". The choices includes DLINQ, NHibernate, Active Record, SubSonic and few other ORM frameworks. DLINQ collected 48 votes while NHiberate was second with 36 votes. In case you are wondering where the poll was held, it was held on GridViewGuy. So, let's talk more about the results of the poll. Why DLINQ won? I think the main ...
Hey everyone, I am proud to announce the release of KoffeeKoder.com. The website hosts technical articles covering all aspects of the .NET framework. I hope the website will serve you as an informative source to further maximize your knowledge and skills. The appreciation I have gained through GridViewGuy.com over the years has enabled me to pursue my passion in ASP.Net developing and I hope to deliver the same level of professionalism in KoffeeKoder.com. Wake up and smell the code! www.koffeekoder.com ...
I have updated the SharpCacheSessionManager so now it includes creation time, expiration time and the file dependencies of the cached item. For those who are not familiar with SharpCacheSessionManager it is a HttpHandler to view the items/entries in the Cache, Session and Application objects. You can view the screen shot of the SharpCacheSessionManager in the image below: [Download SharpCacheSessionManager] ...
JQuery is a JavaScript library is created to make the life of JavaScript developers easy. Let's check out some of the cool features of the JQuery library. The $() function is one of the coolest features of JQuery. If you want to assign the click event to all the anchor tags on the page then you can simply do the following: $("a").click(function() { alert('The link is clicked'); }); If I am interested in a particular element then I can use the following code: $("link1").click(function() { alert('The ...

Dear All,

I was to a developer buddy of mine and he suggested that your site (www.gridviewguy.com) should be renamed to TheDotNetGuy since the website host articles NOT only about the GridView control. I already have the domain TheDotNetGuy and I think it will redirect you to the GridViewGuy. Do, you think it is a good idea? Keep in mind that the domain GridViewGuy will still be valid!

Thanks,

Azam

ASP.NET AJAX framework includes the System.Web.Script.Serializa... which helps to serialize the .NET object to a JSON representation string. I am using ASP.NET 2.0 callbacks to call the server side method using the client side code. // Create JSON String public void CreateJSONString() { StringBuilder sb = new StringBuilder(); Customer customer = new Customer(); customer.FirstName = "Mohammad"; customer.LastName = "Azam"; List<Customer> list = new List<Customer>(); list.Add(customer); ...

A new poll has been created on GridViewGuy. You can visit GridViewGuy and cast your vote.

A week ago I started a poll in which I asked "Which Ajax framework do you mostly use?" with the following choices: ASP.NET AJAX AJAX PRO Library Anthem.NET Plain XmlHttp Object The winner by a long margin was the MS ASP.NET AJAX. Surprising! not really. MS ASP.NET AJAX framework might not be the slickest framework in the market but without any doubt it is one of the easiest one to use. The real power lies in the UpdatePanel control which can update a portion of the page using client side postbacks. ...
In the days of asp.net 1.1 when using DataGrid and exporting to Excel i never came across this error since there was no master pages etc.. But at the same time having master pages makes life easier and at the same time some troubles. One of them is when using Ajax with GridView with a functionality to export to Excel. The error you get is "Control 'ctl00_ContentPlaceHolder1_... of type 'GridView' must be placed inside a form tag with runat=server" when clicking on your export button. After ...
Here is the first Screencast in flash. I hope you like it and I hope the video and audio quality is good. http://www.gridviewguy.com/... For those of you who like it I am willing to put together bunch of those but and big but... I will need a Flash SWF hosting server. So, if anyone knows a free hosting server that can host flash files and gives me direct link to the file then it will be super great. The above video is pretty large aprox 10MB. Also, I noted that in some ...
Following my earlier post, here is my first post on Dynamic Data Controls in ASP.NET "Futures" July 2007 CTP. Once you install ASP.NET "Futures" from http://www.asp.net/ajax/dow... (scroll down to the bottom and you would find the download link) you would get a set of new templates "ASP.NET Futures Website" and "Dynamic Data Website" when you select "File - New - Website" in Visual Studio 2005 or Visual Studio 2008 Beta 2. Once you select "Dynamic Data Website" template it creates a Dynamic Data ...

I am planning to begin a screencast section on GridViewGuy. I already have a videos section but I thought screencast will be more interactive as users does not have to download the video to watch it. If you would like to request a particular screen cast then please let me know and I will be more then happy to consider it.

Thanks,

The question up for voting is:

What features would you prefer in GridViewGuy?

Podcasts

More Videos

Live Consultation (Using Meebo Chat)

Visit GridViewGuy and cast your vote!

 


I created a table describing, which fields/elements I had to change when converted existing DataGrid to GridView . Mapping for some other elements can be found in the article here. asp:DataGrid asp:GridView Comment asp:TemplateColumn asp:TemplateField asp:BoundColumn asp:BoundField AlternatingItemStyle AlternatingRowStyle ItemStyle RowStyle or TableItemStyle DataGridItemEventArgs GridViewRowEventArgs ItemDataBound event RowDataBound not DataBound DataGridItemEventHandler ItemCreated event RowCreated ...
CSLA. A great product that does so many things so well. I won't expound upon how much I like it at the moment, but I always feel like I should say something positive about it before I point out something odd. I have a standard DataGridView in a WinForm application. I have a Root object (which children and grandchildren, although this isn't relevant). I am using a BindingSource for binding the two together. So, in my code, I have something like this: Now, this should seem like pretty boilerplate CSLA, ...
Someone asked me today:I have a text field and a drop down menu, based on the values of these 2 when i click on a button an api call is made to get the results. Now i want to display these results in a ListView using GridView. How can i use ObservableCollection to read the data when the search button is hit.My Short Reply: Creating an ObservableCollection is pretty straight forward.1. For example say we have class Customer { id, name, address }2. Now lets create a DataSrc that returns an ObservableCollection ...
I posted a tutorial on my favorite programming forum </dream.in.code>, and thought Id go ahead and share it on my blog as well. One question I get all the time in programming communities, always by young, new programmers, is how to work with web Services in .Net. It was these questions that lead me to writing the tutorial I posted on Dream.In.Code. I guess before you can show someone how to create and consume a Web Service, you need to ensure they know and understand what a Web Service actually ...
This is a thick (819 pg not including the index) "Training and Reference" book by Anne Boehm and Doug Lowe. If you are serious and especially if you are starting with only a little knowledge, going through this book and the examples from end to end will give you exposure for anything you might need to develop a website with .net. It does not assume that you even know any html and goes through the basics of web page life and server interactions. The book uses a shopping cart example and site to illustrate ...
In my previous post, I have shown the data binding capabilities of ListView control. In this post, I will show the Data Editing power of ListView. Like the previous DataGrid, DataList and GridView controls the ListView control has the EditItemTemplate and it also comes up with the long awaited InsertItemTemplate, in the past there was a lot of attempt to allow the users to insert data through Header or Footer Template which is no longer required. In this post I will show you the full data editing ...
MIX is over and this is the first of two posts covering the final day. I am currently on the train home with my lappy in power saving mode, minimum CPU etc etc. 1.5 hours left so I should get enough time to say what needs to be said! Today I decided instead of going the main stream route all the way I would slip off to a smaller session. After a chat with Scott Guthrie (!) I decided to miss the first of his two part session on VS 2008 and asp.net 3.5, I read most of the content on his blog and have ...
One of the common ways I've seen for any kind of "export to Excel" feature on websites is to output to a hidden DataGrid or GridView, and then rendering the contents of the GridView to the response stream, naming it with a .XLS extension. This has a series of problems, not the least of which is the "This file has contents that do not match the file extension" error dialog presented when you open the file in Excel. One of the cool tools I've found recently is called "ExcelXmlWriter" hosted and produced ...
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
        {
            //Set the focus to control on the edited row
            GridView1.Rows[e.NewEditIndex].FindControl("txtEdit").Focus();
        }
In my previous post, I have presented few cool css examples of the new Asp.net ListView control. In this post, I will show how you can setup the data binding of the ListView control with the new LinqDataSource control as well as through code, which outputs the previous post examples. Like its ancestor, the ListView comes up with few templates and some of them are really new. In order to bind data we first have to define the LayoutTemplate. The LayoutTemplate is a new template that acts as a container ...
"Such and Such a grid should not be blank when there is no data, it should show the column headers with no rows." How many times have you heard that? Yeah, I've seen it as bugs in the change request system!! Seems like a simple enough request, but trying to deliver it sends you straight into the land of GridView hacking. Oh why was such a simple feature not incorporated into the GridView. Microsoft are you listening. Instead you have to jump hoops. Here are some of those hoops that help you solve ...
While working with AJAX we can make the web page more interactive by introducing the Fade behavior, and we can also introduce the provision of cancellation of async AJAX operation. This is how we can leverage on usability aspect of the application. Matt Berseth has posted a nice article to acheive this behaviour through ASP.Net AJAX, following is the source code. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %> <%@ Register Assembly="AjaxControlToolkit" ...
The remote server returned an error: (407) Proxy Authentication Required. This is a very common error message when you try to get a resource on internet through your application. Why you getting this error from your application not from explorer. The reason is very simple either you use LAN that requires proxy setting or you use proxy server. Example : DataSet myds = new DataSet(); //Set the system proxy with valid server address or IP and port. System.Net.WebProxy pry = new System.Net.WebProxy("172.16... ...
While I have been writing a lot about ASP.NET AJAX and other stuff, I also wanted to keep adding my little nuggets on ASP.NET 2.0 which is one of the favourite platform for Web Development. While working with ASP.NET 2.0 and Visual Studio 2005, you may not know certain new things which are a part of it and usually go unnoticed. Atleast I missed them and after a year, completing a big application realized that it would have been great if I had used these features. So, here it is, 10 things you might ...
I have just started a new Project in CodePlex AjaxDataControls. I am planning to include GridView, DataList, Repeater, DetailsView, FormView and ObjectDataSource in the initial release. Since the Asp.net version of these controls does not have any object model in the client side as those were released long before Ajax framework, currently the only choice available working with this controls is to surround these controls in an UpdatePanel. UpdatePanel is a great option for developing Small/Mid size ...
My recent article "ASP.NET Ajax Grid and Pager" has been published in DotNetSlackers.com. A fully designer supported Ajax Control, which mimics the GridView Control in client side. Please vote for me if you find it useful ...
Well, I havent talked much about Windows Live and when the whole world is keen about our Live initiative and the exciting bunch of services we have unveiled, I thought of starting it up, with an article on how you can consume the Live Search API and implement Live Search within your web applications. Before getting started, there are a few things you would need to know about Live. Windows Live is a platform. It is a collection of online services which can be utilized as well as programmed against. ...
I have an interface IEntity that all my state objects like Client, Vehicle, Route etc implement. I am creating a control with a DataGridView that will display information about a list of state objects. The control expects an IEntity object, but since IEntity only defines methods, nothing is displayed on the DGV when I bind it to List<IEntity>, even though I can see the .DataSource is properly set when I view it in the debugger. I need to cast my object back to it's original type, so it's properties ...
A new version has been released and it includes many bug fixes and lots missing functionality implementation mainly with in the DataGridView control. There are also lots of new features that had been requested by developers including redirecting, clipboard support, Invoking client side scripts, Calendar first day support, ListView auto resize and more. The DataGridView control has been added many missing implementations including selection management and events, deleting rows, resizing columns and ...
I uploaded this new article in the Unedited Section of CodeProject. AbstractThis article describes how we can use XML as a metadata source for SCG Templates. It also shows step-by-step instructions of how to generate strongly typed objects from XSD and use it in the templates to generate text based output. ASP.NET developers can also use this paper as reference to transform XML using ASP.NET scripts and avoid XSLT. Introduction We all agree that XML's primary purpose is to facilitate the sharing ...
Built-in Layout We have talked about the templates for the following data-bound controls 1. GridView 2. DataList 3. Repeater 4. DetailsView 5. FormView When the data-bound controls are finally rendered as html tags to the user’s browser, they have different built-in layout. Knowing this help us make decision of what control to use for certain requirement. The final default html for each of these controls is a HTML table, but with different rows and columns. Sometimes the table has border, sometimes ...
Data-Bound Controls (1) - Templates In ASP.NET 2.0, the following controls are often used to do data binding. 1. GridView 2. DataList 3. Repeater 4. DetailsView 5. FormView GridView, DataList and Repeater are for displaying multiple records once, but DetailsView and FormView are for one record one time. In addition, to decide which control to use, we’d better understand what templates every control supports and what is the built-in layout for every control. Templates Templates are usually for defining ...