Thanks Adam,

I'll probably end up doing just as you suggested and convert everything at
the database level in a stored proceedure. That may solve the problem for
item 2 also as I could do the mileage calculations in the SP and then filter
records greater than the radius.

Marshall

-----Original Message-----
From: Sills, Adam [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 29, 2002 2:56 PM
To: [EMAIL PROTECTED]
Subject: Re: [DOTNET] Datagrid problem


> 1. After retrieving the data I need to programtically adjust the data
> in a column. To be exact I need to convert a string date in YYYYMMDD
> format to a proper date format. I can't seem to find a way to do this?

If you're using a database, why not convert the YYYYMMDD date string to an
actual datetime...something like convert(datetime, 'yourdate', 101) for US
date format..

In your datagrid bound column, there is a DataFormatString property (or
something similar) where you can specify a formatstring that the datagrid
will use to format the value. Lookup DateTime.ToString() for examples of the
formatting.

> 2. After retrieving the data I need to programtically decide if the
> record should be included in the grid. Is there a way to do this? I
> looked at DataGrid.OnItemCreated but all the examples I found were
> dealing with the header text. Besides it seems as if this fires too
> late (i.e. when the row is bound)and I need to keep the row from
> binding.

You could walk through your data, and .Delete() the rows that you don't
want, and when you're done call DataSet.AcceptChanges() to remove them from
the DataSet.

Adam..

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to