How to add a colimn in Datagrid at runtime
Hi all, Iwant to know is there any way to add a new column in datagrid depending upon the value of a combobox. I have columns in a table whose names are same as combobox's items names. I need to add that column in datagrid which value is selected by user.
Please help me its urgent
Gaurav arora
Junior Poster in Training
59 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
Thanx for replying, But my motive is to add a new column with database values. How can i do it?
Gaurav arora
Junior Poster in Training
59 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
I have tried it with the coding given above But it is still not adding new column. Plus i want to know how that particular column can be bound with database column
Gaurav arora
Junior Poster in Training
59 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
sorry I couldnt understand ur suggestion. I explain u my problem. I m making a project on Airlines Reservation. Now after selecting source,destination,class and date of travel when user clicks on "Available Flights" button then the flights available on the date selected by user are displayed in the datagrid. The information in the datagrid is : FlightNo, Source, Destination, Departure Time, Arrival Time. Now i want to add another column which exists in the same table as others. That column must be the value selected in class combo box. i.e. Economy,Business or First. But i m unable to do it. Hope u understand my problem
Thnx
Gaurav arora
Junior Poster in Training
59 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
hi,
i am new to .net.
i like to add the datagridview into the datagridview.
please share ur ideas,
karthi_selva
Junior Poster in Training
65 posts since Oct 2008
Reputation Points: 10
Solved Threads: 0
Shilpa88, if you have a problem that you need help with, please look for a relevant thread or start a new one yourself. Please dont add unrelated questions to current threads.
Ryshad
Nearly a Posting Virtuoso
1,307 posts since Aug 2009
Reputation Points: 512
Solved Threads: 246
sorry I couldnt understand ur suggestion. I explain u my problem. I m making a project on Airlines Reservation. Now after selecting source,destination,class and date of travel when user clicks on "Available Flights" button then the flights available on the date selected by user are displayed in the datagrid. The information in the datagrid is : FlightNo, Source, Destination, Departure Time, Arrival Time. Now i want to add another column which exists in the same table as others. That column must be the value selected in class combo box. i.e. Economy,Business or First. But i m unable to do it. Hope u understand my problem
Thnx
Hi,
To my mind, you would want to apply the class as a filter to your Select rather than displaying it as a column. So if they select First class then only flights with First Class are displayed, etc.
I'm trying to get a better idea of the data your working with here. What type of data are you storing in the Economy, Business and First columns?
Ryshad
Nearly a Posting Virtuoso
1,307 posts since Aug 2009
Reputation Points: 512
Solved Threads: 246