Geeks With Blogs

News

Microsoft MVP


DZone MVB


Moderator at CodeASP.NET


Quiz Master







free counters
Free counters
Added on January 19,2012


Follow Me @vmsdurano

A bit About Me



Disclaimer
The opinions expressed herein are my own personal opinions and does not represent the opinions of my employers. Nor does it represent the opinion of my dog, because I don’t have one.


Vinz' Blog (ProudMonkey) "Code, Beer and Music ~ my way of being a programmer" GridView
Tip Of The Day - Remove GridView Row Highlighting on Edit Mode
Typically we will attach the mouseover and mouseout client-side events on the gridview rows to highlight rows on mouseover, but there are cases that we don't want to make the row highlighted when we are on edit mode. To do this we can check the GridView EditIndex to determine if the row is on edit mode and then do the validation there. Here's a sample code block below of what I am talking about: protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) ......

Posted On Tuesday, April 26, 2011 2:17 PM

Using Radio Button in GridView with Validation
A developer is asking how to select one radio button at a time if the radio button is inside the GridView. As you may know setting the group name attribute of radio button will not work if the radio button is located within a Data Representation control like GridView. This because the radio button inside the gridview bahaves differentely. Since a gridview is rendered as table element , at run time it will assign different "name" to each radio button. Hence you are able to select multiple rows. In ......

Posted On Thursday, March 3, 2011 5:20 PM

Highlight Row in GridView with Colored Columns
I wrote a blog post a while back before here that demonstrate how to highlight a GridView row on mouseover and as you can see its very easy to highlight rows in GridView. One of my colleague uses the same technique for implemeting gridview row highlighting but the problem is that if a Column has background color on it that cell will not be highlighted anymore. To make it more clear then let's build up a sample application. ASPX: 1: <asp:GridView runat="server" id="GridView1" onrowcreated="GridView1_Row... ......

Posted On Thursday, January 13, 2011 6:23 PM

