.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Data Grid Header

Posted By:      Posted Date: September 27, 2010    Points: 0   Category :ASP.Net

Dear All,

I have one datgrid in that there are around 200 rows.Now i want when user scroll he should able to see the header.

Request all of you to help 

View Complete Post

More Related Resource Links

Building a Custom Data Grid: Performing Ad Hoc Web Reporting with a VBScript 5.0 Class Object


A flexible, customizable grid for displaying data is a useful tool for ASP developers. It allows Web visitors to customize their view of your data. This article takes the data grid presented in "Ad Hoc Web Reporting with ADO 2.0" by John Papa and Charles Caison (MIND, December 1998) and adds handy features such as a finds feature that supports multiple finds and a mode for adding and editing records. This version also improves response time by allowing asynchronous record download and it componentizes the code so it can be used as a standalone VBScript class object that can be reused in other pages.

Randall Kindig

MSDN Magazine July 2000

Custom Grid View Header - Grid view Row Created event vs Gridview row databound events ?


Hi Gurus ,

It happened to add an extra Gridveiw Header in row_databound event , It did worked fine on !Postback but disappered on Page.Postback . Quick google search guided me to move the event to Row_Created event and every thing is okay .

Can any expert post some pointers , differnces between grid row_created vs row_databount with some sample table data created dynamically  behaviour of both the events in !Postback and page.Postback .

Thanks a tonne in Advance and  any inputs will be valued and appreciated .

show data in grid view error Arithmetic operation resulted in an overflow.



i have a table there is 17 columns in 17 column 3 are number and other are varchar . when i try to display all data of that column error occures.

one more intersting think is when i try to display 6 column then grid show there data an no more error occures. 

when i run my project this error occures in grid view

Arithmetic operation resulted in an overflow. 

Expand rows in a data grid to show details in the same page

<asp:templatecolumn headertext="Purchase Order"> <headerstyle horizontalalign="center"></headerstyle> <itemstyle horizontalalign="center"></itemstyle> <itemtemplate> <%# DataBinder.Eval(Container.DataItem, "PurchaseOrder") %> </itemtemplate> </asp:templatecolumn> <asp:templatecolumn headertext="Order"> <headerstyle horizontalalign="center"></headerstyle> <itemstyle horizontalalign="center"></itemstyle> <itemtemplate> <a href="OrderDetail.aspx?Order=<%# DataBinder.Eval(Container.DataItem, "OrderNumber")%>"> <%# DataBinder.Eval(Container.DataItem, "OrderNumber") %> </a> </itemtemplate> </asp:templatecolumn> <asp:templatecolumn headertext="Ack Date"> <headerstyle horizontalalign="center"></headerstyle> <itemstyle horizontalalign="center"></itemstyle> <itemtemplate> <%# DataBinder.Eval(Container.DataItem, "AcknowledgeDate") %> </itemtemplate> </asp:templ

Cannon add new Data Source in Grid in VS2005 using SQL Server2005

I am a student and started out with VS2010 on my laptop.  Due to compatibility issues, I had to start using the provided version, 2005.  I uninstalled 2010 and now have the trial version of VS 2005 as well as SQL Server 2005. I have a data grid on a windows form and am attempting to use a database provided for the class.  When I use the smart tag to start the Wizard, as directed I do the following Select Add Project Data Source Choose Type..Database..Next In Choose Data Source Window, I select New Connection  Data source: MS SQL Server Database File..Continue In Add Connection Window, Data source: SQL Server Database File (SqlClient) Database file name...browse to database file in Student cd (E:\StudentData\DatabaseFilesSQLServerVersion\RnrBooks.mdf) Log on to the server: Use Windows Authentication And then press Test Connection Here is the error that I get: Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance.  The connection will be closed  

how to stop refresing data grid when selection changed

Hi , I have datagrid on my page bounded with linq datasource. I want to stop refresing datagrid when I need to show details of selected row. Could you please help me to do that. Regards Reside 

My Grid Don't show the data

Hi Dear I have one gridview . and sometimes I face with this error that it cannot show the data bound to it .. I use myGrid.Datasource= .. nad myGrid.DataBind() wherever it is needed .. what is the the problem ?

Unable to export data to an excel file in grid format!!!

I'm exporting data to an excel sheet from the ojects list. The data is exporting to excel sheet well, but I'm unable to see the grid format for the data. The data is looking with out the rows and columns lines. I think I'm missing to set some property or somethnig ehwn exporting.   Any help would be really appriciated.

Unable to store combo box value to data grid view control

