Hi All,
I am using VS08 + Windows Forms + c#.In my application i want to show data from database like below,
User Name San User Name Dip Code A1 Code D1 Salary 10000 Salary 5000
User NameAish User NameAbhi Code A2 Code B1 Salary 1000 Salary 50000
I dont have any problem to use any winform control . Which control i have to use and how to show data above?
Thanks in advance.
- Changed TypeLing WangMSFT, ModeratorMonday, March 23, 2009 7:13 AM
-
|
| sunDAC Friday, March 13, 2009 6:58 AM |
Try DataGridView control. Thanks,
A.m.a.L |
| A.m.a.L - aditi.com - Think Product Friday, March 13, 2009 7:07 AM |
Hi Thanks for the reply. How i can use dataGridview to show data like
User Name San User Name Dip Code A1 Code D1 Salary 10000 Salary 5000
User NameAish User NameAbhi Code A2 Code B1 Salary 1000 Salary 50000
In one row how can i show multiple user information?
|
| sunDAC Friday, March 13, 2009 7:15 AM |
I don't think there is any ready made control which can suffice your requirement.
Seems you need to develop your own control.
Or
Read the data from database, place it in a datatable.
Iterate through the rows.
For each row dynamically add controls like labels with the row data. Thanks,
A.m.a.L |
| A.m.a.L - aditi.com - Think Product Friday, March 13, 2009 7:23 AM |
Hi, Is it not possible to use ListView or any control to fullfil my requirement? Or if i want create usercontrol then how can i do this? |
| sunDAC Friday, March 13, 2009 7:31 AM |
You can either use ListBoxView or Gridview to display data. But GridView would be more advantageous in your situation.
Firstly add Columns to gridview control which would hold values lke Username, Code And salary Then bind data(Coming from database) to GridView using DataSource property of GridView.
I will suggest you to go through msdn to get into details of this. You can also read http://msdn.microsoft.com/en-us/library/ms993231.aspx Hope it helps - Proposed As Answer byAgalo Friday, March 13, 2009 7:40 AM
-
|
| Agalo Friday, March 13, 2009 7:40 AM |
If you are not interested in showing data in DataGridView and GridView. I suggest you to use ListView as it is more flexible than list box in showing multi column values. Take a look at the below link:
http://www.java2s.com/Tutorial/CSharp/0460__GUI-Windows-Forms/CreateaListViewItemandaddittoListView.htm
This will help!
Regards, Midnight Programmer |
| Prashant Khandelwal Friday, March 13, 2009 9:58 AM |
Hi,
Could you please tell us why do you want to implement this? May be we can help you find another way to achieve your goal.
Base on my understanding, you need to add the value manually in DataGridView, listbox or other controls, or you need to create your own control.
Best regards,
Ling Wang
Please remember to click “Mark as Answer�on the post that helps you, and to click “Unmark as Answer�if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. |
| Ling Wang Thursday, March 19, 2009 7:59 AM |
We are changing the issue type to “General Discussion�because you have not followed up with the necessary information. If you have more time to look at the issue and provide more information, please feel free to change the issue type back to “Question�by opening the Options list at the top of the post window, and changing the type. If the issue is resolved, we will appreciate it if you can share the solution so that the answer can be found and used by other community members having similar questions. Please remember to click “Mark as Answer�on the post that helps you, and to click “Unmark as Answer�if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. |
| Ling Wang Monday, March 23, 2009 7:12 AM |