Click here to Skip to main content
15,905,563 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
This CLICK HERE[^] have been developed by using some third party component such as C1. As you can see there are are three kinds of rows here...
Type 1. L0000000000000000420 - this kind of row is fetched from database. (Read Only)
Type 2. Enter Amount - this kind of row is for the user to input amount. (this one might also contain drop downlist in some columns) (Editable only when Checked)
Type 3. WHITE ROW- this is just a blank Read Only row for better look and feel.

I want to know is it possible to create similar if not exactly the same kind of DataGridView without using any third party component?
My idea is .. to fetch the rows from database into a DataTable and then loop it ... I am thinking of adding two extra blank rows in the DataTable after each row that has been fetched.

I will also add a column which will have a value such as ,


A - (this is to indicate type 1)
B - (this is to indicate type 2)
C - (this is to indicate type 3)
A
B
C .. so on

I will then check the type of row in a loop and then set property of that row to read only/ editable , color properties accordingly.

But I am not sure if this is practically possible. I am not not sure how am i gonna add combobox for only tpe 2 column. Because if I add a ComboBox column it will be displayed in all three rows. Is this possible? If yes, can you give me some idea how? Thank You.
Posted
Comments
bowlturner 6-Jan-14 12:47pm    
You can try using an row edit template, you might not get the same look but you can get the same functionality with a similar look.

1 solution

It's possible, but it would take a small book to explain everything you had to do to pull it off.

You may want to use a spreadsheet control instead. Something like this[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900