Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#2.0 DataGridView
I have one Form with Mid parent... 2 nd is Gridview is child of the midparent... 3rd is AddForm
 
now the question is
 
when in back my Gridview is open and in front i have Addform open i will add the Data in form and when i click ADD data will be refreshed in The Back Gridview Form
Posted 23-Sep-12 6:36am
Edited 23-Sep-12 6:45am
Wes Aday87.3K
v2
Comments
Wes Aday at 23-Sep-12 12:48pm
   
There is not any kind of a question here. This is not even a description of any kind of a problem.
Bhimani Hiral at 23-Sep-12 12:51pm
   
but it's simple...question
 
i want refresh data of datagridview...
when i add the...data in other form
Wes Aday at 23-Sep-12 12:56pm
   
No it's not a question at all. "I want" is not a question. There is no description of your problem, no code that demonstrates any kind of a problem and nothing that indicates what kind of mechanism you are using to communicate between your forms.
Bhimani Hiral at 23-Sep-12 13:00pm
   
i give u my whole project ???
.rar file ...??
 
my project is in
visual studio 2008 C# and SQL server 2008
Bhimani Hiral at 23-Sep-12 13:01pm
   
my prject contain only 3 fomrs..only
Wes Aday at 23-Sep-12 13:05pm
   
Why on earth would I want your project? It's simple. Describe your problem, show us what you have tried to do and failed and ask a question related to your problem.
Bhimani Hiral at 23-Sep-12 13:16pm
   
https://dl.dropbox.com/u/10717574/datagridview.png
 
Here is the Image...
my data fill
now i will add On the Add Button
then my Data Will Be Refresh In The Back side of Grid View..
 
and Grid View is in the MDIparent...
 
and my ADD code is ...
 

 

this.Close();
Client_Master_Grid.dtClientMaster.Rows.Clear();
String load = "select ClientID,ClientName,Gender,Age,Address,State,City,Pincode,Phone,Mobile,EmailID,Remark from ClientMasterTbl";
SqlDataAdapter adpt = new SqlDataAdapter(load, conn);
adpt.Fill(Client_Master_Grid.dtClientMaster);
Client_Master_Grid.dgClientMaster.DataSource = Client_Master_Grid.dtClientMaster;
Client_Master_Grid cmg = new Client_Master_Grid();
 
cmg.refresh();
 

 
but refresh is done
but not Instanlty..in back end side

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Please go through the discussion in How to refresh datagridview when closing child form?[^].
The correct answer describes how to refresh Parent GridView from Child forms.
 
Thanks...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 555
1 Sergey Alexandrovich Kryukov 523
2 CPallini 415
3 George Jonsson 231
4 ChauhanAjay 160
0 OriginalGriff 5,450
1 CPallini 4,500
2 Sergey Alexandrovich Kryukov 4,032
3 George Jonsson 3,057
4 Gihan Liyanage 2,445


Advertise | Privacy | Mobile
Web01 | 2.8.140916.1 | Last Updated 23 Sep 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100