Solved

Data Binding Gridview using data tables

Posted on 2011-03-03
4
292 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
[X]
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
  • 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

707 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