Hello,
I am using grid to display the data in a pivot manner. The intial data will be in the following format.
Apart from these columns there are many more columns from the source data.
Id Cat/SubCatGroup TransactionDate Amount
1 Painting 10/04/2010 250
2 Music 09/27/1010 51.75
3 Music 09/27/1010 30
4 Music 09/27/1010 4
What I need to display in the grid is as shown in the attached file output format.png I have been trying this since long time. I am using OnNeedDataSource to bind the data.
protected void samplegrid_DataSource(object sender, EventArgs e)
{
//tr is the data (list<t> that contains the data received from the database)
//ToDataTable() is the method which converts the list of objects to datatable
samplegrid.DataSource = GetInversedDataTable(ToDataTable(tr), "TransactionDate", "CatSubCatName",Amount", "-");
}
//In the GetInversedDataTable()-- I tried to create a datatable with data which will be in the required format
But here I dont want to display the Id column.
I want the amount value as a hyperlink. When I click particular amount value, I need to collect that Id value at the backend. Based on that value I have to do some action.
Could anyone please suggest me how to proceed.
Urgent pls.
thanks in advance
I am using grid to display the data in a pivot manner. The intial data will be in the following format.
Apart from these columns there are many more columns from the source data.
Id Cat/SubCatGroup TransactionDate Amount
1 Painting 10/04/2010 250
2 Music 09/27/1010 51.75
3 Music 09/27/1010 30
4 Music 09/27/1010 4
What I need to display in the grid is as shown in the attached file output format.png I have been trying this since long time. I am using OnNeedDataSource to bind the data.
protected void samplegrid_DataSource(object sender, EventArgs e)
{
//tr is the data (list<t> that contains the data received from the database)
//ToDataTable() is the method which converts the list of objects to datatable
samplegrid.DataSource = GetInversedDataTable(ToDataTable(tr), "TransactionDate", "CatSubCatName",Amount", "-");
}
//In the GetInversedDataTable()-- I tried to create a datatable with data which will be in the required format
Id Cat/SubCatGroup 09/27/2010 10/04/2010
1 Painting 250
2 Music 51.75
3 Music 30
4 Music 4
But here I dont want to display the Id column.
I want the amount value as a hyperlink. When I click particular amount value, I need to collect that Id value at the backend. Based on that value I have to do some action.
Could anyone please suggest me how to proceed.
Urgent pls.
thanks in advance