Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Data Binding Gridview using data tables

Posted on 2011-03-03
4
279 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

856 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