Tag | GridView Posts

I will explain how to develop a simple application in ASP.NET using a three-tier architecture. The presentation tier The business tier The data tier Concepts: The presentation tier contains the UI (User Interface) elements of the site, and includes all the logic that manages the interaction between the visitor and the client’s business. (ASP.NET Web Forms,Web User Controls,ASP.NET Master Pages) The business tier receives requests from the presentation tier and returns a result to the presentation ...
About a year ago, I started to evaluate ASP.Net MVC, but decided to put it aside because it was still in heavy-duty development. With the official release a couple of weeks ago, I decided to check it out once again. MVC has a lot of things to offer, but there are a few critical things that we couldn’t overlook. We have a few web applications that all have quite a lot invested in server controls (both third-party and developed in-house). In ASP.Net WebForms, for something as simple as a GridView with ...
The Visual WebGui Rich Internet Applications Platform version 6.3.6 was released yesterday. This version includes implemented support for Microsoft Silverlight 3.0 beta presentation layer and is the latest and most stable Visual WebGui 6.3.x version This is the change log for version 6.3.6 Breaking Changes ---------------------------... VWGS-4192 - Support Microsoft Silverlight 3.0 Beta. Previous versions of Microsoft Silverlight are ...
Note: view the updated entry below: http://www.codeasp.net/arti... C# DataGridView control with custom collection in Windows Forms This is a brief quick tutorial on how to use Windows DataGridView control in your windows forms based applications with custom collections in C# or VB.NET ...
Hi Everyone,

I have successfully moved all the content from GridViewGuy to HighOnCoding. Please update your links and subscribe to the HighOnCoding RSS feeds. I have also added 78 more videos to HighOnCoding and many new Podcasts. I hope you enjoy the website.

