Tag | GridView Posts

I have a page with UpdatePanel and ASP:Timer, that refreshs the UpdatePanel every minute. It was noticed that after new release after the first refresh any postback causes "Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster." I've searched Google and found that this error is quite common. Below there are just a few suggestions: I do ...
Few days ago I received an email from a reader asking how to access the value of the control contained inside the EmptyDataTemplate of the GridView control. As, you might already know that EmptyDataTemplate is used when there are no records to display. Sometimes you want to give the user an option to add a new item by providing controls inside the EmptyDataTemplate. <asp:GridView ID="gvCategories" AutoGenerateColumns="false" runat="server" onrowcommand="gvCategories_... > <EmptyDataTemplate> ...
protected void gvArtist_RowCommand(object sender, GridViewCommandEventArgs e) { int intUserGridID=0; if (e.CommandName == AdminConstantKeys.ViewGigsC... { int intHeaderMasterID = -1; GridViewRow grArtist = ((Control) (e.CommandSource)).NamingCo... as GridViewRow; //Check if command raised by DataRow or not if (grArtist.RowIndex != -1) { intUserGridID = int.Parse(gvArtist.DataKeys... [AdminConstantKeys.UserID].... Session[AdminConstantKeys.G... ...
If you're near Columbia, SC tomorrow be sure to drop in to catch Karl Shifflett's presentation on Mole Visualizer! Here's the information on the meeting! Topic – Mole Visualizer for Visual Studio The Mole Visualizer For Visual Studio has taken the developer community by storm. It has been written up on major developer blogs all over the world including several at Microsoft. It has been downloaded by tens of thousands of developers worldwide. This session will cover using Mole on WPF, WinForms, ASP.NET, ...
I was working a SPDataGridView Webpart today. I was trying to get the grid to refresh and re-bind itself after a specific client was deleted in the web part. When I tried to clear the grid it would not clear at all. It would refresh with the exact same data, until I hit F5 on Internet Explorer. I finally thought to myself what if I get rid of the Dataview as a source and call the DataSet directly. Sure enough I change it and clear the DataSet, then rebind and grid and when I delete the client it ...
In Part 2 of this series, we created an ADO.NET Data Services that made the Northwind data available. In today's blog post we are going to talk about how to consume the Northwind service. You can interact with an ADO.NET data service from any application that can send an HTTP request to an ADO.NET data service URI, and that can process the response in the format that is returned from the data service. To demonstrate this, we will create an ASP.NET web site to displayed the data retrieved from our ...
The Rockville .NET User Group (RockNUG) will be holding their next meeting on Wednesday, March 12th, 2008 from 6:30PM-9:00PM. This month, they'll be having a pretty interesting topic on refactoring in C# with Jonathan Cogley. I've had my refactoring and agile boots on lately, so I can definitely relate. I don't know what I would do though without my Resharper 4.0 Nightly Builds... I've had a few issues here and there, but nothing to discourage me from continuing usage. Anyhow, here are the details: ...
Security trimming is a feature which allows you to hide the urls based on the roles. This mean you can have a single web.sitemap file which contains all the urls of the website. The urls will be served to the users based on the roles. A common place where security trimming is used is when you want to display a menu based on the user role. To get started with sitemap and security trimming check out the following post: http://geekswithblogs.net/a... Now, sometimes ...
So, I decided to put my custom GridView in a AJAX UpdatePanel. This was my first serious exposure to AJAX (asp.net). I discovered that I was having major problems. I kept getting an "unspecified error". Because it occurred whenever I clicked on a row, I assumed it had to do with the JavaScript I wrote for the GridView. I did tons of web searching about how to properly use script in a controlled wrapped in an update panel. I tried a few things, including embedding the script and registering the script ...

I just posted an update on the article "Drag and Drop Using JQuery With Persistence". Now, you will be able to refresh the UI when any new users comes to the room. There were few gotchas associated with this implementation so be sure to check out the article.

A few nights ago I decided to work on a custom GridView. My goal (derived from a customer request) was to build some additional behavior into the GridView without having to write a whole bunch of client-side or code-behind code. These are the things that I am focusing on: Select a row when the user clicks on it (no CheckBox) Allow the user to select multiple rows (using Shift and Ctrl keys) Bind display settings to site preferences Column header text Bind display settings to user preferences Columns ...
I recently posted a video on www.gridviewguy.com in which I talked about LINQ TO SQL INNER AND LEFT OUTER JOINS. The fun thing about this video is that I tackled the problem from both sides. This means first the query is created using pure T-SQL and then then it is generated using LINQ TO SQL. Check out the video using the link below: Video ...
I found a few articles , that try to create multi-row gridview Header http://forums.asp.net/p/105... http://blogs.msdn.com/mattd... All solutions suggest to create extra DataViewRow(s) of a type DataControlRowType.Header on RowDataBound event. However on Postback DataBind usually is not called, and so RowDataBound event will not occur. It means that the second header will not be recreated on Postback -not good. Discussion GridView - trouble with double ...

No no not me! GridViewGuy, the website. Man! this interface designing is pretty darn hard. Took me a while to complete the makeover and still it has few glitches. Anyway, I think it is much cleaner than before. Also, the logo is quite funny check it out at www.gridviewguy.com.

When user clicks GridViewRow Edit, depending on the data in the GridViewRow, enable/disable column(s) Protected Sub GridView1_RowDataBound(ByVal sender As System.Object, ByVal e As System.Web.UI.WebControls.G... Handles GridView1.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then Dim Offline_MediaId As Integer = Integer.Parse(e.Row.Cells(1... If Offline_MediaId > 4 Then 'Dim textBox As TextBox = CType(e.Row.FindControl("tx... TextBox) 'textBox.Enabled ...
I've tried to set Gridview HyperLinkField Header text to some value using DataBinding <%# Eval("Rating") %> ,but it caused error: 'Gridview :Databinding expressions are only supported on objects that have a DataBinding event. System.Web.UI.WebControls.H... does not have a DataBinding event. I had to assign Gridview HyperLinkField Header programmatically using RowDataBound event handler ...

I have just published a new article on www.GridViewGuy.com in which I talked about how to find out if the user's browser support JavaScript. You can take a look at the article using the link below:

Find Out If JavaScript Is Enabled On User's Browser

So, I learned something new yesterday. I haven't spent a lot of time in ASPX over the last couple of years, and when I did I didn't really pay attention to what is new. Well, I learned about the nifty DataSourceControl classes. In my case, I decided to use the LinqDataSource control. And I put it to use on a nested GridView with Paging I struggled for more hours than I care to admit to accomplish what I wanted. In the end, I was pleased at just how little code was required. Check out my full article ...

I have just published a new article "Drag And Drop With Persistence Using JQuery" in which I explained how to drag and drop users to the drop zone. The data is also persisted in the database.

I hope you enjoy the article!

A reference to the GridView can be obtained by using gridViewRow.Parent.Parent or (GridView) gridViewRow.NamingContainer... from here). So I've created the static function: public static GridView GetParentGridView(GridViewRow row) { //NOTE row.Parent doesn't return GridView GridView gridView = (GridView)row.NamingContainer; return gridView; } ...

If you are attempting to give your business more exposure and substantial revenue, we at GridvewGuy are willing to help!
GridviewGuy is looking for people who would like to advertise their business on this fast growing website with over a million page viewers every month.

Advertise on GridViewGuy

Drag and drop support in a web application always get some attention. I used drag and drop support in one of my applications and I have to admit that it involved a lot of JavaScript code. You can check out the article "Browser Compatible Drag and Drop Shopping Cart". Today I had to create the same drag and drop approach so I decided to check out the drag and drop API's of the JQuery library. I have to admit that JQuery is one of the best JavaScript library that exists today. I can go on and on with ...
A few days ago while working on a project I had a requirement to display the GridView control with one of the columns as a hyperlink column. The AutoGenerateColumns must be set to true since the columns of the GridView were not fixed. Here is the code I used to create links inside the GridView as well as the Datagrid control. <h3>GridView</h3> <asp:GridView ID="gvCategories" runat="server" onrowdatabound="gvCategorie... </asp:GridView> <br /> <br /> ...
I have been pretty busy lately. But anyway here is the list of my upcoming articles on GridViewGuy. I will update the links when the articles are published. 1) Unit Testing Membership and Role Providers in ASP.NET 2.0 2) URL Rewriting Using ASP.NET MVC Framework 3) Dynamic Data Support in ASP.NET 3.5 Framework 4) Extension Methods 5) Using Cache Attribute to Cache Methods Stay tuned on www.gridviewguy.com :) ...

