This is a discussion on Having Some Issues in DataGrid within the ASP and ASP.NET Programming forums, part of the Web Development category; Hi, Iam having an Issues in my datagrid. Here is my data 1 Resource1 SubResource1 rating1 2 SubResource2 rating2 3 ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Hi, Iam having an Issues in my datagrid. Here is my data 1 Resource1 SubResource1 rating1 2 SubResource2 rating2 3 SubResource3 rating3 4 SubResource4 rating4 5 Resource2 SubResource1 rating1 6 SubResource2 rating1 7 Resource3 SubResource1 rating1 How can i put it in a datagrid ? I don't want the Resource(2nd column) to get repeated in all the rows. Could someone help me , How can i do this with the help of Rowspan?
__________________ -Murali.. |
| Sponsored Links |
| |||
| Hi, Write the SQL Query it has Group by and can check whether the Previous Classification is already repeated by Storing the Previous Id If it is same we can use Row span property and Hide the Columns On Item data bound Sample Code is Given Below Code: public void setNoDataFound(Object sender,DataGridItemEventArgs e)
{
if(m_DataExists == false)
{
for (int i = 0;i < e.Item.Cells.Count;i++)
{
e.Item.Cells[i].Visible = false;
}
TableCell c = new TableCell();
c.Text = "No Data Found";
e.Item.Cells.Add(c);
dg.Width = System.Web.UI.WebControls.Unit.Percentage(100);
}
else
{
try
{
if(prev_CategoryId != Convert.ToInt32(e.Item.Cells[0].Text) && prev_CustomerId!=Convert.ToInt32(e.Item.Cells[1].Text))
{
prev_CategoryId = Convert.ToInt32(e.Item.Cells[0].Text);
prev_CustomerId=Convert.ToInt32(e.Item.Cells[1].Text);
int rspan;
rspan = ds.Tables[0].Select("CustomerCategoryID=" + prev_CategoryId).Length ;
e.Item.Cells[0].RowSpan = rspan;
e.Item.Cells[1].RowSpan = rspan;
e.Item.Cells[2].RowSpan = rspan;
}
else
{
e.Item.Cells[0].Visible = false;
}
}
catch
{
}
dg.Width = System.Web.UI.WebControls.Unit.Percentage(100);
}
} ![]() -R.Gopi |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Crystal Report Issues | Sundaram | ASP and ASP.NET Programming | 0 | 03-10-2008 02:53 AM |
| Apple Issues iPhoto Security Fix | Shanthi | Technology BUZZzzzzz | 0 | 02-05-2008 09:29 PM |
| LDAP installation and Configurations issues | kingmaker | Operating Systems | 5 | 09-12-2007 05:51 AM |
| Copy-Write issues | simplesabita | Software Testing | 1 | 09-06-2007 12:50 AM |
| Common issues with Sony DVD Drive ? | itbarota | Computer Hardware | 2 | 08-06-2007 08:50 AM |