Solved

windows app

Posted on 2014-04-23
6
343 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 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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
ASP.net VB.net Email  a webpage 3 26
Code enhancement 5 14
C# Error - Add Failed 12 53
Iterate two lists and remove inactive 11 38
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
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 …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now