Hi all, I m making a project on airlines reservation in C#. I have some problem.
The problem is when i accept the values from the user like Origin City,Destination City,Date of travel and class of travel. After filling this information user clicks on the Available Flight button. When clicking on this button application should fetch the values from the database depending upon the source and destination values. (Here is the main problem) If there is more than one flight for a particular route which is very much possible then user has to select the flight on his own. As the number of rows(flights) is not known these should be added at runtime containing a checkbox before every row. I m using Table Layout panel for this purpose. Plus i want to track the values in the row(flight) selected by the user for further processing. Hope u got my problem. Any idea please.

Hi all, I m making a project on airlines reservation in C#. I have some problem.
The problem is when i accept the values from the user like Origin City,Destination City,Date of travel and class of travel. After filling this information user clicks on the Available Flight button. When clicking on this button application should fetch the values from the database depending upon the source and destination values. (Here is the main problem) If there is more than one flight for a particular route which is very much possible then user has to select the flight on his own. As the number of rows(flights) is not known these should be added at runtime containing a checkbox before every row. I m using Table Layout panel for this purpose. Plus i want to track the values in the row(flight) selected by the user for further processing. Hope u got my problem. Any idea please.

Use datagrid or gridview controls, you can easily do this task. What is table layout panel. Is it the panel control ?

Table layout panel is good, but not for something like this due to the number of rows you might have with dynamic sizing. Use a gridview and add a checkbox column to the row that the user can edit.

Thanx for replying, Now i m using DataGridView with a checkBox column But now i m facing another problem. How i will come to know which checkBox user has checked and to trap the values of that particular row

When they are being loaded assign the id to either the tag of the row, or in a column.

Assuming you are waiting until a save or submit button is pressed, loop back through all the rows of the gridview. Get the checkbox column for each of the rows and get the id column or tag as well. Then you can pass those values on.

Can u please Give some code for that plz

Hi dickersonka, Can u plz post some code to trap which checkbox has been checked and how to trap that row
Its urgent plz

This should work. This will get the value of the column for a row. You can do the looping.

obj val = this.dgvFiles.Rows[0].Cells["checkBoxColumn"].Value;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.