473,568 Members | 2,923 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

winform table

27 New Member
Hi !
I want to show a table in the user form
Every line represents the fields of one costumer
The user enters the values for each entry in a line.
I have used :
TableLayoutPane l , and put the buttons in the cells of it.

In the user form, I don't see the table cell borders.
usualy, it is good,
But I wanted the user to see it in a table
my questions are :
1. I have defined the property "cellBorderStyl e" (of the TableLayoutPane l) : to single or any other value.
Then it got crazy and started jumping all the time !
Is it a Microsoft bug ? am I doing something wrong ?
2. Is there a better standard way to do it ?
3. a different issue:
I dont want to copy all the buttons from line to line
Will at work with an array of buttons ?
How will I combine it to the code that is generated automaticall ??
Apr 13 '11 #1
4 3453
adriancs
122 New Member
em.. your question is not clear.

what do you mean by

"it got crazy and started jumping all the time !"

what is started jumping? and define "crazy".

Your problem is, the DataGridView won't show up the cell border? and now you want to make it shown?
Apr 30 '11 #2
gilit golit
27 New Member
1. The answer is WindowsGridView

2. all the form screan was jumping. some bug (?). But it is not relevant
May 1 '11 #3
adriancs
122 New Member
**Update Post(2/5/2011):
Hi, I have forgot to add the difinition/declaration of the variable "buttons" in the code below. Please take note of that.
**End of Update(2/5/2011)

If you wish the user to enter values for each entry in a line, using DataGridView is a better choice.

DataGridView is much easier to handle than using TableLayoutPane l.

If you don't want the TableLayoutPane l to resize automatically, you can disable it by this command:

this.tableLayou tPanel1.AutoSiz e = false;

or you can adjust the grow and shrink properties with this:

this.tableLayou tPanel1.AutoSiz eMode = System.Windows. Forms.AutoSizeM ode.GrowOnly;
or
this.tableLayou tPanel1.AutoSiz eMode = System.Windows. Forms.AutoSizeM ode.GrowAndShri nk;

This will allow you do add button programatically into TableLayoutPane l, you can do it with this:
Expand|Select|Wrap|Line Numbers
  1. Button button1;
  2.  
  3. // Update(2/5/2011): I have missed out this line
  4. List<Button> buttons = new List<Button>();
  5. // End of update(2/5/2011)
  6.  
  7. void CreateNewButton()
  8. {
  9.     buttons.Add(button1);
  10.     int i = buttons.Count - 1;
  11.     buttons[i] = new Button();
  12.     buttons[i].Click += new EventHandler(buttons_Click);
  13.     buttons[i].Text = "button" + buttons.Count;
  14.     this.tableLayoutPanel1.Controls.Add(buttons[i]);
  15. }
  16.  
  17. void buttons_Click(object sender, EventArgs e)
  18. {
  19.     // Do something
  20. }
May 1 '11 #4
adriancs
122 New Member
Hi, I have forgot to add the difinition/declaration of the variable "buttons" in the code below. Please take note of that.

This line has been added to the code above:

List<Button> buttons = new List<Button>();
May 2 '11 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
5565
by: Udi | last post by:
Hi everyone! I have a major problem with the DataGrid control for the Windows Form! I am using the DataAdapter to get data from Sql Server 2000 DataBase and populating a DataGrid with the Table i got. The problem is that i dont want to see all the table columns in the DataGrid, only some of it, how can i hide those unwanted columns? I...
3
2373
by: Elliot Rodriguez | last post by:
Hi: I am writing a WinForm app that contains a DataGrid control and a StatusBar control. My goal is to update the status bar using events from a separate class, as well as some other simple things. The method I am writing queries a large dataset. As part of my feedback to the user, I am updating the status bar when the connection is made...
8
13703
by: Woody Splawn | last post by:
Lets say I have a winform that is populated with a dataset. The dataset and data table may have several rows in it. Lets say I am looking at the winform and I want to assign a value to a certain column in the associated datatable. Lets say there are 10 rows in the table and I am on row 5, and I want to assign the value to row 5, but I don't...
4
1334
by: robboll | last post by:
Please excuse my ignorance, but I am trying to teach myself .Net without a lot of help. At this point I have created a page with a few text boxes and combo boxes that I am using as an example. The page displays nicely with the Requestor, DivMgr, ChgType, Description fields. What I would like to do at this point is create a Save button...
7
4294
by: Yavuz Bogazci | last post by:
i have the following problem: my customer wants to show some informations in a WinForm. He has Images and Textelements with are connected. It should look like this: scroll << - ... Image + Text + empty space + Image + Text + empty space + Image + Text + empty space ... << - scroll to left how can i solve this problem? can i paste images...
1
2312
by: Jon B | last post by:
Hi All! I would like to make my WinForm DataGrid control so that user could easily edit the items in the **related table**. For instance, I have customers table and it has one-to-many relationship with the customerType table. I would like the WinForm DataGrid to display a column with "Customer Type" where users can select the type of...
1
6640
by: Dale Williams | last post by:
Everyone: Using C#, I'm trying to create a datagrid on a winform programatically. I placed the datagrid and the form and named it CHGrid. Here's the code I'm using: // Get and bind the data. QarBusTier.DefectFoundLocation DFL = new QarBusTier.DefectFoundLocation(); System.Data.DataTable DFLTable = DFL.LoadAll();
2
1418
by: J. Clay | last post by:
Developing in VS 2005 I have WinForm app that utilizes several class objects and is databound to a couple of objects. One of the classes uses a timer to query an in memory database every second for changes (Calls from an external application). I am not sure if this has anything to do with it, but for some reason, the memory usage goes up...
0
1064
by: Bruce HS | last post by:
I'd like my VB2005 code to be able to pass my WinForm Table Adapter to an ancestor object for processing (for instance doing generic logic about saving). However, it looks like Table Adapters don't have a class of their own. Is it possible to create a function sort of like this? Function Save(TA As TableAdapter, DS As DataSet)
0
7693
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8118
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7665
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6277
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2105
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1207
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
933
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.