Using Same Datagrid for Different Data


J

Jim Mitchell

I am able to use the same datagrid to show two different sets of data.
These seemed efficient to me.

But what if I want the first column to be a "Select Button" for one set of
data. For the second set of data I want only column 3 to be a "Select
Button". In other words, I want the user to be able to pick an item from
column 1 to view the bound text boxes in view 1 and I want the user to click
on column 3 to view the data for bound textboxes in my alternate view.

Can I set whether a colum is just data or used to select the row at run
time?

Thanks in advance.

Jim

Select Case page_name

Case "Contacts"

sql_string = "Select Contact, Phone from tblContacts where
CompanyID=" & txtID.Text

Case "Opportunities"

sql_string = "Select OppName, OppValue, Probability from tblOpps
where ID<200"

End Select

daAccountPages = New SqlClient.SqlDataAdapter(sql_string, Me.SqlConnection1)

daAccountPages.Fill(dsAccountPages)

dgAccountPages.DataSource = dsAccountPages

dgAccountPages.DataBind()
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top