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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Casting the number of records 1

Status
Not open for further replies.

peekay

Programmer
Oct 11, 1999
324
ZA
I have the number of records from a executescalar query. Now I wish to resize my datagrid.height to 30 times this number, but I am unable to cast the number of rows * 30 to height in pixels. It says the type integer cannot be converted to system.web.ui.webcontrols.unit
Can someone please help me.
Thanks

PK Odendaal
 
Here ya go, dont know why you want to do that, but...
Code:
  Dim ds As New DataSet()
  myCommand.Fill(ds)

  MasterGrid.DataSource = ds
  MasterGrid.DataBind()
     Dim intMultiplier As Integer = ds.Tables(0).Rows.Count 
     Dim intCalc As Integer = intMultiplier * 30
  MasterGrid.Height = unit.pixel(intCalc)
 
Or just...

Dim intCalc As Integer = ds.Tables(0).Rows.Count * 30
dg.height = unit.pixel(intCalc)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top