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

What .NET component is this (as seen in SQL Server install)?

Status
Not open for further replies.

JFoushee

Programmer
Oct 23, 2000
200
US
I watched an install of SQL Server 2005...

As it ran through requirements, a grid populated with results.

Each row contained a green-checkbox or red-X image in one column, some short text in the next, and truncated hyperlink text in the next.

Clicking on the hyperlink in the third column, a small window popped-up with the full contents of the text.

Is this a .NET component I can use in my project? If so, what's its name?
 
A DataGridView with an image column, a text column, and a hyperlink column. As an example, below is the codebehind of a datagridview I put together that is similar. All this exists in my Form.Load event, because I am loading the datagridview when the form is opened.

If memory serves, the datagridview can really accept any datatype as a column, as long as you add it via code. The wizard/designer interface for the datagridview only allows five or six column types...

Code:
        ' Set up my connection information
        Dim con As New SqlConnection(My.Settings.conApps)
        Dim com As New SqlCommand("", con)
        com.CommandType = CommandType.StoredProcedure

        ' Define my datatable to be displayed
        Dim dt As DataTable
        dt = New DataTable
        dt.Columns.Add("ItemPicture", GetType(Image))
        dt.Columns.Add("PartNumber", GetType(String))
        dt.Columns.Add("PartDescription", GetType(String))
        dt.Columns.Add("Available", GetType(Int32))
        dt.Columns.Add("Used", GetType(Int32))
        dt.Columns.Add("ImagePath", GetType(String))

        ' Set the datasource for the datagridview to the datatable I just created
        ' Set some column formatting so my datagridview looks the way I want it to
        Me.dgvItemsList.DataSource = dt
        Me.dgvItemsList.Columns("ImagePath").Visible = False
        Me.dgvItemsList.Columns("PartNumber").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
        Me.dgvItemsList.Columns("PartDescription").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
        Me.dgvItemsList.Columns("Available").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
        Me.dgvItemsList.Columns("Used").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
        Me.dgvItemsList.Columns("ItemPicture").Width = 100
        Me.dgvItemsList.Columns("PartNumber").FillWeight = 20
        Me.dgvItemsList.Columns("PartDescription").FillWeight = 60
        Me.dgvItemsList.Columns("Available").FillWeight = 10
        Me.dgvItemsList.Columns("Used").FillWeight = 10
        Me.dgvItemsList.Columns("ItemPicture").HeaderText = "Item Picture"
        Me.dgvItemsList.Columns("PartNumber").HeaderText = "Part Number"
        Me.dgvItemsList.Columns("PartDescription").HeaderText = "Part Description"
        Me.dgvItemsList.Columns("ItemPicture").ReadOnly = True
        Me.dgvItemsList.Columns("PartNumber").ReadOnly = True
        Me.dgvItemsList.Columns("PartDescription").ReadOnly = True
        Me.dgvItemsList.Columns("Available").ReadOnly = True

        ' Define my storedprocedure that returns the data I want to display
        ' Loop through each record and add it to the DATATABLE...which in turn causes it to be displayed in the datagridview on the form
        com.CommandText = "HandTruckPartsTracking.GetItemList"
        con.Open()
        dr = com.ExecuteReader
        While dr.Read
            Dim r As DataRow = dt.NewRow
            r.Item(0) = ResizeImage(Image.FromFile(dr("ImagePath").ToString), 100, 100)
            r.Item(1) = dr("PartNumber").ToString
            r.Item(2) = dr("PartDescription").ToString
            r.Item(3) = Convert.ToInt32(dr("CurrentInventory").ToString)
            r.Item(4) = 0
            r.Item(5) = dr("ImagePath").ToString
            dt.Rows.Add(r)
        End While
        con.Close()

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
VB.NET Programmer
 
Ok, thanks! I wasn't aware it was that simple.
I'll check it out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top