Solved

windows app

Posted on 2014-04-23
6
354 Views
Last Modified: 2014-04-29
What control do I use if I want to display a muti column list of rows and on selection they should trigger an event. I am using windows app in .net
0
Comment
Question by:Moizsaif123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 8

Expert Comment

by:Ganapathi
ID: 40019358
Check out the below link. Hope it helps.

http://msdn.microsoft.com/en-us/library/ez0wd97x(v=vs.80).aspx

Once you added the control, select the required function from the event properties
0
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 500 total points
ID: 40019408
The previous link is for FoxPro. Useless in for a .NET application.

If you are working with a Windows Application, do not post in the ASP.NET topic. ASP.NET is for Web development, not Windows Applications.

You can use a DataGridView or a ListView. A ListBox can also be used in some situations. I would sometimes create a UserControl that I repeat in a FlowLayoutPanel. It depends on the type of data, whether the columns needs to be of fixed widths with line separators, whether you need to react to individual columns or only to the row itself.
0
 
LVL 4

Author Comment

by:Moizsaif123
ID: 40019548
I have decided to go for a GridView but i am facing this error attached. I am receiving on line 60 after setting datasource to the grid.Any fix to this
headerErr.JPG
0
Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

 
LVL 4

Author Comment

by:Moizsaif123
ID: 40019587
Prob resolved...
0
 
LVL 40
ID: 40020196
Sorry, it was the night for me.

You usually do not use DataMember with a DataGridView. It is useful only when the grid is working with a DataSet that has multiple tables.

And by the way, you have made a common mistake. You do not use a DataSet when you have a single table. The role of a DataSet is to maintain relations between many tables. If you have only one, it is useless and simply adds extra overhead.

Simply use a DataTable object and use Fill on that object instead of the DataSet:

DataTable dt = New DataTable();
...
pagingAdapter.Fill(dt);
DataView dvEmp = dt.DefaultView;

Also, do you really need a DataView? If you do not sort or filter later on, the DataView is also useless. You can assign the DataTable directly to the DataSource, so your GetData method could simply return the DataTable.

One of the main advantages of ADO.NET is that it is very versatile and you can use it in many different ways depending on your needs. One of the main disadvantage of ADO.NET is that because of that versatility, the web is full of useless code that everybody copies without really understanding what they are doing, and everybody ends up transmitting that code to everybody else.
0
 
LVL 4

Author Comment

by:Moizsaif123
ID: 40031282
Thanks for the reply, that helped.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question