Visualización de registros en varias filas: control DataRepeater de Visual Basic Power Packs

I am developing an application using Visual Basic Power Packs DataRepeater control. For this application, I need to display records in rows. I will have a Image, Textbox and a checkbox for repeater control. I need to display 3 repeater control in one row. Say, If we have 12 records, I need to display it as 4 rows of 3 records.

I would like to display records as in the picture. Can anybody please help me on this?

enter image description here

preguntado el 01 de febrero de 12 a las 03:02

Please refer to the FAQ regarding signatures in questions. -

Thanks Babcock for pointing out. I will take care of it in future. -

1 Respuestas

I think you’re asking the following range of questions here:

  1. How to show pictures, checkbox and textbox in each row in a datarepeater control?

  2. Display the controls in a certain arrangement?

  3. Show pictures base don values selected in the checkbox or textbox.

I’m no expert but the way I did was:

  1. Open Visual studio and open your form in design view
  2. Go to the toolbox and drag a control (Visual basic Powerpacks) DataR epeater control onto your form
  3. Now create a table (in sql server for example) which contains 3 columns, 1 the image locations of all your pictures called ‘ImgLoc’ 2. The name of the pictures ‘Picname’ and 3. A column with 1’s or 0’s called ‘ShowPic’
  4. Go back to your app and create a datasource there, then refresh to view your table in it
  5. Go to the table in your datasource in the app, and drag the table column ‘ImgLoc’ directly onto the repeater where it says something like ‘to create data repeater items….’ This will create a text box displaying the image location
  6. Drag a picture box and check box onto that repeater too
  7. Use the following code to control which pictures the pictureboxes on your repater will point to

    Private Sub DataRepeater1_DrawItem(sender As Object, e As PowerPacks.DataRepeaterItemEventArgs) Handles DataRepeater1.DrawItem

    Dim pic As PictureBox = CType(e.DataRepeaterItem.Controls("PictureBox1"), System.Windows.Forms.PictureBox)

    Dim txt As TextBox = CType(e.DataRepeaterItem.Controls("txtBox1"), System.Windows.Forms.TextBox)

    Pic.ImageLocation = txt.Text

    End Sub

Respondido el 02 de enero de 14 a las 18:01

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.