Solved

Data Binding Gridview using data tables

Posted on 2011-03-03
4
251 Views
Last Modified: 2012-05-11
I have created a form that it compiles data from the user, now, i want to pull the information , but some of the columns i want to bind several columns from the database, so I am lokking a way to create a read only view and accomodate the data,


Is there any other method?
Whatdo I need to accomplish this?
0
Comment
Question by:TonyReba
  • 2
4 Comments
 
LVL 13

Accepted Solution

by:
agarwalrahul earned 500 total points
ID: 35033535
0
 
LVL 9

Author Comment

by:TonyReba
ID: 35033583
Can I re-use same gridview and code and only change instead of insert select?

 I mean use the same data table and connection string?
0
 
LVL 3

Expert Comment

by:chrisrbloom
ID: 35037173
If you have the gridview based on a datasource, then you can create a template column with the following:

<asp:Label ID="lbl_EmpName" runat="server" text='<%# Container.DataItem("EmployeeName") %>' />, &nbsp;<asp:Label ID="lbl_EmpNumber" runat="server" text='<%# Container.DataItem("EmployeeNumber") %>' />

here's some more information on this:
http://weblogs.asp.net/rajbk/archive/2004/07/20/what-s-the-deal-with-databinder-eval-and-container-dataitem.aspx
0
 
LVL 9

Author Comment

by:TonyReba
ID: 35047679
how can i made a non expandable item template

I don't want the cells and header to increase as the data will be the same size always.->
how can i made this , CSS maybe?
i need this to be the smallest possible as there are nearly 24 columns on the Gridview







0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now