Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
515
Fill weggrid using collecion class object
posted

(1) i used collection class to populate grid ,

 i have one BO class Person and collection class PersonColl

and one DAL class PersonDAL  , in this class one methed GerPersonList

this mehod return PerosnColl object

i called this method from UI page

some thing like this

Dim percol As New PersonDAL

UltraWebGrid1.DataSource = percol.getdata

UltraWebGrid1.DataBind()

i also have one buton Save on the page

i want select row value when user click on Save button

but it's want work if i used this type of data binding

(2) if i used sqldatasource or objcetdatasource then i can find out selected row , some thing like this way

Dim row1 As UltraGridRow = UltraWebGrid2.DisplayLayout.ActiveRow

If Not row1 Is Nothing Then

Label1.Text += row1.Cells(0).Value

End If

Can Anybody tell me how to find a selected row if i used first databing apporch ? 

 

  • 45049
    posted

    Using a custom business object as your data source shouldn't have any impact on whether or not you can retrieve the active row in server-side code.

    Are you possibly databinding your grid on every postback?  If you are, this would cause this problem.  If you're binding in the Page_Load event, you have two options - either put the call to the grid's DataBind() method in a "If Not Page.IsPostBack" condition, or move the retreival of your data source to the grid's IntiializeDataSource collection (and remove the call to DataBind() altogether, since the grid will implicitly call it).