Link to home
Start Free TrialLog in
Avatar of Moiz Saifuddin
Moiz Saifuddin

asked on

windows app

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
Avatar of Ganapathi
Ganapathi
Flag of India image

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
ASKER CERTIFIED SOLUTION
Avatar of Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger)
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Moiz Saifuddin
Moiz Saifuddin

ASKER

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
Prob resolved...
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.
Thanks for the reply, that helped.