473,405 Members | 2,185 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Which is best control to use?

MM
Hi,

I have a data structure like this:-
Param1 Param2 Param3 etc
[0] 0 15.2 10.0
[1] 5 8.4 50.0
etc.
Basically I need a spreadsheet like control to display/modify this data.
The DataGrid control seems to have a strong bias to db stuff (or am I
wrong on this?). Does C# have just a simple grid control? Thanks, matthew.
Nov 17 '05 #1
2 1283
Yes, you can use the grid control.

However, I would recommend using the Listview control, and setting the
view mode to details. Here is a simple example of how to populate a
listview control with the data structure above.

ListView curData = new ListView();
curData.View = System.Windows.Forms.View.Details;
curData.GridLines=true;
curData.Location = new Point(5,5);
curData.Size=new Size(200,200);

curData.Columns.Add("Param1",50,System.Windows.For ms.HorizontalAlignment.Center);
curData.Columns.Add("Param2",50,System.Windows.For ms.HorizontalAlignment.Center);
curData.Columns.Add("Param3",50,System.Windows.For ms.HorizontalAlignment.Center);

/*
Of course you will need to read this data from an source,
so you will be using the looping mechanism to create each row.
*/
ListViewItem curItem = new ListViewItem("0");
curItem.SubItems.Add("15.2");
curItem.SubItems.Add("10.0");

curData.Items.Add(curItem);

curItem = new ListViewItem("50");
curItem.SubItems.Add("8.4");
curItem.SubItems.Add("50.0");

curData.Items.Add(curItem);

this.Controls.Add(curData);

Nov 17 '05 #2
Of course you could also use the Excel sheet object and minuplate the
data as excel data ... just another idea :)

Issam Qadan

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

131
by: Peter Foti | last post by:
Simple question... which is better to use for defining font sizes and why? px and em seem to be the leading candidates. I know what the general answer is going to be, but I'm hoping to ultimately...
1
by: Eva | last post by:
Hi all, I just wanted some advise on what control is best to use in my situaton. What i am trying to achieve is to allow the user to enter 1 or more room names into a control of some sort so...
17
by: lawrence | last post by:
How is it possible that the question "How do I detect which browser the user has" is missing from this FAQ: http://www.faqts.com/knowledge_base/index.phtml/fid/125 and is only here on this...
22
by: DraguVaso | last post by:
Hi, For my application I need the following behavior: When I press F4 the cursor has to move to the next line in my multiline textbox which begins with "0". Finding lines starting with 0 isn't...
4
by: mflll | last post by:
I am looking into the different techniques of handling arrays of edit boxes in Java Script. The first program below works fine. However, are there better ways of doing this, where the person...
5
by: BK | last post by:
We've got a fairly large scale development process under way in .NET 2003. We are about a month away from go-live for phase 1, second phase is rather short and all work should be completed in the...
4
by: Ned Balzer | last post by:
Hi all, I am pretty new to asp.net; I've done lots of classic asp, but am just beginning to get my mind wrapped around .net. What I'd like to do is include some code that tests if a user is...
15
by: mc | last post by:
I'm writing an app for managing Task Lists, I'm trying to add some controls to a form that I can use to link tasks, my original intention was to: - Add two list boxes, one listing "all Tasks"...
2
by: Gugale at Lincoln | last post by:
Hi, I am creating a user control which has a radio button and few other controls. I would like the user control to behave like a radio button, in the sense when added to a container radio button...
2
by: Steve Swift | last post by:
I don't have a particular webpage to point you to; I thought about this whilst walking my dog this morning and don't have an example page. That said, this question doesn't really require a...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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,...

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.