Page 1 of 1

Asp.NET DataGrid SelectedRow

Posted: Wed 22 Sep 2010 01:00
by JoeRuspante
Hi everybody.

I used an OracleDataSource for read data and populate a grid. Now, when I am in the code behind called when a selection change in the grid (AutoGenerateSelectButton to true), I have the SelectedValue correct (key column of my table), but I don't have the SelectedRow valid. It is always an empty SelectedRow (not null, but empty).

So, how can I know the value of a column that isn't the primary key?

Could be this a limit of the "Direct mode"?

I have the DotConnect 5.70.152 and using .NET framework 4


Thank you in advance

Posted: Mon 27 Sep 2010 14:27
by Shalex
I cannot reproduce the mentioned problem neither in Direct Mode, nor in OCI. Please try to retrieve the necessary value in the handler of the SelectedIndexChanged event (not SelectedIndexChanging) and notify us about the results:

Code: Select all

string myValue = GridView1.SelectedRow.Cells[3].Text;

Posted: Sat 02 Oct 2010 11:43
by JoeRuspante
Ok, using ".cells" seems to work.

Thank you