Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

windows app

Posted on 2014-04-23
6
Medium Priority
?
360 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
  • 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 2000 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
Independent Software Vendors: 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!

 
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses
Course of the Month13 days, 10 hours left to enroll

963 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