Monday, March 12, 2012

how to convert a row in gridview to my business class DialUpRow generated by dataSet desig

I have GridView with: objectdatasource="objectdatasource1"

Objectdatasource1 is linked to my BLL (business layer with a dataset designer genrating: DialUpRow as an item of my datatable: DialupUpDataTable

I want to convert the selected row to my class: DialUpRow

I get the selected row using: myGRidView.SelectedIndex

But I don t know how to convert the grid row to my DialUpRow in order to get intellisence of my row properies (calss properties in code behind)

DataItem property of the GridViewRow would give the dataitem bound to the GridView. Below is a sample code. In the code, I haven't done any error checking, please ensure you do in your code.

Dim row as GridViewRow = GridView1.Rows(GridView1.SelectedIndex)if row isnot nothing thenDim drow as DialUpRow =CType(row.DataItem, DialUpRow)endif

Labels: , , , , , , , , , , , , , , , , ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home