Hi! I am a beginer in C# and I have 2 forms in a project. The first one contains a dataGridview with 3 columns: nr,date and obs and a button. when i select a row and click on a button i want to copy the current nr,date and obs in some textboxes from the second form. how do i refer to thouse from the second form? Can anyone tell me, please? thanks.
beginerC#
0
Newbie Poster
Recommended Answers
Jump to Postcopy means,you wants to pass the values from one page to another right,try session or hiddenfield.
Those are both web concepts and wont help in a winforms environment.
If you are creating an instance of the form2 when you click the button you can add the variables you want …
Jump to Postpublic class TestData { public string No { get; set; } public string OPS { get; set; } public DateTime Date { get; set; } }
public partial class Form1 : Form { public Form1() { …
Jump to PostMain form:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace daniweb.editform { public partial class frmMain : Form { private DataTable _dt; public frmMain() { InitializeComponent(); } private static DataTable GetData() { DataTable result = new DataTable(); //nr,date …
All 10 Replies
DdoubleD
315
Posting Shark
DarthC#
0
Newbie Poster
beginerC#
0
Newbie Poster
beginerC#
0
Newbie Poster
chandru7
-1
Junior Poster in Training
sknake
commented:
Windows forms don't have sessions / hidden fields
-1
Geekitygeek
480
Nearly a Posting Virtuoso
beginerC#
0
Newbie Poster
patrickpan
0
Newbie Poster
sknake
1,622
Senior Poster
Featured Poster
beginerC#
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.