Tag | GridView Posts

Few days ago I downloaded Atlas Project and played around with it. I think its pretty neat although I have just touched the tip of the iceberg. I remember that some time back I wrote an article about Auto Suggest Using AJAX.NET Library. Now, with Atlas unleashed you can use its power to build the suggest functionality in minutes. I have already written an article about it which you can view at ATLAS AUTO-SUGGEST TEXTBOX. I hope you like it. powered by IMHO 1.3 ...
You might have already played around with the ObjectDataSource control and found out that you can send individual values to the class methods. You can also send the object itself to the class method. Take a look at the code below which sends the object filled with data being updated to the class method. User.cs: using System;using System.Data;using System.Configuration;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;u... System.Web.UI.WebControls.W... ...
I just saw the video tutorial of using the Atlas project with ASP.NET from Scott Guthrie. It is an awesome introduction to the Atlas Project. You can download the tutorial from the following link: http://weblogs.asp.net/scot... The tutorial explains how you can make a simple Task list application using ASP.NET 2.0 and add Atlas features to it. One of the cool things that Atlas introduces is the Update Panel control. You can simply place a server control inside the Update ...
Sometime back I developed a simple Export Button Control which can be used Export Datagrid to different formats. Now, you can download the control for free using the following link. Download Export Button Control. I hope you like it! powered by IMHO 1.3 ...
The XslTransform class has been deprecated in .NET 2.0 and replaced by the XslCompiledTransform class. The only difference seeems to be better performance and tighter default security settings (embedded scripting is disabled by default). There is an article on MSDN Migrating From the XslTransform Class that details the changes. I have a small sample that uses XSL to sort data in an XML docuemnt. The only change I had to make for 2.0 was replace the XslTransform declaration with XslCompiledTransform. ...
An interesting issue came up today that, although it now looks simple, did not have an immediately obvious solution. Specifically, what if you want to set properties of individual columns of a GridView at run-time (via C# code) rather than at design time in the aspx code. For example, let's say you want to set the DataFormatString property of a BoundField column. In short, it is a 2-part solution. First, you must positionally extract your column out of the GridView's Columns property while casting ...
The Object Data Source control is one of the best new features of ASP.NET 2.0. The ability to bind collections of Business Objects saves time and produces more elegant, less code-intensive solutions. Unfortunately, if your Business Objects contain child classes binding to Data Controls becomes more difficult. This article demonstrates a technique for sorting a GridView bound to a collection of Objects with a child class. You can download the complete solution here. I created two objects for this ...
Webhost4life server is down again and for that reason GridViewGuy and GridViewGuy forums are not running. Please be patient as the technical support team of Webhost4life resolve this issue. Thank you, GridViewGuy powered by IMHO 1.3 ...
Sometimes we are in a situation that we need a DropDownList inside the GridView control showing information about particular category. This means that DropDownList on row one of the GridView will contain different data than the one in row two. This is also refered as One to Many Relationship. Because a single category can have multiple products. I wrote an article about this scenario which can be viewed at the following link: DropDownList Inside GridView (One to Many Relationship) powered by IMHO ...
Here is the problem I was facing: I have a Checkbox TemplateControl column in a gridview. Lets say its at Column Index 0. Then, if gvRow is a row of the datagrid, I get the checked status of the row's checkbox by calling ((CheckBox)gvRow.Cells[0].C... I did some modifications to the gridview's underlying datasource and thats it... the checkbox's checked status was always false! Time taken to debug... 7 hrs! Reason/Solution The "modifications" responsible for this "buggy" situation ...
I am working on a project that required that each GridView row has one RadioButtonList. User can make a choice/selection from the list and when the button is clicked I will extract all the choices. The problem was that when the button was clicked, RadioButtonList forgots all the choices and returns the default values which was index 0 for all the rows. After spending some considerable amount of time on this problem I made the whole thing using dynamically creating the HTML and adding the RadioButtons ...
Whewww.. What a week.. Have just completed 3 exams (2 pro, 1 upgrade for MCSD). These have been the first exams where I have not really done any revision at all. When I first knew I was going to do them, I thought they would simply cover advanced topics (e.g. in the first exam covering forms, you get get asked which control should you use in a certain case, while in the pro version you would get asked about specific properties or advanced design features). Instead they covered more architectual issues, ...
Ahhhh its 2:00 AM and me little sleepy! Anyway someone asked me on the forums.gridviewguy.com that how can I deselect all the checkboxes in the gridview control when a single checkbox is unchecked. Offcourse this is very easy if you are using and want this functionality to happen when header checkbox is checked and unchecked. But the request was that when any checkbox in the GridView is unchecked it should disable all the checkboxes. Here is the code which does the same: <asp:GridView ID="GridView1" ...
I am sure that you all are familiar with Caching the page. If however you are interested that some portions of the page is not cached then you can make use of the Subsitution control which comes with ASP.NET 2.0. Simply, drag and drop the Subsitution control from the toolbox to the design view. Here is the HTML of the Subsitution control: <asp:Substitution ID="SubControl" runat="server" MethodName="GetDate" /> The GetDate method is a static method (The method that you provide in the MethodName ...
Menu controls in ASP.NET 2.0 are pretty cool. I wanted to display the menu horizontally with Sub Menus on some of the menu item and I was able to do this in few minutes. Check out the screen shot below to see what I am talking about: The code is also pretty straight forward. First thing you need is a Web.sitemap file which will contain the text and the url of the links that you will display on the menu control. Web.sitemap: <?xml version="1.0" encoding="UTF-8"?><si... <siteMapNode ...
Alright, I have a problem with the datagridview control and I'm hoping someone out there can shed some light on this. Also, please keep in mind that I'm doing this from memory right now so if I get anything wrong, I apologize in advance so please don't stomp on me! I have a custom data source (LLBLGen Pro collection, actually) that I am databinding to a datagridview (dgv) control in C#. Great. One of the columns in the dgv is a check box column. The cells in this column are bound to a bool attribute ...
Ok, at first it was mildly annoying...but now its a raging hemhroid on the butt of my application. I have these grid views...they have an update feature using a command button in the grid...you click edit, the cells turn to textboxes, you click Updated and the new data gets sent to the database. Unfortunately, nobody seems to be telling the gridview this, as it will still persist the OLD data! I've tried refreshing...nope...I've tried clicking edit/cancel...uh uh...for some reason, it just doesn't ...
Have you noticed that if paging is enabled on the GridView control and you have many checkboxes and you check few of the checkboxes that are contained in different pages then the next time you go to that page (I am talking about GridView pages i.e paging) all the checked values are gone. I wrote an article for www.aspalliance.com which demonstrate that how you can maintain the CheckBox values while paging. Check out the article: http://aspalliance.com/774 Hope you like it! powered by IMHO 1.3 ...

You can supply format strings to the columns in your GridView by setting the DataFormatString property of the column to something like this:  “{0:d}”.  However, you may have run across a case where you set this property and the system does not recognize the format string you provided.  To make this work, you need to set the HtmlEncode property of that column to “False”.  Then the DataFormatString will act as expected when displayed at run-time.

While teaching the ASP.NET 2.0 class (3201) in Baton Rouge, some questions about performance came up surrounding the new DataSource classes. I had actually meant to get all this testing done and posted by the middle of last week, so for those waiting to see these results, thanks very much for your patience. Altogether this became a fun little experiment, and more time consuming than I expected! I hope you find the results useful. To get started let's review the type of design-time fun we could have ...
Learning the new technology is always little hard. Check out my small non-technical article in which I explained how I learn the new technology. Please also make your suggestions. http://gridviewguy.com/Arti... powered by IMHO 1.3 ...
So I'm trying to get a DataGridViewColumn to display an icon for me. While implementing this is rather easy, I got stuck on the size of it. I was confused.... If you look at the size on the .ico it said 16x16, however, when I added it to my resources for the App I'm writing, it appeared to change it to 32x32. The result turned out that it showed in the data grid, however it was twice as large as I had wanted it, and dwarfed the text in the row next to it. I finally figured out how to change the size ...
GridView control has the EmptyDataTemplate which can be used to display any controls in case where GridView does not render anything. Since Header and Footer are not displayed when GridView does not contain anything thats why EmptyDataTemplate is a perfect place to display input controls so user can input data and populate the GridView control. powered by IMHO 1.3 ...
You all must be wondering where is GridViewGuy gone! Well I had my birthday on 9th Feb and my wife came from California to visit me. She came to Houston, TX for the first time so I was showing her Houston attractions. I will be back in GEEKY PROGRAMMING PHASE tomorrow. powered by IMHO 1.3 ...
In this post, I mentioned tearing my hear out because I couldn't get a gridview to work right with the update panel. Today I decided to just start on a fresh web form and everything seems to be working fine. I did learn that an updatepanel without any triggers will consume any server-side event that fires inside of it (ie, to get paging and sorting working you don't need to explicitly specify triggers to handle those events). I also learned that (and this isn't related to Atlas) a gridview's page ...
Ok, I'm about to have a nervous breakdown and need to post this, and then walk away for a bit. I have a gridview on a page, that looks like this: <asp:gridview id="gvTest" runat="server" allowpaging="true" allowsorting="true" autogeneratecolumns="false" pagesize="5" onpageindexchanging="gvTest... onrowcommand="gvTest_RowCom... onsorting="gvTest_Sorting" enablesortingandpagingcallb... <columns> <asp:boundfield datafield="Id" headertext="Id" sortexpression="Id" ...
Had this question posed from a friend in my last London post: What do you think of AJAX? Do you know of security concerns? Since you asked... Security concerns with AJAXAJAX is a very straightforward way to increase the dynamic feel of any site. But we're talking about Javascript calling almost directly into server-side code, so there are some big security concerns to be worried about with this architecture. What was once one door into the server, a URL to retrieve the web page, is now accompanied ...

In this article I will show you that how you can refresh the GridView control on the parent page from a pop up window. I will discuss different scenarios which you will find very helpful when implementing your solution.

Refresh GridView in Parent Page

USE TEST_DB--GRANT CONNECT ON ENDPOINT:: MyTestEndpoint TO "VS2005\tsdevel"SELECT * FROM ATableCREATE PROC ReadFromATableAS SELECT * FROM ATableEXEC ReadFromATableCREATE PROC InsertValuesInATable(@AValue int)AS INSERT INTO ATable (AField) VALUES (@AValue)EXEC InsertValuesInATable 123EXEC ReadFromATable--DROP ENDPOINT MyTestEndpointCREATE ENDPOINT MyTestEndpoint STATE = STARTEDAS HTTP( PATH = '/Testing', AUTHENTICATION = (INTEGRATED) , PORTS = (CLEAR), CLEAR_PORT = 81, SITE = 'localhost')FOR SOAP( ...
I was about to blog something about the Atlas UpdatePanel control, then, I saw a new reply to this post “UpdatePanel Question “ in asp.net forums. So, I decided to post a small thing about using the UpdatePanel control with GridView & DataSource control. Note: If you still do not know what Atlas is, I advice you to visit this link and download the December bits. UpdatePanel control is one of the most interesting Atlas server controls, I think it's gonna be “the most common” ...
Yesterday, I added a simply feature of my posts to the GridViewGuy forums. This feature will allow you to view your posts and keep track that if anyone has answered or not. Check out the GridViewGuy forums at www.forums.gridviewguy.com. powered by IMHO 1.3 ...
Wow! this weekened was really brutal. I worked all weekened on the forums and I am happy to say that GridViewGuy forums has been released. The forums are in BETA version (duhh!) so don't freak out if you see any bug. But offcourse when you find the bug please email me and tell me about it so I can fix it. You can visit the forums at www.forums.gridviewguy.com. come on start posting powered by IMHO 1.3 ...
Hey all, Today I'm the new blogger on the block (or should that be the blog?). Let me introduce myself. I am an Enterprise Architect working primarily on Microsoft technologies. I develop asp.net web applications, web services, business logic, data access... I also help architecturing solutions with BizTalk, SharePoint and other Business Solutions. I love the .net framework and the Visual Studio as an IDE and I continually seek to expand my skills in this area. However, I find that Microsoft doesn't ...
I wrote a detailed article which show that how you can use the DetailsView control with SQLDataSource control. To check out the complete article please click on the following link: http://gridviewguy.com/Arti... powered by IMHO 1.3 ...
My Daily Headache / dotNet 2.0 Web Services I have been developing with Visual Studio 2003 for a while and I recently convinced my company to purchase a MSDN Universal Subscription, which got me my hands on Visual Studio 2005. Granted I went to a few live events and already received a few copies of VS 2005 Beta 2, but never had the time to get around to testing, until now. My current project is to build a smart client application using FW 2.0 and secured web services w/ WSE 3.0 to a PKI (Public Key ...
For my first post, I’m going to revisit an article by AzamSharp which shows a simple approach to building GridViews with add/edit/update/delete functionality and offer some suggested improvements to make it even simpler! Read the original article here: http://geekswithblogs.net/A... The original interface supports adding rows through a set of controls in the footer of the GridView. Here is the original interface. While this is an excellent example of how ...
You can easily encrypt sections of web.config in ASP.NET 2.0. In the code below I have encrypted the ConnectionStrings section of web.config. Also check out the complete article which also includes writing into configuration files dynamically and reading configuration settings. Configuration config = WebConfigurationManager .OpenWebConfiguration(Reque... configSection = config.GetSection("connecti... (configSection.SectionInfor... ...

Now you are place your ads on www.gridviewguy.com. For more details please visit www.gridviewguy.com.

Thanks,

powered by IMHO 1.3

I have just uploaded a very simple Video Tutorial on www.gridviewguy.com. This tutorial is simply a test tutorial in which I talked about "GridView and CheckBoxes". Check it out and let me know. And yes, I know I sound very goofy powered by IMHO 1.3 ...
I recently wrote an article in which I discussed how you can perform In-Place Editing using ObjectDataSource control. You can check out my article at the following article: http://gridviewguy.com/Arti... powered by IMHO 1.3 ...
I recently published an article in which I described how you can do In-Place editing using GridView control with ObjectDataSource. You can view the complete article at the following link: http://gridviewguy.com/Arti... powered by IMHO 1.3 ...
I just added a subscription feature in www.gridviewguy.com (see the link on the left menu). Now you can subscribe to the latest articles and recieve an email whenever a new article is added to the website. Here is the direct link to the subscribtion page. http://gridviewguy.com/Subs... Thanks, powered by IMHO 1.3 ...
Sometimes we need to have checkboxes in the GridView control and we want that as soon as the Checkbox is clicked/checked the postback happens and we get the value from the first row in the GridView control. This can be easily done by using the following code: <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" OnRowCommand="GridView1_Row... <Columns> <asp:BoundField DataField="CategoryID" HeaderText="CategoryID" /> <asp:BoundField DataField="CategoryName" ...
Few days ago there was a question asked on www.asp.net forums that how can I export the whole GridView to Excel if the paging is enabled. I prepared this small example which shows how to achieve the task. Please note that this example is implemented in Visual Studio.NET 2005 Professional. using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;u... System.Web.UI.WebControls.W... ...
Next important part of Composite UI, if not the most significant, is the WorkItem. According to documentation it “a run-time container for components that are working together to fulfill a use case. These components may consist of SmartParts, controllers, services, UIElements, and other components.” So if we look at Outlook as example here, we have use cases like: browsing email, scheduling appointments or looking up contacts. As I understand, these would correspond to main WorkItems ...
Most of you already know this but the GridView Row_Deleting in certain conditions. 1) If you have a LinkButton or a Button control inside the GridView and the CommandName property of the LinkButton or the Button control is set to "Delete". 2) The Row_Deleting event is also fired because of the the Delete column of the Command Field type. You can simply add a new Command Field Delete column using smart tag feature. 3) Row_Command is fired whenever any event occurs inside the GridView control. powered ...
Before my current job, I was working as a programmer developing applications for education sector. My team consist of about 3 to 5 programmers working with the same or different projects. We used Issue Tracking System (ITS) to assign tasks and review reports, which is a very helpful tools to improve software development process. All the task, file, documentation, task history can be track back later. But to me, it is not just a productivity tool. It also act as a motivational tools to me as a programmer. ...
Not long ago I came across some cool demos showing new features in Windows Forms 2.0. Some of these show how to emulate look and feel of some well know applications (like MS Outlook, Money, Quicken, File Explorer or MSN Messenger). In particular I found there an interesting example of customizing the DataGridView control to implement multi-view schedule component emulating the Outlook Calendar. This sample supports rendering calendar events in day, week and month view. I think it would be quite interesting ...
Finally, YEAR 2005 is closed to end. A fresh start into the next year with new dreams and tasks. Year 2005 was very special year for me. Here are some highlights of what happened: 1) Went to California for the first time in January 2005 to meet the girl of my dreams. 2) Turned 24 years old in Febuary (This happens every year) 3) Got married in August 2005 (Although my wife is still in California doing her studies) 4) Got cell phone (I know this is pretty lame) 5) Passed Microsoft Certification Exam ...
If you are dealing with some data and you know that the GridView cell can be blank and you want to display some text instead of the blank cell then you can use the following code. <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" OnRowDataBound="GridView1_R... <Columns> <asp:BoundField DataField="CustomerID" HeaderText="CustomerID" /> <asp:BoundField DataField="Name" HeaderText="Name" /> <asp:TemplateField HeaderText="Test Column"> <ItemTemplate> ...