Solved

windows app

Posted on 2014-04-23
6
355 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Telerik RadEditor Control Save 8 39
Can Selenium do Load Testing? 2 61
Error in Visual Project 10 49
web api controller with multiple posts that accept different objects 1 25
Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

751 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