A small help on DataGrid

  • Thread starter Thread starter Kumar Amit
  • Start date Start date
K

Kumar Amit

Hi,
I am working on a project and what I have to do is to edit all cells
of 4th column in datagrid which are numbers. Like if it is 45.8700 then the
new vale of cell should be "=fixed(45.8700, 4, true)"
Any help will be really appreciated,
Thanks in advanced K Amit
 
Hi Kumar,

Suppose the 4th column is a bound column, you can process data in
datagrid_ItemDataBound event:

if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
ListItemType.AlternatingItem )
{
TableCell cell = e.Item.Cells[3];
cell.Text = fixed(Convert.ToDouble(cell.Text), 4, true);
}

HTH

Elton Wang
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top