Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > Scenario for Dynamic Data Population for Grid View!
 

Scenario for Dynamic Data Population for Grid View!

Hi Friends

i load a page with the following:

1. a drop down list, a button labeled search, Grid View, Form View, and someother miscellaneous controls for specifyingadvanced search criterias, like date, and supplier.

2. X selects an item from the drop down list, and clicks on search.

3. the system loads the requested data that match to X query, it loads it to the grid view, however, not all the fields are displayed in the grid view, therefore, he clicks to select one record, and.

4. the remaining data will be displayed in the form view.

Statement of the Problem:

the items inside the drop down list represents entities in the database, moreover, between them, there are some common fields, but in general, they don't have all the same fields.

so far, i have created data source that is populated dynamically for each item to display the result set for X query.

- How could i populate one grid view andalso one form view- durring run time- with diffrent fields for diffrent entities?

THX in advanced

'X is an actor'
Ammar_HAKIEM  Wednesday, April 02, 2008 8:12 AM

I don't think so, i have already found the soloution, u wanna see it!

SqlDataSource2.SelectCommand = selClause

counter = gVRoamingRecords.Columns.Count

i = counter - 1

Do

gVRoamingRecords.Columns.RemoveAt(i)

i -= 1

Loop While i <> 0

gVRoamingRecords.AutoGenerateColumns = True

gVRoamingRecords.DataBind()

Ammar_HAKIEM  Wednesday, April 02, 2008 3:23 PM
Please ask asp.net questions in the asp.net forums. http://forums.asp.net
Ken Tucker  Wednesday, April 02, 2008 2:28 PM

I don't think so, i have already found the soloution, u wanna see it!

SqlDataSource2.SelectCommand = selClause

counter = gVRoamingRecords.Columns.Count

i = counter - 1

Do

gVRoamingRecords.Columns.RemoveAt(i)

i -= 1

Loop While i <> 0

gVRoamingRecords.AutoGenerateColumns = True

gVRoamingRecords.DataBind()

Ammar_HAKIEM  Wednesday, April 02, 2008 3:23 PM

You can use google to search for other answers

Custom Search

More Threads

• i want leave event but there is no leave event
• images in combobox with binding source
• Change databinding of a single datagridviewcell
• Programmatically changing value/Operation is not valid due to the current state of the object
• Keeping selected rows when sorting a DataGridView?
• Getting a databound label to display based on a variable's value
• Binding System.Console with a TextBox
• MonthCalendar databinding help needed
• Check box data binding, AddNew doesn't work
• Binding on ComboBox.SelectedValue - no Format-Event sent