Hi,
Declare Dummy as string at Page level. Comapre each columns values with
Dummy. If same then Set cell value as "" else set the Dummy variable with
Cell value.
Hope code below will help.
Thanks,
SSW
MCSD, MCAD, OCA
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----
Code Begin
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----
private string Dummy;//Class level variable
private void dgURGrid_ItemDa taBound(object sender,
System.Web.UI.W ebControls.Data GridItemEventAr gs e)
{
int i = 0;
if (e.Item.ItemTyp e.ToString() !="Header")
{
if(e.Item.DataI tem !=null)
{
DataGridItem di = new DataGridItem(e. Item.ItemIndex,
e.Item.DataSetI ndex, ListItemType.Se parator);
if(Dummy!=e.Ite m.Cells[i].Text)
Dummy = e.Item.Cells[i].Text;
else
e.Item.Cells[i].Text = "";
}
}
}
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----
Code End
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----
"John Martin" <jm*@larvikbank en.no> wrote in message
news:f8******** *************** ***@posting.goo gle.com...
This should be an easy match, but I'm lost. I want to perform a kind
of grouping of the data in a datagrid object, so that only the first
occurrence of a value in column one is visible. The following equal
rows should be blanked in column one, se example:
Col.one Col.two Col.three
A Data1 DataA1
Data2 DataA2
Data3 DataA3
B Data1 DataB1
Data2 DataB2
etc...
I'm trying to do this in the ItemCreated event, but I'm not able to
compare the current row with the previous. Or store the previous value
in some variable.. Please help, it's getting late!
Regards,
John Martin