Inserting and Deleting Sub Rows in GridView
A user in the forums (http://forums.asp.net) is asking how to insert sub rows in GridView and also add delete functionality for the inserted sub rows. In this post I'm going to demonstrate how to this in ASP.NET WebForms. The basic idea to achieve this is we just need to insert row data in the DataSource that is being used in GridView since the GridView rows will be generated based on the DataSource data. To make it more clear then let's build up a sample application. To start fire up Visual Studio ......

Posted On Tuesday, January 4, 2011 5:52 PM

FAQ: GridView Calculation with JavaScript - Editable Price Field
Recently I wrote a series of blog posts that demonstrates how to do calculation in GridView using JavaScripts. You can check the series of posts below: FAQ: GridView Calculation with JavaScript FAQ: GridView Calculation with JavaScript - Formatting and Validation FAQ: GridView Calculation with JavaScript - Displaying Quantity Total Recently a user in the forums is asking how to calculate the total quantity, sub-totals and total amout in GridView when a user enters the price and quantity in the TextBox ......

Posted On Thursday, December 9, 2010 11:43 PM

FAQ: GridView Calculation with JavaScript - Displaying Quantity Total
Previously we've talked about how calculate the sub-totals and grand total in GridView here, how to format the numbers into a currency format and how to validate the quantity to just accept whole numbers using JavaScript here. One of the users in the forum (http://forums.asp.net) is asking if how to modify the script to display the quantity total in the footer. In this post I'm going to show you how to it. Basically we just need to modify the javascript CalculateTotals function and add the codes ......

Posted On Thursday, December 9, 2010 5:54 PM

FAQ: GridView Calculation with JavaScript - Formatting and Validation
In my previous post here we've talked about how to calculate the sub-totals and grand total in GridView using JavaScript. In this post I'm going take more step further and will demonstrate how are we going to format the totals into a currency and how to validate the input that would only allow you to enter a whole number in the quantity TextBox. Here are the code blocks below: ASPX Source: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml... ......

Posted On Thursday, December 9, 2010 5:17 PM

FAQ: GridView Calculation with JavaScript
In my previous post I wrote a simple demo on how to Calculate Totals in GridView and Display it in the Footer. Basically what it does is it calculates the total amount by typing into the TextBox and display the grand total in the footer of the GridView and basically it was a server side implemenation. Many users in the forums are asking how to do the same thing without postbacks and how to calculate both amount and total amount together. In this post I will demonstrate how to do this using JavaScript. ......

Posted On Wednesday, December 8, 2010 10:29 PM

Adding Rows in GridView
This example shows on how to add rows of data in the GridView control. In this example, I created a simple database table called “Table1” for storing the data. The Table has the following columns: Id – PK Employees Position Team Note that I added some dummy data in table that I have created so that we can display something in the GridView when the page is loaded for the first time. To get started, let’s grab a GridView Control from the Visual Studio ToolBox and place it in the webform. Then set up ......

Posted On Tuesday, June 9, 2009 10:37 PM

Adding Dynamic Rows in GridView with TextBoxes
Introduction: I decided to write this article because this has been asked so many times before at the forums(http://forums.asp.net) . Basically, this example shows on how to generate a Row in GridView with TextBoxes when clicking a Button that is residing inside the GridView footer. To get started, let’s grab a GridView control from the Visual Studio Toolbox and put it in the WebForm. The mark up would look something like this: <asp:gridview ID="Gridview1" runat="server" ShowFooter="true" AutoGenerateColumns="false"... ......

Posted On Thursday, June 4, 2009 10:13 PM

Move AutoGenerate Columns at LeftMost Part of the GridView Columns
There are certain scenarios that we need to combine an AutoGenerated Columns with TemplateField Columns or even BoundField Columns in the GridView. As we all know, by default the GridView will automatically display all the AutoGenerated Columns to the rightmost column of the GridView. Consider this example below: Assuming that we have this GridView markup below: <asp:GridView ID="GridView1" runat="server"> <Columns> <asp:TemplateField> <ItemTemplate> <asp:Button ID="Button1" ......

Posted On Wednesday, June 3, 2009 10:23 PM

How to: Generate Control Events that Resides within a GridView TemplateField
I decided to post this because this has been asked many times before at the forums. So for those who doesn't know how to generate a control event that are residing within the TempleFields of GridView then you can follow these few steps below: * Switch to Design View in Visual Studio Designer * Right Click on the GridView * Select Edit Template and then Select the Column where the Control that you wan't to generate the event resides (e.g Button, TextBox, etc..) * The GridView will then changed to ......

Posted On Tuesday, June 2, 2009 8:04 PM

Tip/Trick: Fixing GridLines Border Color in IE8
There are times that we need to set the border color of the GridView just like in my case, I was told to set the border color of GridView to a particular color instead of the default black. What I did is simply use the BorderColor property of the GridView and set it declaratively like below: <asp:GridView ID="GridView1" runat="server" GridLines="Both" BorderColor="Red"><as... Here's how it looks when we run that one in the browser. Firefox 3.5 Safari 5 IE 8 Noticed that in IE8 ......

Posted On Thursday, October 7, 2010 8:38 PM

Adding Dynamic Rows in ASP.NET GridView Control with TextBoxes and with Delete functionality
In my previous examples, I have demonstrated on how to add dynamic rows in GridView control with TextBoxes and how to save the values into the database. Now, seems that most of the developers are asking if how to add a delete functionality with it. So in this example, I’m going to show on how to delete a certain row in the dynamic GridView with TextBoxes. Note: Before reading this example, then be sure to refer my previous examples mentioned above so that you will have a basic idea on how does the ......

Posted On Sunday, August 9, 2009 6:47 PM

Uploading and Storing Image Path to Database and Image to Folder - Part 2 (Displaying of Images)
In my previous example, we have learned on how to save the actual image to a folder and image path to the database. In this example, I’m going to show on how to display those images in a GridView and Repeater control. To get started, let’s create a method for fetching the image information from the database. Here’s the code block below: private DataTable GetData() { DataTable dt = new DataTable(); SqlConnection connection = new SqlConnection(GetConnection... try { connection.Open(); string ......

Posted On Sunday, August 2, 2009 5:55 PM

Copyright © Vincent Maverick Durano | Powered by: GeeksWithBlogs.net | Join free