Thanks!
Azam
FileStream data type is a very important feature of SQL Server 2008 and gradually getting popular amongst developer for it’s feasibility. And in the past few days specially after “Configure SQL Server 2008 for File Stream” post. I received several feedbacks regarding the usage of FileStream with Ado.net and Frankly there is not much stuff available on Google for this topic. In this post, I will guide you to use FileStream Data type in Ado.net. But before we start make sure you have configure your ...
This example demonstrates how to show the Header and Footer of GridView when no data returned from the DataSet or DataTable. The trick here is to add a new blank row to the DataTable that you used as your DataSource if there was no data returned in your query. Here’s the method for showing the Header and Footer of GridView when no data returned in the query. private void ShowNoResultFound(DataTable source, GridView gv) { source.Rows.Add(source.NewR... // create a new blank row to the DataTable ...
I was recently working on a GridView and needed to add a calendar for two of the columns while in edit mode. I added the AJAX CalendarExtender and it returned the selected date with no issues. <EditItemTemplate > <asp:TextBox ID="txtDate1" runat="server" Text='<%# BIND("Date1", "{0: MM/dd/yyyy}") %>'></asp:TextBox> <cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtDate1" PopupPosition="Right" CssClass="caltheme" > </cc1:CalendarExtender> ...
On March 10th, I’ll be presenting an ASP.NET control library for Facebook at the Phoenix ASP.NET Users Group. Among other things, we’ll be talking about how to create a Facebook application using ASP.NET, debugging aids, and the Facebook API. Along with that, Terralever will be releasing our library to the open-source community on Codeplex. (This post will be updated once we’ve done so). The library is currently in varying degrees of maturity. We’ve got about half of the FBML controls supported in ...
Here’s an example on how to highlight GridView rows on mousover at RowCreated or RowDataBound event of GridView by simply adding an attributes to the row. Here’s the code block: protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e) { string onmouseoverStyle = "this.style.backgroundColor... string onmouseoutStyle = "this.style.backgroundColor... if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes.Add("onmou... onmouseoverStyle); e.Row.Attributes.Add("onmou... ...
This demo describes how to implement multiple delete in GridView using CheckBox control and display a confirmation message upon deletion. Assuming that we have this GridView column mark up below <Columns> <asp:TemplateField> <HeaderTemplate> <asp:Button ID="ButtonDelete" runat="server" Text="Delete" /> </HeaderTemplate> <ItemTemplate> <asp:CheckBox ID="CheckBox1" runat="server" /> </ItemTemplate> </asp:TemplateField> <asp:BoundField DataField="CustomerID" ...
This demo describes the different approach to display a confirmation message when deleting a row in GridView and pass the id of the item to the confirmation message. Confirmation means a user is asked first if he/she wanted to delete a record by choosing an option (OK and CANCEL). In this demo, we use the JavaScript confirm function for displaying the confirmation message. Now let’s create our JavaScript confirm function. To do this switch to ASPX source and add the following code block within the ...
This demo is a continuation of my previous example “Binding GridView with Data”. If you are not familiar of binding the GridView the ado.net way then I would suggest looking at my previous example first before you proceed to this example. Basically, this demo describes the basic way to do INSERT, EDIT, UPDATE and DELETE data in ASPNET GridView Control using the ADO.NET way. STEP 1: Creating a DataBase Table In this demo, I presumed that you already have a basic background on how to create a simple ...
This example demonstrates how to populate GridView with data from the database using the ADO.NET way. Before you proceed reading this example be sure that you know the basics of ADO.NET manipulation. If you are not familiar with ADO.NET then I would suggest you to refer at the following link below: ADO.NET Tutorial STEP 1: Setting up the Connection String - Open your Web.config file and set up your connection string like below: <connectionStrings> <add name="MyDBConnection" connectionString="Data ...
This example demonstrates how to access ASP.NET server controls that resides within the TemplateField Column of GridView on Edit Mode. In this example we are using the PreRender event of GridView instead of RowEditing event since we cannot directly access controls at RowEditing event of GridView. See below for example: protected void GridView1_PreRender(object sender, EventArgs e){ if (this.GridView1.EditIndex != -1){ Button b = GridView1.Rows[GridView1.Ed... as Button; ...
I normally do not use DataSet and prefer Objects instead generated by the ORM frameworks, but recently I had to produce a ASP.NET page that displayed a list of records from multiple DataTables. Lets look at a similar example. Lets assume we consume this DataSet which has two DataTables "Agent" and "RealEstateProperty". The task is to display, what properties belongs to which agent, in a GridView. There are different ways to accomplish this task, lets look at them one by one. Method 1: Bind DataTables ...
A couple of weeks back I attended a session on Unobtrusive JavaScript (UJS) and jQuery by John Teague. This was probably the biggest thing I took from the Houston TechFest. Recently, I found the opportunity to put my new knowledge to good use. I haven't reach the unobtrusive part of John's presentation, but jQuery is my first step. Documentation I found the jQuery API documentation to be invaluable. At first, as a reference, it was a little difficult to find what I need. For example the "val()" function. ...
Previously I posted an example on how to download multiple images or files using DotNetZip library here. Today I will explain how we can use the same library to unzip images from a zipped folder and insert them into an SQL Server table. Note: I have used NeatUpload library developed by Dean Brettle to display import progress to the user which can be found here. If you don’t want to use it, remove the namespace from the code and modify the code to not use NeatUpload controls. Libraries used: 1. DotNetZip ...
Very often we need to present thumbnails in particular size for our client, especially in GridView, ListView and other complex web controls. This link (http://www.sergey.co.uk/ShowArticle.aspx?ID=9&AspxAutoDetectCookieSupport=1) show how to do it using only CSS. Check it out.
I need to show popup info message with single close button, but content is located in separate html file. The current implementation using window.open not working for many users with popup blockers. My question is which tool/framework should I use. Initially I considered to use UFrame (see CodeProject article:UFrame: goodness of UpdatePanel and IFRAME combined )inside ASP.NET AJAX ModalPopup. Then I found question http://stackoverflow.com/qu... ...
So, over the holidays I migrated the ASP.NET 1.1 web app to ASP.NET 3.5. I had initially wanted to use the migration tools provided by Microsoft but I also wanted to remove some junk controls that were already part of the application and wanted to spend some time refactoring some logic so I decide to create a new application and port code over one page at a time and clean/re factor as I went. During this re-write I added some Ajax calls and also added UpdatePanels hoping to make the user experience ...
If you have a gridview/repeater control or other tabular data within a div, scroll bar appears when height of data gets bigger than that of DIV. If you want to scroll down to a certain position, you can use 'Element.scrollTop' property in Javascript: document.getElementById(div... = PixelsToScroll; Calculating the PixelsToScroll may vary depending on scenerio, In my case, I wanted to scroll down to a selected row within Repeater control. Row was selected using RadioButton and page ...
1. Introduction This is a follow-up to the "An attribute based approach to business object validation" article in which i introduced the use attributes and reflection to validate business objects. I also promised to write another article on data converters and method based validators, and here it is. 2. Background In this article i will use an example to show how you can validate your business object using a method based attribute and how you can convert data assigned to properties when it is saved ...
Today I was working on a WebForm that includes a GridView which presents text boxes for various columns. I put these in the ItemTemplate so all of the rows could be edited at any time. The next requirement was to update certain read only columns (e.g. Total Amount) based on the changes of the others. Originally, I had the entire GridView in an UpdatePanel, but that quickly proved to be a problem for two reasons. First, the updates were fairly slow. Second, the active control would lose focus after ...
The GridView 'dgList' fired event RowDeleting which wasn't handled. Author : Pankaj Tahiliani Technology : ASP.NET Error : The GridView 'dgList' fired event RowDeleting which wasn't handled. Solution : There is no way to turn off this error message. The only solution of this error is to create the dgList_RowDeleting event on the code behind file and do nothing inside it ...
A Geek Got High and Pushed GridViewGuy Over the Cliff. GridViewGuy is now replaced by highoncoding. You can visit the website at www.highoncoding.com Hurry and get high .... legally :D
A Geek Got High and Pushed GridViewGuy Over the Cliff. GridViewGuy is now replaced by highoncoding. You can visit the website at www.highoncoding.com Hurry and get high .... legally :D
I was working on a small web application that was built very quickly using Linq to SQL and I wanted to ensure that a particular page wasn't loading more data than needed into memory. This particular page had a simple GridView, and in the one and only item template, there was an ASP.Net Image (along with some other stuff). The data source was of type IQueryable<Article> and an Article may have zero to many ArticleImages. A relationship was present in the dbml, so the ArticleImages were generated ...
Updated the code Snippet with the Method and Event Handler parameters for the ScriptManager's Navigate Event. One of the common navigation tools in a website is the back button of the browser. People use the back button quite frequently to go back to the page already visited. When there is a postback, the browser is updated with the information of the page visited and hence the back button gets enabled automatically. Assuming there is a GridView control that we are using in a page which fetches a ...
Introduction Last time we spent a lot of time on the SelectionController. To conclude the series, we will hook the selection behavior into our CustomGridView. Recap: Custom GridView Guidelines - Preface Custom GridView Guidelines - Part 1 - Preparing the Canvas Custom GridView Guidelines - Part 2 - Selection Interface Custom GridView Guidelines - Part 3 - SelectionController Implementing the IRowSelectionView There are quite a few events on the view that the CustomGridView needs to implement. In ...
Introduction This part in the series will focus on the SelectionController. Here is where most of the work is done. We've already covered the view interface, IRowSelectionView. Now we will see how the controller interacts with the view. Recap: Custom GridView Guidelines - Preface Custom GridView Guidelines - Part 1 - Preparing the Canvas Custom GridView Guidelines - Part 2 - Selection Interface Capturing Shift and Ctrl Key Status We want to emulate multi-selection as in Windows Explorer. The Shift ...
There are a lot of cases we need to add new button column in our DataGridView so we can perform custom logic for each row. For instance add to shopping card a product by pressing on ADD button in the DataGridView. One way to perform this task is to add template column to the DataGridView that contains a button bounded to the Product ID Field and Command Event: 1. Add Template column: 2. Enter to Edit Mode of the new Template Column and add command button: 3. Bind the button CommandArgument Property ...
There are a lot of cases we need to add new button column in our DataGridView so we can perform custom logic for each row. For instance add to shopping card a product by pressing on ADD button in the DataGridView. One way to perform this task is to add template column to the DataGridView that contains a button bounded to the Product ID Field and Command Event: 1. Add Template column: 2. Enter to Edit Mode of the new Template Column and add command button: : 3. Bind the button CommandArgument Property ...
So I came up with a new presentation based on something I did at Terracon with wildcard search using Patrick Tisseghem's Book on Search. I am going to walk attendees through some basic SharePoint Search Functionality and talk a little about what is missing in the out of the box web parts. Then I am going to show attendees what they can do using the Query Object Model, some ASP .Net Controls, and a GridView to add some more search functionality. Here is a list of the dates and events that I will be ...
Introduction I briefly described the design approach in Part 1. This part in the series will explore the ways in which the custom GridView communicates to the controller. I extend my apologies for the lack of code. I am limited in what I can provide. I hope that these guidelines will help point you in the right direction. Classes / Interfaces CustomGridView - The GridView we are customizing SelectionController - Responsible for the row selection behavior IRowSelectionView - How CustomGridView and ...
Background Way back in March I posted about a custom GridView I was working on. Then in June, I said that I would be posting some guidelines "in the coming weeks". Needless to say, I've been busy with other things. I am hoping to provide some basic guidelines on how to customize a ASP.Net GridView. I am no expert. The experts build components for retail use. Also, I've taken a server-side approach to the problem which is perhaps a little outdated with AJAX technology available. In my case, I use ...
On my current project I experienced a "Input string wat not in a correct format" using a paged gridview. Debugging didn't help. Finally, I found it: the enumerated value 'Previous' doesn't exist as a commandargument for the Pager. Changing it to 'Prev' did the trick!
I have been researching about this the whole morning and never found a straight forward answer. I will not be giving codes on this post BUT I will however encourage you not to do this for 3 good reasons: Ask yourself again if you really need to do this, and why. Gridviews are only graphical representations of set(s) of data from databases and/or datasets. So, ofcourse, if you wanted to add a row to your gridview, add it up on the table on your database and use the DataBind() method to bind the grid ...
I've previously posted "Access to BoundField value when GridView row is selected." Sometimes you need to customise DataControlField derived field (e.g. HyperLinkField or ButtonField )to show it differently then default behavior, but you don't want to create template for the field. If you customization requirements are compex, use TemplateField. Below there is an example, how you can access cell, generated by HyperLinkField and change content of the cell. E.g for HyperLinkField column you normally ...
SqlDataAdapter Use this data adapter object to bind SQL data sources. Using SqlDataAdapter Object Using System.Data.OleDb; // do not forget your namespace ------------------------------ Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt ...
I spoke at SQL Saturday Orlando #8 on October 25th SQL Compact & Data Sync Intro to SQL Compact and Data Sync services. In this presentation we go over benefits of SQL Compact not only on a mobile device, but as an amazing alternative to locally cached data for occasionally connected devices like laptops. We will also go over Sync Services for SQL Compact. Nikita Polyakov Beginner 09:00 AM Download: SQL Server Compact 3.5 Service Pack 1 http://www.microsoft.com/sq... ...
This session is by Scott Hunter, Program Manager at MSFT In July 2007 - ASP.NET Futures was released That was followined by an Extensions Preview of ASP.NET 3.5 in Dec 07 Then in March 08 - we started doing some new stuff - ASP.NET 3.5 SP1 - MVC and more The ASP.NET will continue to release out-of-bound items. CodePlex is the main driver for that. www.codeplex.com/aspnet - This is where you will find the interim drops. Currently there are ~1,000 downloads today If you want to see all the latest and ...
simulate: “file Streams into Memory, then JOIN the data in Memory, via LINQ to Objects” original article: http://blogs.claritycon.com... I wrote up a quick little WinForms project in VS2008 with .NET Framework 3.5, Code overview: 1. On Form_Load, a. create a List of People into DataDridView and in Memory b. create a List of Jobs into DataDridView and in Memory c. create a List of JobIds into ComboBox 2. On ComboBox_SelectedIndexChanged, a. Perform LINQ ...
GridViews and SharePoint Programming for SharePoint poses some challenges to the .NET developer. Of course first you should be familiar with .NET, I will be using c# in my examples here. One of the main development paths for SharePoint is to create modular functionality in Web Parts. Web Parts are great little chunks of a web page that you can cram anything you can think of into; however you won’t have the nice visual tools you are used to working with. For a simple “Hello World” type application ...
Introduction This blog entry which is more like an article, will demonstrate how easily you can design occasionally connected applications using ADO .Net Sync services. It’s going to be a very basic example in VB .net showing how easily you can use Sync services within your application. I have taken the template from code project and will try to upload it there as well. I am also uploading my presentation in case anyone needs it. Presentation and Source code Background At our organization we have ...
The following snippet below describes on how we are going to limit the Text displayed in the boundfield column of the GridView and display the original data in the ToolTip when user hovers the mouse for a particular cell. C# protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { ViewState["OrigData"] = e.Row.Cells[0].Text; if (e.Row.Cells[0].Text.Length >= 30) //Just change the value of 30 based on your requirements { e.Row.Cells[0].Text ...
So, this is the first Duh post and thought this would be a good one. I've been at this current place about 5 months now and for all the grids in the web app they like to use DataViews as the datasource, not sure why but since I'm the new guy I thought I would go along for now. After upgrading the ASP.NET 1.1 app to a 2.0/3.5 framework I talked the business people into adding pagination/sorting to the app. I replaced the old DataGrids with GridViews but kept the DataView as the binding source. Well ...
I had this problem today. It looks very simple, but actually took me a while to find a solution. The problem is: I have a Winforms DataGridView, and its first column is an unbound CheckBox column which is used to select/unselect a row. I want to hook up the check/uncheck event so that I can execute some logic after a row is selected or unselected. As this is Winforms, there is no way I can hook up an event from a control’s child element. But, it is quite obvious that we can hook up DataGridView’s ...
I was trying format my dropdown list to should the decimal numbers as pecentange. But the MSDN article is not completed. It turned out that {0:P2} is what I'm looking for. Here is the full list regarding the string format: Data Formatting for DataTextFormatString Format String Description {0:Cn} Currency. Displays numeric values in currency format with a leading dollar sign; n indicates the number of decimal places. If n is omitted, the default currency precision is two decimal digits. {0:Dn} Decimal. ...