Click here to Skip to main content
15,891,633 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: showing multiple rows in a usercontrol without using grid like control Pin
Turquoise748-Jul-09 2:39
Turquoise748-Jul-09 2:39 
GeneralRe: showing multiple rows in a usercontrol without using grid like control Pin
Henry Minute8-Jul-09 3:18
Henry Minute8-Jul-09 3:18 
GeneralRe: showing multiple rows in a usercontrol without using grid like control Pin
Turquoise748-Jul-09 3:34
Turquoise748-Jul-09 3:34 
GeneralRe: showing multiple rows in a usercontrol without using grid like control Pin
Henry Minute8-Jul-09 3:51
Henry Minute8-Jul-09 3:51 
GeneralRe: showing multiple rows in a usercontrol without using grid like control Pin
Turquoise748-Jul-09 4:03
Turquoise748-Jul-09 4:03 
QuestionRe: showing multiple rows in a usercontrol without using grid like control Pin
Turquoise748-Jul-09 6:01
Turquoise748-Jul-09 6:01 
AnswerRe: showing multiple rows in a usercontrol without using grid like control Pin
Henry Minute8-Jul-09 6:14
Henry Minute8-Jul-09 6:14 
GeneralRe: showing multiple rows in a usercontrol without using grid like control [Solved] Pin
Turquoise748-Jul-09 7:21
Turquoise748-Jul-09 7:21 
Thank you Henry.

I think i got it work. Whenever i complete the control i will publish here.


there are two controls
1) child
2) parent

Child control has a unbound bindingsource and some textbox which are their databinding.text property set to some columns in the database(via code), see below.

Public Sub InitializeCard(ByVal ct As DataRowView)
    Me.OrderMasterID.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.BindingSource1, "OrderMasterID", True))
    Me.productID.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.BindingSource1, "ProductID", True))

    BindingSource1.Clear()
    BindingSource1.Add(ct)
End Sub




i created new control (parent for cardcontrols) with datasource and datamember properties
added flowlayout control to this parent control
added bindingsource to parent control
and i connected a dataset to bindingsource
Whenever databindingcomplete of this bindingsource it runs PopulateCards method
Public Sub PopulateCards()
       FlowLayoutPanel1.Controls.Clear()
       FlowLayoutPanel1.SuspendLayout()


       For x As Integer = 0 To BindingSource1.List.Count - 1
          Dim card As New CardControl
          card.InitializeCard(DirectCast(BindingSource1.List.Item(x), DataRowView))
          FlowLayoutPanel1.Controls.Add(card)
       Next

       FlowLayoutPanel1.ResumeLayout()
   End Sub



this basically enumerates datarowviews in the dataset
then it creates a new card for each datarowview
each datarowview get bound to bindingsource of the new created card
each controls in the card bound to card's bindingsource

and it works.

modified on Wednesday, July 8, 2009 1:36 PM

GeneralRe: showing multiple rows in a usercontrol without using grid like control [Solved] Pin
Henry Minute8-Jul-09 8:49
Henry Minute8-Jul-09 8:49 
GeneralRe: showing multiple rows in a usercontrol without using grid like control [Solved] Pin
Turquoise748-Jul-09 9:44
Turquoise748-Jul-09 9:44 
GeneralRe: showing multiple rows in a usercontrol without using grid like control [Solved] Pin
Henry Minute8-Jul-09 9:45
Henry Minute8-Jul-09 9:45 
GeneralRe: showing multiple rows in a usercontrol without using grid like control [Solved] Pin
Turquoise748-Jul-09 12:19
Turquoise748-Jul-09 12:19 
GeneralRe: showing multiple rows in a usercontrol without using grid like control [Solved] Pin
Henry Minute8-Jul-09 12:51
Henry Minute8-Jul-09 12:51 
GeneralRe: showing multiple rows in a usercontrol without using grid like control [Solved] Pin
Turquoise749-Jul-09 1:08
Turquoise749-Jul-09 1:08 
QuestionHow to pass multiple parameters while invoking a process Pin
Fadi Yoosuf7-Jul-09 22:19
Fadi Yoosuf7-Jul-09 22:19 
AnswerRe: How to pass multiple parameters while invoking a process Pin
Luc Pattyn7-Jul-09 22:39
sitebuilderLuc Pattyn7-Jul-09 22:39 
GeneralRe: How to pass multiple parameters while invoking a process Pin
Fadi Yoosuf7-Jul-09 23:04
Fadi Yoosuf7-Jul-09 23:04 
GeneralRe: How to pass multiple parameters while invoking a process Pin
Luc Pattyn8-Jul-09 0:21
sitebuilderLuc Pattyn8-Jul-09 0:21 
QuestionI have serious problem with dataAdapter.Update(..) Pin
Oshtri Deka7-Jul-09 22:01
professionalOshtri Deka7-Jul-09 22:01 
AnswerRe: I have serious problem with dataAdapter.Update(..) Pin
brock20099-Jul-09 4:17
brock20099-Jul-09 4:17 
GeneralRe: I have serious problem with dataAdapter.Update(..) Pin
Oshtri Deka9-Jul-09 20:06
professionalOshtri Deka9-Jul-09 20:06 
AnswerRe: I have serious problem with dataAdapter.Update(..) Pin
PIEBALDconsult9-Jul-09 6:18
mvePIEBALDconsult9-Jul-09 6:18 
GeneralRe: I have serious problem with dataAdapter.Update(..) Pin
Oshtri Deka9-Jul-09 20:02
professionalOshtri Deka9-Jul-09 20:02 
QuestionSet edit mode to all cells in a datagridview Pin
Anbarasan.Thangaraju7-Jul-09 20:45
Anbarasan.Thangaraju7-Jul-09 20:45 
AnswerRe: Set edit mode to all cells in a datagridview Pin
K03067-Jul-09 22:47
K03067-Jul-09 22:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.