Hello Al,
Thank you for sharing your ideas with us.
RadGridView does not have a button text box column out of the box but you can create it on your own. RadGridView provides a flexible mechanism for creating custom cell types with custom content elements. Please refer to the following article: Creating custom cells.
In order to achieve your goal, you can create a custom cell with RadButtonTextBoxElement in it and use this cell in the grid. Following the steps in the provided article I created a custom column in the grid that uses a custom cell with RadButtonTextBoxes:
public partial class RadForm1 : Telerik.WinControls.UI.RadForm
{
public RadForm1()
{
InitializeComponent();
RadButtonTextBoxColumn customColumn = new RadButtonTextBoxColumn("ButtonTextBoxColumn");
this.radGridView1.Columns.Add(customColumn);
this.radGridView1.Columns[0].Width = 200;
for (int i = 1; i <= 10; i++)
{
this.radGridView1.Rows.Add("Item" + i);
}
}
}
public class ButtonTextBoxCell : GridDataCellElement
{
public ButtonTextBoxCell(GridViewColumn column, GridRowElement row) : base(column, row)
{
}
private RadButtonTextBoxElement buttonTextBoxElement;
protected override void CreateChildElements()
{
base.CreateChildElements();
buttonTextBoxElement = new RadButtonTextBoxElement();
RadButtonElement buttonElement = new RadButtonElement();
RadButtonElement buttonElement2 = new RadButtonElement();
buttonElement.Text = "Button1";
buttonElement2.Text = "Button2";
buttonTextBoxElement.RightButtonItems.Add(buttonElement);
buttonTextBoxElement.RightButtonItems.Add(buttonElement2);
this.Children.Add(buttonTextBoxElement);
}
protected override void SetContentCore(object value)
{
this.buttonTextBoxElement.Text = this.Value.ToString();
}
public override bool IsCompatible(GridViewColumn data, object context)
{
return data is RadButtonTextBoxColumn && context is GridDataRowElement;
}
protected override Type ThemeEffectiveType
{
get
{
return typeof(GridDataCellElement);
}
}
}
public class RadButtonTextBoxColumn : GridViewDataColumn
{
public RadButtonTextBoxColumn(string fieldName) : base(fieldName)
{
}
public override Type GetCellType(GridViewRowInfo row)
{
if (row is GridViewDataRowInfo)
{
return typeof(ButtonTextBoxCell);
}
return base.GetCellType(row);
}
}
Note, since creating such custom RadButtonTextBoxColumn is currently achievable with the flexible mechanism that RadGridView offers I will set the feedback item status to declined.
I hope this helps. If you have any further question do not hesitate to contact me.
Regards,
Nadya
Progress Telerik