User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C# section within the Software Development category of DaniWeb, a massive community of 391,593 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,683 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C# advertiser:
Views: 6066 | Replies: 4
Reply
Join Date: Jul 2005
Posts: 7
Reputation: Prasadd is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Prasadd Prasadd is offline Offline
Newbie Poster

Help how to format a Datagrid ??

  #1  
Oct 31st, 2005
I need a datagrid that has 4 columms & 2 rows.
Each cell in that datagrid will represent one row from my database table.


can someone plz giv me some sample code for that ?
or any tips on how to achieve the same ??
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2005
Posts: 5
Reputation: v_ashwani is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
v_ashwani v_ashwani is offline Offline
Newbie Poster

Re: how to format a Datagrid ??

  #2  
Oct 31st, 2005
In my opinion there are 2 ways of doing it:
1. Make your datasource such that it resembels what is required in the datagrid. Say, For example, you make a array of array and the base array would have table rows in it. So it would be like Array A has two arrays and each of the array has data from the Table row.
and then you simply do a custom binding of your datagrid by calling the event handler of databinding.
2. Other method is more adhoc, where you generate table dynamically. so you declare asp:Table as runat server and then in code behind you add rows and columns in it.

Hope that helps
Reply With Quote  
Join Date: Jul 2005
Posts: 7
Reputation: Prasadd is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Prasadd Prasadd is offline Offline
Newbie Poster

Re: how to format a Datagrid ??

  #3  
Nov 3rd, 2005
Hi,

Thanx for ur help !
I'm not much experienced with .NET but will surely try ur suggestions.


Thanx
- Prasadd
Reply With Quote  
Join Date: Jan 2008
Location: http://www.GlobalGuideLine.com
Posts: 3
Reputation: ali_ggl is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
ali_ggl's Avatar
ali_ggl ali_ggl is offline Offline
Newbie Poster

How to formate each rows cell color?

  #4  
May 21st, 2008
Hi all here any one knows how to assign color for each rows cell value on the bases of some logics.
Regards.

Ali.
Reply With Quote  
Join Date: Jul 2007
Location: Philippines
Posts: 160
Reputation: jireh is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 16
jireh's Avatar
jireh jireh is offline Offline
Junior Poster

Re: How to formate each rows cell color?

  #5  
May 21st, 2008
Originally Posted by ali_ggl View Post
Hi all here any one knows how to assign color for each rows cell value on the bases of some logics.
Regards.

Ali.


try to loop the table then provide the color you wanted to be in every loop... got it? it better to for() statement
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb C# Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the C# Forum

All times are GMT -4. The time now is 11:27 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC