Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataGrid TableStyle 1

Status
Not open for further replies.

sp76

Programmer
Jul 1, 2003
59
AU
Question 1

I am binding a DataGrid to DataSource as follows:

DA = New SqlDataAdapter("SELECT * FROM Employees", myConn)
DA.Fill(DS, "Employees")

myDataGrid1.SetDataBinding(DS, "Employees")

Does a TableStyles gets created in this case?


Question 2

How to ascertain how many TableStyle exists in a DataGrid?
 
Answer 1
Nope. In this case Datagrid will just display all the columns that SELECT is going to return and won't use/create any tablestyles to render this.

Answer 2
Try using

Code:
DataGrid1.TableStyles.Count
This will return you the # of tableStyles associated to a datagrid. Yes, I know what you are thinking, Count is not displayed in the intellisense so how do we use it, don't know why it is not coming up in intellisense, but if you try this will return you the correct tablestyle count associated.

-Kris
 
Kris,

Even I was looking for something similar to question #2 and I didn't know that there was a "hidden" property :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top