I just published a new video on www.gridviewguy.com. In this video I demonstrates how to get started with the LINQ framework. Check it out using the link below:

http://www.gridviewguy.com/ArticleDetails.aspx?articleID=378_Introduction_to_LINQ

I am reading this awesome book "Building a Web 2.0 Portal with ASP.NET 3.5" by Omar Al Zabir. Omar talks about caching the Ajax requests on the browser cache. This will improve the performance since the request will be handled directly from the browser cache without contacting the server. Let's take a very simple example. Let's say you have a DropDownList which displays the categories .When the user selects the categories you display all the products in that category. You are making an Ajax call ...
I just published three new videos on www.GridViewGuy.com. Check out the links below: Adding Multiple Rows to the GridView Control Anonymous Types in the .NET Framework Object and Collection Initializers I hope you enjoy the videos ...
DLINQ stands for Data Language Integrated Query allows you to quickly create entity classes and relationships using your database schema. Not only that but DLINQ provides very useful methods when persisting the data into the database. You can create the relationships using the designer. The designer will write all the code for you. Finally, when you need to persist the object into the database you call few methods and DLINQ takes care of the rest. DLINQ is designed with RAD (Rapid Application Development) ...

I just published a new article "Adding Multiple Rows in the GridView Control". I hope you enjoy it!

