Hello,

I have a DataGrid binded to a SqlDataReader. I want to customise
the looks (all values in one line, and not the default of
several columns with values) of each datagrid line, so I
created a OnItemDataBoundEventHandler event handler:

public void OnItemDataBoundEventHandler(object sender, DataGridItemEventArgs e)

Problem is: how do I get the values from the DataGridItemEventArgs?


In a previous version of this page I had a DataGrid binded to a
simple DataSet, and I did a simple:

DataRowView dataRow = (DataRowView)item.DataItem;

but this no longer works, I get a "Specified Cast is not valid".

I've tried

DataGridItem item = (DataGridItem) e.Item;

And this worked, but I still can't get to the values with
Cells(0), etc. (and the values are there, I check with debug,
in a DbDataRecord object).

Any help would be appreciated.
Joćo Martins

--
Joćo Pedro Martins
[EMAIL PROTECTED]
|create|it|
http://www.create.pt
http://www.usabilidade.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