0

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 ??

4
Contributors
4
Replies
5
Views
12 Years
Discussion Span
Last Post by jireh
0

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

0

Hi,

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


Thanx
- Prasadd

0

Hi all here any one knows how to assign color for each rows cell value on the bases of some logics.
Regards.

Ali.

0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.