Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 29th, 2003, 12:43 AM
Authorized User
 
Join Date: Sep 2003
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default datagrid

How can i get the height of the each row in the datagrid?

thanks
 
Old September 29th, 2003, 01:53 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Are you talking about the visual height? You can't to my knowledge. The datagrid is rendered as an HTML table so the browser determines how high the rows will be based on general dimensions of the browser window, the styles applied to the contents of the cells, etc.

Peter
 
Old September 30th, 2003, 09:29 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

you can put an image spacer in there like this
<tr>
<td><img src="/images/" height="25" width="0"></td>
<td>put stuff here</td>
</tr>


but doing it this way you will have to manually create the output of the table like this:

Dim strResultsHolder As String
        strResultsHolder = "<table width=""97%"" border=""1"" cellpadding=""0"" cellspacing=""0"" align=""center"">"
        strResultsHolder &= "<tr>"
        strResultsHolder &= "<th bgcolor=""#C0C0C0"" width=""60"">Date</th>" & _
        "<th bgcolor=""#C0C0C0"">Event</th>" & _
        "<th bgcolor=""#C0C0C0"">Time</th>" & _
        "<th bgcolor=""#C0C0C0"" width=""110"">Location</th>" & _
        "</tr>"

        Dim r As DataRow
        Dim curdate, curmonth
        Dim dates

        curdate = objDataSet.Tables(0).Rows(0)(0).ToString()
        curmonth = MonthName(DatePart("m", curdate)) & " " & DatePart("yyyy", curdate)
        strResultsHolder &= "<tr><td colspan=""4"" bgcolor=""#99CCFF"">" & curmonth & "</td></tr>"

        For Each r In objDataSet.Tables(0).Rows
            If curmonth <> MonthName(DatePart("m", r("event_date"))) & " " & DatePart("yyyy", r("event_date")) Then
                curmonth = MonthName(DatePart("m", r("event_date"))) & " " & DatePart("yyyy", r("event_date"))
                strResultsHolder &= "<tr><td colspan=""4"" bgcolor=""#99CCFF"">" & curmonth & "</td></tr>"
            Else
            End If

            dates = WeekdayName(DatePart("w", r("Event_date")), True) & ", " & DatePart("d", r("Event_date"))
            strResultsHolder &= "<tr><td>" & dates & "</td>" & _
                                "<td>" & r("event") & "</td>" & _
                                "<td>" & r("event_time") & "&nbsp;</td>" & _
                                "<td>" & r("location") & "&nbsp;</td>" & _
                                "</tr>"
        Next

        strResultsHolder &= "</table>"
        display.InnerHtml = strResultsHolder





Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom paging in Datagrid with datagrid page count madhusrp ASP.NET 1.0 and 1.1 Professional 12 June 2nd, 2008 01:15 PM
User COntrol Datagrid inside datagrid rodmcleay ASP.NET 1.0 and 1.1 Professional 3 April 14th, 2007 10:11 AM
Creating DataGrid In Repeater/DataGrid liduwan ASP.NET 1.0 and 1.1 Professional 9 March 6th, 2007 03:31 PM
datagrid ajaidass ADO.NET 2 March 1st, 2007 05:36 PM
Need help regarding datagrid ngsharmila .NET Framework 1.x 1 February 1st, 2006 12:55 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.