Posts
How to create a basic ASP.NET GridView manually–Basic DataBinding
- Get link
- X
- Other Apps
As I am working on some legacy systems and use to give support for them, where one cannot find predefined drag and drop controls, and somewhat have to tailor one for themselves. Today I will share the experience of such practice with all of you (actually it is called manual data binding with a table using a Dataset object) below is the code of an asp.net page A simple page with only one table control as an example: < asp:Table ID ="tblPayment" runat ="server" Font-Names ="arial, helvetica, sans-serif" > </ asp:Table > Now the code behind to bind a DataSet object might look alike below: trow = new TableRow(); tcell = new TableCell(); tcell.Width = 150; lblUserName = new Label(); lblUserName.Text = "Name " ; tcell.Controls.Add(lblUserName); trow.Cells.Add(tcell); // first cell finished // second cell tcell = new...
Dynamically Generating Controls in WPF and Silverlight
- Get link
- X
- Other Apps
Some of the Windows Forms developers I've spoken to have said that one thing they want to learn is how to dynamically create controls in WPF and Silverlight. In this post I'll show you several different ways to create controls at runtime using Silverlight 4 and WPF 4. First, we'll start with how to create controls in XAML. From there, we'll move to dynamically-loaded XAML before we take a look at using the CLR object equivalents. Creating Controls at Design Time in XAML Creating controls using the design surface and/or XAML editor is definitely the easiest way to create your UI. You can use Expression Blend or Visual Studio, depending upon how creative you want to be. If you want a more dynamic layout, you can hide and show panels at runtime. Here's an example layout: <Grid Margin= "10" > <Grid.ColumnDefinitions> <ColumnDefinition Width= "100" /> <ColumnDefinition Width= "*" /> ...