Asp.NET DataGrid SelectedRow

Asp.NET DataGrid SelectedRow

Postby JoeRuspante » Wed 22 Sep 2010 01:00

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
Posts: 54
Joined: Mon 05 Jul 2010 23:08

Postby Shalex » Mon 27 Sep 2010 14:27

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;
Devart Team
Posts: 7888
Joined: Thu 14 Aug 2008 12:44

Postby JoeRuspante » Sat 02 Oct 2010 11:43

Ok, using ".cells" seems to work.

Thank you
Posts: 54
Joined: Mon 05 Jul 2010 23:08

Return to dotConnect for Oracle