Hi.
I have a RadGrid with the following settings:
When we autogenerate columns from a DataTable everything works as expected:
http://dl.dropbox.com/u/4552022/workinggrid.png
But when i try to add the columns in code:
I get this:
http://dl.dropbox.com/u/4552022/notworkinggrid.png
And also, doubleklicking a row is supposed to give editmode:
http://dl.dropbox.com/u/4552022/edit.png
But when adding columns manually it gives this error:
http://dl.dropbox.com/u/4552022/error.png
When manually creating columns, they are created like this:
The reason for doing this manually, is to enable the possiblity for dropdownColumns.
Any ideas?
I have a RadGrid with the following settings:
<
telerik:RadGrid
ID
=
"genericGrid"
runat
=
"server"
AutoGenerateColumns
=
"false"
AllowAutomaticDeletes
=
"false"
AllowSorting
=
"true"
AllowAutomaticInserts
=
"false"
AllowAutomaticUpdates
=
"true"
OnDataBound
=
"DataBoundGenericGrid"
AllowCustomPaging
=
"true"
PageSize
=
"100"
AllowPaging
=
"True"
AutoGenerateEditColumn
=
"true"
AllowFilteringByColumn
=
"true"
AllowMultiRowSelection
=
"true"
OnUpdateCommand
=
"ItemUpdatedEvent"
OnCancelCommand
=
"ItemCanceledHandler"
OnInsertCommand
=
"ItemInsertedEvent"
OnEditCommand
=
"ItemEditHandler"
OnItemDataBound
=
"ItemDataBoundEvent"
OnNeedDataSource
=
"GridNeedDataSource"
Style="height: 600;
width: 100%">
<
ClientSettings
AllowDragToGroup
=
"true"
AllowGroupExpandCollapse
=
"true"
>
<
Selecting
AllowRowSelect
=
"true"
EnableDragToSelectRows
=
"false"
/>
<
Scrolling
AllowScroll
=
"true"
UseStaticHeaders
=
"true"
/>
<
ClientEvents
OnRowDblClick
=
"RowDblClick"
/>
</
ClientSettings
>
<
MasterTableView
AutoGenerateColumns
=
"true"
AllowAutomaticDeletes
=
"false"
AllowFilteringByColumn
=
"true"
AllowAutomaticInserts
=
"false"
AllowAutomaticUpdates
=
"true"
GridLines
=
"Vertical"
TableLayout
=
"Fixed"
GroupLoadMode
=
"Client"
EditMode
=
"InPlace"
/>
</
telerik:RadGrid
>
genericGrid.DataSource = table.DefaultView;
http://dl.dropbox.com/u/4552022/workinggrid.png
But when i try to add the columns in code:
foreach
(var gridColumn
in
_gridColumns)
{
genericGrid.Columns.Add(gridColumn);
}
genericGrid.DataSource = table.DefaultView;
I get this:
http://dl.dropbox.com/u/4552022/notworkinggrid.png
And also, doubleklicking a row is supposed to give editmode:
http://dl.dropbox.com/u/4552022/edit.png
But when adding columns manually it gives this error:
http://dl.dropbox.com/u/4552022/error.png
When manually creating columns, they are created like this:
var dropDownColumn =
new
GridDateTimeColumn()
{
DataField = tableDefDto.ColumnId
};
The reason for doing this manually, is to enable the possiblity for dropdownColumns.
Any ideas?