Best way to edit data on two pages

pettrer

Well-known member
Joined
Sep 5, 2008
Messages
92
Programming Experience
10+
Hi,

Using Windows forms, I click a button on one page. This button pops up another page with a datagridview, where the data of a selected row from the first datagridview is edited.

So, the first page has a datagridview and its selected row becomes what fills the datagridview of the popup page (the child datagridview gets its WHERE filter value from the parent's selectedcells(0)). Below is the code that does this but to me it seems like a hack. is there another way to accomplish this, using as little handwritten code as possible?

VB.NET:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        TermEgenskaper.Show()
        TermEgenskaper.TermBindingSource.Filter = "cTermKod = '" & TermDataGridView.SelectedCells(0).Value & "'"
    End Sub

Thanks!

Pettrer
 
Yes.. Set the datasource of the popup datagridview to be the bindingsource.current of the form that does the popping..

ps, in winforms, we call forms forms, not pages!
 
Yes.. Set the datasource of the popup datagridview to be the bindingsource.current of the form that does the popping..

ps, in winforms, we call forms forms, not pages!

Thanks, I'll try that!

So you're calling forms forms... Ground-breaking! :D
 
On a different page, we also call ASP.Net web pages web forms. ;)
 
...which inherit Masterpages... :p
No, they inherit System.Web.UI.Page, which according to documentation "Represents an .aspx file, also known as a Web Forms page". Masterpages are user controls, and works like a merge view with the web page as specified by a Master/Page directive and Content/ContentPlaceHolder tags.
 

Latest posts

Back
Top