Solved

Data Binding Gridview using data tables

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

930 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

11 Experts available now in Live!

Get 1:1 Help Now