Yesterday, I received an email from a user who wanted to know how to add multiple rows to the GridView control. This means that you can add any number of rows using the "Add" button and the rows will append at the end of the GridView control. Let's first populate the GridView control. private void BindData() { NorthwindDataContext northwind = new NorthwindDataContext(); gvReport.DataSource = GetProducts(); gvReport.DataBind(); } private List<Product> GetProducts() { NorthwindDataContext northwind ...
Long time ago I posted an article "Creating an Online Exam Using LINQ to SQL Classes Part 1" in which I explained how to get started with creating a very simple online exam. I just posted the Part 2 of the article which covers unit testing of the application ...
This is also from an internal mail to SilverKey Tech Egypt office dev. team. Slightly modified this time! (Yes, I know. I should stop this habit of link collection and get back to writing - hopefully soon) Joe On .NET - Windows Workflow Foundation Tutorial Series SourceMaking (Design Patterns, Antipatterns, Refactoring) Brennan’s Blog » Blog Archive » Intellisense for jQuery in Visual Studio 2008 Happy Coding: OOP and FOOP Linq to SQL DataContext Lifetime Management - Rick Strahl's Web Log Dan Driscoll's ...
Introduction: This article describes on how to create a data access architecture using sqlclient objects that will returns a DataTable. It also discusses here on how to use and access a certain method in a particular class for you to manipulate the data into your codes. Please note that I am using the Northwind database here and all the codes in this article are written in C# language. STEP1: Adding a Class First, I added some folders under my App_Code folder to store some classes. This class includes ...

I just published an article "Getting Started with the ASP.NET MVC Framework". The article explains the MVC framework using a real world scenario. I am sure you will like the article.

