<
telerik:RadGrid
ID
=
"RadGrid1"
AllowPaging
=
"true"
runat
=
"server"
OnPreRender
=
"RadGrid1_PreRender"
OnItemCommand
=
"RadGrid1_ItemCommand"
OnNeedDataSource
=
"RadGrid1_NeedDataSource1"
height
=
"550px"
PageSize
=
"40"
GridLines
=
"None"
>
<
MasterTableView
EditMode
=
"InPlace"
CommandItemDisplay
=
"Top"
AutoGenerateColumns
=
"true"
>
------------------------------------------------------------------------------------------------
foreach (GridColumn column in RadGrid1.MasterTableView.RenderColumns)
{
if (!string.IsNullOrEmpty(column.UniqueName) && !string.IsNullOrEmpty(column.HeaderText))
{
columncount++;
dt.Columns.Add(column.UniqueName,
typeof(string));
}
}
DataRow dr;
DataTable dtRecords = new DataTable();
foreach (GridDataItem item in RadGrid1.MasterTableView.Items)
{
dr = dt.NewRow();
for (int i = 0; i < columncount + 1; i++)
{
foreach (GridBoundColumn col in RadGrid1.MasterTableView.RenderColumns)
{
var iName = item[col.UniqueName].Text;
if (Regex.IsMatch(iName, @"^[a-zA-Z]*$"))
{
dr[col.UniqueName] = iName;
}
}
I have defined a grid using only AutoGeneratedColumns - bound using OnNeedDataSource. On ItemCommand, I need access to all AutoGeneratedColumns values - but am only able to access the first row. Unsure what I am doing wrong.
Thank you,
SteveO