By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,569 Members | 1,358 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,569 IT Pros & Developers. It's quick & easy.

Moving a control on the page during runtime.

P: n/a
I have a datagrid that I want to move another part of the page. I'm able to
do this but the datagrid looses it's values after the move.

General_DataGrid_CurrentItems is the datagrid name.
I want to move it to a tablecell called tdControls.

this.Controls.Remove(General_DataGrid_CurrentItems );
tdControls.Controls.Add(General_DataGrid_CurrentIt ems);

This works. It moves the datagrid from the bottom of the page to the middle
where my table cell is. Problem is, it looses the values in the datagrid.
Nov 16 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Just change the Location and Size properties...

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Punisher" <Pu******@discussions.microsoft.com> wrote in message
news:F3**********************************@microsof t.com...
I have a datagrid that I want to move another part of the page. I'm able to
do this but the datagrid looses it's values after the move.

General_DataGrid_CurrentItems is the datagrid name.
I want to move it to a tablecell called tdControls.

this.Controls.Remove(General_DataGrid_CurrentItems );
tdControls.Controls.Add(General_DataGrid_CurrentIt ems);

This works. It moves the datagrid from the bottom of the page to the
middle
where my table cell is. Problem is, it looses the values in the datagrid.

Nov 16 '05 #2

P: n/a
> I have a datagrid that I want to move another part of the page. I'm able to
....
where my table cell is. Problem is, it looses the values in the datagrid.


Don't do it.
This is a bad internationalization practice, and if you will
ever need to localize your application is going to hit you.
--
Mihai Nita [Microsoft MVP, Windows - SDK]
------------------------------------------
Replace _year_ with _ to get the real email
Nov 16 '05 #3

P: n/a
Try to put your DataGrid on panel
and move panel
I dont now if it will work
but it seems to it will solve
"Mihai N." <nm**************@yahoo.com> wrote in message
news:Xn********************@207.46.248.16...
I have a datagrid that I want to move another part of the page. I'm able
to

...
where my table cell is. Problem is, it looses the values in the datagrid.


Don't do it.
This is a bad internationalization practice, and if you will
ever need to localize your application is going to hit you.
--
Mihai Nita [Microsoft MVP, Windows - SDK]
------------------------------------------
Replace _year_ with _ to get the real email

Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.