Hello,         I am using fw 3.5 SP1 with VS2008. I have bind my object collection with data grid view. I can see different values in combo box inside data grid view. But when I select any one value from combo box the selected value is changed to first value of combo box as soos as user leave the cell of the gird. Can anyone tell me where should I look for this problem so that my selected value remains same as user did select it.   Nilkanth Desai  


the database result is as follows DATE     code   class1 class2  class3 1/8/10     M1     10       20     30     3/8/10     V2      20       30     10      1/8/10      H1      1           2      3         7/8/10     ! ! 8/8/10     !M2    5      5      5       3/8/10     B2      4      4     4       1/8/10     V1      3      7     3       THE OUTPUT SHOULD BE AS FOLLOWS:- DATE           M1                          M2           

Output data grid as excel

Hi,I'm trying to output a data grid as excel when someone clicks a button on a web page.I have the data grid working and have found some code to do the excel output, but can't quite get it working.  The code is like this:using System; using System.Data; using System.Data.SqlClient; using System.Configuration; using System.Collections.Generic; using System.Linq; using System.IO; using System.Web; using System.Web.UI; using umbraco; namespace MyDataExport { public partial class ExportData : System.Web.UI.UserControl { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BindGrid(); } } private void BindGrid() { SqlDataReader reader; SqlConnection conn = new SqlConnection(GlobalSettings.DbDSN); SqlCommand comm = new SqlCommand("SELECT * FROM budgetData;", conn); try { conn.Open(); reader = comm.ExecuteReader(); GridView1.DataSource = reader; GridView1.DataBind(); reader.Close(); } finally { conn.Close(); } } private void btnExportToExcel_Click(object sender,System.EventArgs e) { ExportToExcel("Report.xls", DataGrid1); //This line is erroring, saying 'DataGrid1 does not exist in the current context' } private void ExportToExcel(string strFileName, DataGrid dg) //This line errors, saying 'The type or namespace name DataGrid c

Problem of data grid view of xml file

Dear Friends I have a problem with XML View Data Grid. Earlier I create .xml file, then type first set of data tags then Right Click on it and select View Data Grid and Visual Studio 2005 gives me nice data grid view where I can able to enter data. But in Visual Studio 2008 I am not able to find that option. So friends kindly tell me how to enter data with data grid in xml file? I am using ASP.net with  C#, Visual Studio 2008, XML file for createing data source. Thank you.

Data template for Icon in Header of listview on sorting

I have 2 datatemplates that show 2 icons for sorting on ascending and on descending.. <DataTemplate x:Uid="HeaderTemplateArrowDown"> <DockPanel> <TextBlock Text="{Binding}"/> <Path x:Name="arrow" StrokeThickness = "1" Fill = "gray" Data = "M 5,10 L 15,10 L 10,5 L 5,10"/> </DockPanel> </DataTemplate> <DataTemplate x:Uid="HeaderTemplateArrowUp"> <DockPanel> <TextBlock Text="{Binding }"/> <Path x:Name="arrow" StrokeThickness = "1" Fill = "gray" Data = "M 5,5 L 10,10 L 15,5 L 5,5"/> </DockPanel> </DataTemplate> So now how do i use these in my theme file . How do i use them at a time all over my project in multiple forms from my theme file. Like how do i include these datatemplates into the GridViewColumnHeader Style.

WPF Data Grid - set style based on value

Hello All,
I am using a DataGrid and want to set the background of the row to certain color based on value. Example
One of the columns is Time Taken. If the value is less than 5, then no change. If it's between 6 and 10 then yellow and if greater than 10, then red.
I am looking for "OnDataBound" event - don't see any.
I am looking for something like
foreach(Row row in DataGrid1.Rows).... <-- not there.
How do I do it?
I am new to all this...sorry if this looks like a stupid question.

Grid view header text


I am populating my grid view from a dataset. The dataset has two columns (case Type and Csae Description). The casetype will be the same in every row.

HIS, Bonemarrow consult

How do I display the casetype in the header row (as shown below) instead of a column.

Bone Marrow Consult

unable to update data to databse from grid view


I have two tables in my database

using "innerconnect" i have show table content in grid view as      INV_NO            INV_DT        DN_NO       DN_DT   LR_NO        LR_DT .

where LR_NO is null .

I want to update it from grid view plz help


here  DN_NO  and INV_NO are primary keys

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace amar
    public partial class Form2 : Form
        SqlConnection con;
        SqlDataAdapter da1,da2;
        SqlCommandBuilder cb;

Creating a Form say grid sort of a interface where in data values will be extracted from the table 4


how dis can be done help please with simple button click and changing the values it can be done but how to move columns with data in graceful manner the way we have in calendar control... 

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend