Showing posts with label Gridview. Show all posts
Showing posts with label Gridview. Show all posts

Sunday, October 10, 2010

Jquery to read DatakeyNames value of Selected Rows of GridView in Asp.Net

As we know GridView is a very popular control. We always experiment to enhance the GridView control to provide better experience to user. Since javascript is also a popular clientside language, most of the times we use this in client side operations like validation, Row coloring, cell coloring etc. Now a days Jquery is more popular so that in this article i will explain how you can capture the

Sunday, May 16, 2010

How to read hidden field data in GridView Asp.net C#

In some cases developers need to collect more data instead of datakeynames. In that cases developers use hidden field to retain those important data. Here in this article i wil show how one can use hidden field to store some important data & how can read those. For simplicity here i use a product table & use ID in a hidden field to read them from server side SelectedIndexChanged event. The

Tuesday, April 20, 2010

Runtime Dynamically Creating Bound and Template Columns in GridView using Asp.net C#

In some complex scenarios developers need to create runtime GridView dynamically. So obviously developers need to create dynamic columns for dynamic gridviews. Here in this article I will explain how one can develop or implement runtime dynamically create bound column as well as template column of a GridView control and also how to bind data into the dynamically created GridView. For simplicity

Sort Sorting GridView control Manually in Asp.net C#

Asp.net SqlDataSource control ease our lives because if you are using SqlDataSource control to bind a GridView control then no need to sorting gridview or paging gridview control since you will achieve it automatically. But if you are using different datasource like Datatable, DataSet then you need to GridView sorting manually. Here in this article I will show you how you can develop GridView

Sunday, April 18, 2010

GridView paging manually in Asp.net C#

GridView paging will be required when data volume is higher. If you are using SqlDataSource control to bind a gridview control then no need to paging gridview because you will achieve it automatically. But if you use different datasource then you need to do mannual paging. To enable paging in gridview control at first set the AllowPaging="true" and also define the page size by PageSize="3". In

Thursday, February 25, 2010

Efficient best Syntax to Open a SqlConnection in Asp.Net 2.0 3.5

To describe the best way to open sql server connection in asp.net here i am choosing to bind the gridview because in most of the cases the major task is to bind GridView data. You can make more generous method to collect sql server data but here my intension is to show you how you can open sql server connection efficiently.












Please have a look at the code sample:
protected void

Wednesday, February 24, 2010

How To get RowIndex of Asp.Net GridView in the RowCommand Event

As we know that if we add any button control or image button control or link button within the GridView and click to generate postback event then GridView RowCommand Event will fire. But the problem is from this RowCommand method we did not easily get the cliclked or selected GridView row index number. To get the RowIndex of Asp.Net GridView in the RowCommand Event we have two options.
1. Using

Monday, February 22, 2010

How to read GridView row column data using javascript

In some cases we need to read GridView row column data using javascript specially for search purpose. Also there were lots of reason to read GridView data using javascript. If you can read gridview data from a javascript function then you can implement lot of eye catching interface for your client.
The below javascript function wiil read gridview contents or loop through gridview rows:









Tuesday, February 16, 2010

How to Loop through GridView Rows Asp.net C#

This is a small tips for asp.net C# vb.net novice developers. We can loop through GridView rows using two ways:

1. Use GridViewRow class to loop through or navigate the GridView rows from outsite the GridView control's event.

2. Use general for loop based on GridView Rowcount method.

In this article i will generate the following interface:


Loop through GridView rows using GridViewRow class:

Thursday, February 4, 2010

How to use more than one DataKeyNames of a GridView in asp.net 2.0 / 3.5

In my previous article i have described "how we can remove multiple GridView rows like gmail deletion at a time". This article is the continution article. In this article i will modify the base article class file to show you how one can use more than one datakeynames in a gridview as well as in editing time or in GridView manipulation time how one can read more than one datakeynames that you have

Wednesday, February 3, 2010

Enable disable show hide controls in grdview edit mode RowEditing or PreRender method