Today, I played around with the new ASP.NET MVC Framework. I have to admit it is quite intriguing. I created a small application in which the user can select a particular category and view all the articles related to that category. When the user clicks on a particular article the application redirect the user to the appropriate article. The first thing is to create a CategoriesController which managers the categories. Here is the implementation. public class CategoriesController : Controller { [ControllerAction] ...
In the earlier post, we saw the "Dynamic Data Website" shipped with ASP.NET 3.5 Extensions Preview that can be used for rapid application development of data driven websites using Visual Studio 2008. The ASP.NET 3.5 Extensions Preview can be installed from here Once you install the same, you get a few things. One, is that you get the 'Dynamic Data Website' template I talked about earlier. The other thing is that you get the "ASP.NET 3.5 Extensions Website" template that allows you to create an ASP.NET ...
Earlier I had blogged about ASP.NET 3.5 Extensions Preview and also the Dynamic Data Controls and how ASP.NET would be evolving into a comprehensive platform for rapid applicaiton development of Data Driven Websites. While the earlier preview I talked about (Dynamic Data Controls) was a part of the ASP.NET "Futures" CTP, there is now a much better build of the Dynamic Data Controls which we shipped as a part of ASP.NET 3.5 Extensions Preview. Simply putting, we would encourage you to try out the ...
Note: This is ported from my old weblog. Originally published June 22, 2006 First, I assume here that you know themes and read about them, but are a bit afraid or unfamiliar with using them. If you don't know what are Themes and skins in ASP.NET 2.0, check their section on MSDN as well as this great article (another one). Do you know that... Do you know that you can provide intellisense to skin files in VS2005? Simply go to Tools menu, click Options, and from the tree in the left, expand the node ...
Note: This is ported from my old weblog. Originally published December 19, 2005 This is a well commented example for a GridView with implementation of RowDataBound and DataBound events. I also demonstrate in it some of the important properties of GridView, like the slight diffrences when dealing with Grid Paging, Rows, Cells, and Columns. I prefered to heavily comment the code than to write separate paragraphs describing it as I do believe that the code is what gets the idea in a direct way. The ...
Jeff Prosise wrote a very interesting article in which he demonstrated how to rewrite URL using RewritePath method. In this post I will be using the same method to rewrite the article URLS. Good URL names can result in more traffic to the website since the URL's are index by the search engines. Let's say your website has the following Url: http://www.mywebsite.com/Ar... Although it works and performs the required option but it is very hard for the search engines to index the page ...
Dynamic Website Project allows you to create customizable support pages. This can be really helpful if part of your job is to create boring support pages. Recently, I had to create few support pages so I thought why not try the Dynamic Website Project. So, I added the LINQ to SQL as the data source and used one of the databases to create the support pages. In our application whenever a row in the database is updated we update the DateModified field. This can easily be performed inside the GridView_RowUpdating ...
I just published a new podcast on www.GridViewGuy and www.KoffeeKoder.com. In the podcast I discuss how to unit test your ASP.NET pages using different frameworks including NUnitASP, Watir and WatiN. Check out the link below: Unit Testing ASP.NET Pages I am facing some problems while downloading the podcast. I currently use MediaMax which only allows 5GB download per month. If you are aware of a better and more reliable online FREE storage then please let me know ...
GridView! YES! (...1 hour passes...) Dah! GridView! *Fist Shaking* Coming from a Java background I have to say that the standard toolset that Microsoft provides in .NET 3.5 is impressive by any standard. Perhaps the fact that it is standard is what makes it so powerful.... That being said I want to just give a quick rundown illustrating the rollercoaster ride that was my first run in with GridView from .NET 2.0. I first wanted to just populate a table, after a quick googling I landed here: http://msdn.microsoft.com/m... ...
Related Post: Talent vs Attitude – Harsha Bhogle Association, Aggregation, Composition object relationship What we can learn from Babies ASP.NET 2.0 Interview Questions 1. What is the name of the property of ASP.NET page that you can query to determine that a ASP.NET page is being requested not data being submitted to web server? A. FirstGet B. Initialized C. IncludesData D. IsPostBack IsPostBack 2. While creating a Web site with the help of Visual Studio 2005 on a remote computer that does not have ...

 In this video I will demonstrate how to create DropDownList dependency. The DropDownLists will be contained inside the GridView control. You can check out the video using the following link:

Implementing DropDownList Dependency Inside the GridView Control

 

Enjoy!

Some of you might now know but there are over 50 videos hosted on GridViewGuy. The videos target the different technologies associated with the .NET framework. The videos are in different formats i.e some are WMV files, Flash files and downloadable files. I hope you enjoy these videos and if you have a good idea for a new video then comment on this post and I will try my best to create that video :) GridView Parent-Child Relationship Using Ajax & JQuery GridView Edit, Update, Cancel and Delete ...
I have generally avoided the databound controls provided by the .NET framework. I am referring specifically to controls such as the GridView. Oh don't get me wrong, I use the GridView like I use oxygen. I just don't use an associated DataSource control. Utlimately, therefore, I manually bind controls to data. There are three main reasons I have opted to avoid databound Distributed Applications - Most of the business applications I design incorporate a business layer so it is rare that I bind directly ...
Now, this is freaking awesome. Testing your ASP.NET pages using Ruby code. I used to test my ASP.NET pages using NUnitASP which was pretty decent. But, I am not sure what happened after I installed VS 2008 the NUnitASP simply stopped working. Anyway, I needed a tool to test my ASP.NET pages. These pages typically include DropDownList, TextBoxes, Checkboxes and stuff. If you had to test them manually then it would take you a long time plus it is really boring. So, I came across this interesting post ...
Few weeks back I added a "Donation" link on www.KoffeeKoder.com and I also blogged about it "Helping the less fortunate". Today, I added few donation links on www.GridViewGuy.com. Through donations, these bright students can chase their dreams and become what they want to be ...

I just published a new video in which I demonstrate how to create a GridView Parent-Child Relationship Using JavaScript, JQuery and Ajax.

Enjoy!