or
namespace GridComboBoxColumn
{
partial class Form1
{
/// <
summary
>
/// Required designer variable.
/// </
summary
>
private System.ComponentModel.IContainer components = null;
/// <
summary
>
/// Clean up any resources being used.
/// </
summary
>
/// <
param
name
=
"disposing"
>true if managed resources should be disposed; otherwise, false.</
param
>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <
summary
>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </
summary
>
private void InitializeComponent()
{
this._grid = new Telerik.WinControls.UI.RadGridView();
((System.ComponentModel.ISupportInitialize)(this._grid)).BeginInit();
this.SuspendLayout();
//
// _grid
//
this._grid.Location = new System.Drawing.Point(13, 13);
this._grid.Name = "_grid";
this._grid.Size = new System.Drawing.Size(259, 237);
this._grid.TabIndex = 0;
this._grid.Text = "radGridView1";
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(284, 262);
this.Controls.Add(this._grid);
this.Name = "Form1";
this.Text = "Form1";
((System.ComponentModel.ISupportInitialize)(this._grid)).EndInit();
this.ResumeLayout(false);
}
#endregion
private Telerik.WinControls.UI.RadGridView _grid;
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Telerik.WinControls.Primitives;
using Telerik.WinControls.UI;
namespace GridComboBoxColumn
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
SetupGrid();
}
private void SetupGrid()
{
// Add Column
{
GridViewComboBoxColumn column = new GridViewComboBoxColumn();
column.Name = "Policy.FaceAmount";
column.HeaderText = "Total Face Amount";
column.ValueMember = "Value";
column.DisplayMember = "Name";
column.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDown;
column.ReadOnly = false;
BindingList<
QuestionSelectionItem
> list = new BindingList<
QuestionSelectionItem
>();
list.Add(new QuestionSelectionItem("Minimum", "MIN"));
list.Add(new QuestionSelectionItem("Maxmimum", "MAX"));
list.Add(new QuestionSelectionItem("Target", "TGT"));
column.DataSource = list;
_grid.Columns.Add(column);
}
// Add Row
{
// First Row
{
GridViewRowInfo row = _grid.Rows.AddNew();
row.Cells["Policy.FaceAmount"].Value = "MIN";
}
// Second Row
{
GridViewRowInfo row = _grid.Rows.AddNew();
row.Cells["Policy.FaceAmount"].Value = "100000";
}
// Third Row
{
GridViewRowInfo row = _grid.Rows.AddNew();
row.Cells["Policy.FaceAmount"].Value = "MAX";
}
}
}
protected class QuestionSelectionItem
{
private string _name = null;
private string _value = null;
public QuestionSelectionItem(string aName, string aValue)
{
_name = aName;
_value = aValue;
}
public string Name
{
get { return _name; }
set { _name = value; }
}
public string Value
{
get { return _value; }
set { _value = value; }
}
}
}
}
using
System;
using
System.Collections.Generic;
using
System.ComponentModel;
using
System.Data;
using
System.Drawing;
using
System.Linq;
using
System.Text;
using
System.Windows.Forms;
using
RadDockMemoryTest.ViewModel;
namespace
RadDockMemoryTest.View
{
public
partial
class
Form1 : Form
{
private
MainViewModel viewModel;
/// <summary>
/// View Model object
/// </summary>
public
MainViewModel ViewModel
{
get
{
if
(viewModel ==
null
)
{
ViewModel =
new
MainViewModel();
}
return
viewModel;
}
set
{ viewModel = value; }
}
/// <summary>
/// Form default constructor
/// </summary>
public
Form1()
{
InitializeComponent();
}
/// <summary>
/// Form load event handler
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private
void
Form1_Load(
object
sender, EventArgs e)
{
setupControlBindings();
}
/// <summary>
/// Setup window's control bindings
/// </summary>
private
void
setupControlBindings()
{
radDock1.DockWindows[
"toolWindow1"
].DataBindings.Add(
"DockState"
, ViewModel,
"ToolWindow1DockState"
,
true
, DataSourceUpdateMode.Never);
}
}
}
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Text;
using
Telerik.WinControls.UI.Docking;
namespace
RadDockMemoryTest.ViewModel
{
public
class
MainViewModel : ViewModelBase
{
private
DockState toolWindow1DockState;
/// <summary>
/// Controls toolWindow1's dock state
/// </summary>
public
DockState ToolWindow1DockState
{
get
{
return
toolWindow1DockState; }
set
{
toolWindow1DockState = value;
OnPropertyChanged(
"ToolWindow1DockState"
);
}
}
}
}
Hi
I would like to build an application like the Integration Business cards example Could you tell me how to construct or add a gallery to a form?
radGridViewSaleReport.DataSource = myList;
//binding list
HtmlViewDefinition view =
new
HtmlViewDefinition();
view.RowTemplate.Rows.Add(
new
RowDefinition());
view.RowTemplate.Rows.Add(
new
RowDefinition());
view.RowTemplate.Rows[0].Cells.Add(
new
CellDefinition(
"Customer Name"
));
view.RowTemplate.Rows[0].Cells.Add(
new
CellDefinition(
"Unit"
));
view.RowTemplate.Rows[0].Cells.Add(
new
CellDefinition(
"Unit Type"
));
view.RowTemplate.Rows[0].Cells.Add(
new
CellDefinition(
"Unit Area"
));
view.RowTemplate.Rows[0].Cells.Add(
new
CellDefinition(
"Price/Sq.M."
));
view.RowTemplate.Rows[0].Cells.Add(
new
CellDefinition(
"Selling Price"
));
view.RowTemplate.Rows[0].Cells.Add(
new
CellDefinition(
"Initial booking"
));
view.RowTemplate.Rows[0].Cells.Add(
new
CellDefinition(
"Booking"
));
view.RowTemplate.Rows[0].Cells.Add(
new
CellDefinition(
"Signing Contract"
));
view.RowTemplate.Rows[0].Cells.Add(
new
CellDefinition(
"Contract signed"
));
view.RowTemplate.Rows[0].Cells.Add(
new
CellDefinition(
"Transfer"
));
view.RowTemplate.Rows[0].Cells.Add(
new
CellDefinition(
"Sale"
));
view.RowTemplate.Rows[0].Cells.Add(
new
CellDefinition(
"Comment"
));
view.RowTemplate.Rows[1].Cells.Add(
new
CellDefinition(
"Amount"
));
view.RowTemplate.Rows[1].Cells.Add(
new
CellDefinition(
"Date"
));
view.RowTemplate.Rows[1].Cells.Add(
new
CellDefinition(
"Amount"
));
view.RowTemplate.Rows[1].Cells.Add(
new
CellDefinition(
"Date"
));
view.RowTemplate.Rows[1].Cells.Add(
new
CellDefinition(
"Amount"
));
view.RowTemplate.Rows[1].Cells.Add(
new
CellDefinition(
"Date"
));
view.RowTemplate.Rows[1].Cells.Add(
new
CellDefinition(
"Amount"
));
view.RowTemplate.Rows[1].Cells.Add(
new
CellDefinition(
"Date"
));
view.RowTemplate.Rows[0].Cells[0].RowSpan = 2;
view.RowTemplate.Rows[0].Cells[1].RowSpan = 2;
view.RowTemplate.Rows[0].Cells[2].RowSpan = 2;
view.RowTemplate.Rows[0].Cells[3].RowSpan = 2;
view.RowTemplate.Rows[0].Cells[4].RowSpan = 2;
view.RowTemplate.Rows[0].Cells[5].RowSpan = 2;
view.RowTemplate.Rows[0].Cells[9].RowSpan = 2;
view.RowTemplate.Rows[0].Cells[11].RowSpan = 2;
view.RowTemplate.Rows[0].Cells[12].RowSpan = 2;
view.RowTemplate.Rows[0].Cells[6].ColSpan = 2;
view.RowTemplate.Rows[0].Cells[7].ColSpan = 2;
view.RowTemplate.Rows[0].Cells[8].ColSpan = 2;
view.RowTemplate.Rows[0].Cells[10].ColSpan = 2;
radGridViewSaleReport.Update();
this
.radGridViewSaleReport.ViewDefinition = view;
this
.radGridViewSaleReport.TableElement.CellSpacing = -1;
this
.radGridViewSaleReport.TableElement.RowSpacing = -1;