set datagrid current record to inserted record
i have master detail page datagrid , dataform. there text box users can enter client reference number. if th reference bumber not found, child window pops uo d ataform insert. want when new record inserted, , child window closed, current record in datagris should set inserted record.. how possible
private sub addnewclient_closed(sender object, e eventargs) dim clients cwclientadminadd = sender dim dd domaindatasource = ria_clientselection if not clients.newtbcbi_client nothing dd.dataview.add(clients.newtbcbi_client) dd.submitchanges() else dd.cancelsubmit() end if end sub private sub ria_clientselection_submittedchanges(sender object, e system.windows.controls.submittedchangeseventargs) if e.haserror messagebox.show(e.[error].tostring(), "submit error", messageboxbutton.ok) e.markerrorashandled() else me.dgclientsearch.itemssource = nothing me.dgclientsearch.itemssource = "{binding elementname=ria_clientselection, path=data, mode=oneway}" me.txtlicence.text = "" end if end sub private sub ria_clientselection_loadeddata(sender object, e system.windows.controls.loadeddataeventargs) handles ria_clientselection.loadeddata if len(me.txtlicence.text) = 6 if e.totalentitycount = 0 addnewlicence(me.txtlicence.text) end if end if end sub private sub addnewlicence(licence string) dim addnewclient new cwclientadminadd(licence) addhandler addnewclient.closed, addressof addnewclient_closed addnewclient.show() end sub
normally can pass inserted record in addnewclient_closed event argument. then, can set datagrid.selecteditem property value of inserted record instance.
Silverlight > Getting Started with Silverlight
Comments
Post a Comment