C # Windows Forms - DataRepeater "Template-Based" Binding?

I usually work with web forms, but I have a project that requires a Windows form. I need to display data using the DataRepeater control, however, I cannot directly bind to the data source, since I need to “massage” the data before it is displayed. Using a version of the datarepeater web form, this can be achieved by using an ItemTemplate and passing the returned data item to a public method, for example, as I pass it to the GetModel method in the example below. How can I accomplish something similar in the form of a window?

<ItemTemplate> <asp:Label ID="lbAsModel" runat="server" Text='<%# GetModel(Convert.ToInt32(Eval("ALAN8"))) %>' CssClass="repGridText" /> </ItemTemplate> 
+4
source share
3 answers

The Microsoft.VisualBasic.PowerPacks assembly contains the DataRepeater class for Winforms .

+1
source

Just bind it to massive data ...

+1
source

You can format the associated data for display by handling the Format event in the Binding class. You just need to add your bindings manually (without using a constructor).

Here is the MSDN page with an example .

0
source

Source: https://habr.com/ru/post/1380205/


All Articles