In many asp.net (C# VB.Net) forum i found that developers ask how to enable or disable or show or hide asp.net server side controls like textbox,label,checkbox,checkboxlist,radiobutton,radiobuttonlist & dropdownlist or combo box in gridview edit mode. Everyone tries to find those controls within RowEditing event handler but they didn't get the control by using findcontrol method and editindex

Thursday, January 21, 2010

Merge merging or Split spliting GridView Header Row or columns in Asp.Net 2.0 / 3.5

In most of the times for reporting purpose we need to merge or merging GridView header columns or rows or to use multiple headers in Asp.Net C# Vb.Net code. In this article or Asp.Net C# tutorial i will explain how one can merge or split GridView Header rows or columns. For this example here i took product table. Where In first two columns i will show Brand Name & Category Name & by spliting i

Wednesday, January 20, 2010

Searching in the GridView control with paging enabled using Asp.Net C# 2.0 / 3.5

In many forums Asp.net C# Vb.Net developers ask a common question How one can search in a GridView and highlight GridView rows or record data. The answer is yes we found a lot of example on this issue and here in this example i am going to explain how you can highlight gridview rows data based on search result. As we know that GridView control is a very nice and helpful control but still can't

Sunday, January 17, 2010

Merge GridView Cells Or Columns in Row ASP.NET C#

In most of the cases specially for reporting purpose we need to merge GridView cells or columns for client preferred output. In this example i will show you how one can merge GridView cells or columns in asp.net C#. My special focus is on to merge cells when both contains same or equal data. So that the GridView looks like a traditional report. For merging GridView cells here i want to show you a

DropDownList RadioButtonList CheckBox CheckBoxList in GridView Edit Mode in Asp.Net

Most of the Asp.net (C# or VB.Net) developers faced a problem when they want to implement edit functionality within a GridView. The problem was developers can not understand how to populate DropDownList RadioButtonList CheckBox CheckBoxList in GridView Edit Mode. The another problem is after populating how to display or show current database value by default in DropDownList RadioButtonList

Thursday, January 14, 2010

Highlight GridView Row On MouseOver Using Javascript in Asp.net

Asp.net GridView gives us huge facility that we can't imagine few years ago. But still we have a lot of chance to improve look & feel as well as GridView functionality. Here in this article i will describe how you can highlight a gridview row when move the mouse over the row and also how to retain the original background color when user leaves the mouse from a row or in mouseout event. After

Thursday, December 31, 2009

Display Images in GridView from Sql Server Database Table Using Asp.net C#

In my previous post i showed you "How one can upload images into Sql Server using Asp.net C# FileUpload control". In this post i will show you how one can display images into a GridView from Sql Server table. As you know in most of the web applications requires to handle different type of images like large,thumbnail etc. If those web applications are e-commerce site then you must be carefull when

Wednesday, November 25, 2009

Bind GridView with MS Access Database table in Asp.net

In many forums i found that developers struggle "To connect with MS Access Database from Asp.net". Thats why in this post i will show you how one can access MS Access database from Asp.net ASPX page to bind GridView. To do that first open any MS Access Database & then create below table:Fig: EntityAnd ofcourse copy your MS Access mdb Database into your application root folder.Ok, Now our MS

Thursday, October 8, 2009

Show grand total running total in GridView Footer

In many scenarios we need to display Running total as well as Grand total in GridView footer. In this post i will try to explain in an easy way that how we can display running total & Grand total in a GridView footer combindly. To explain this solution using an example here i use a sales order report. The report contains all sales order amount in a tabular way. I will use a GridView to display

Friday, August 28, 2009

Create autogenerate serial number column in GridView

In many Asp.net forums i found the question "How to generate a column as serial number at runtime of a gridview?". Also they have another concern was paging. Thats why here i want to share a simple code snippet with all. Which will help you to add a autogenerate number or sequential number or serial number in your GridView with less effort. Mind it the serial number will not come from Database.