hi,
I just try to setup a basic scenario with RadGrid using CRUD.
So far select and delete works, but update and insert fails. I cannot see, whats going wrong.
Here is my table definition:
The updated column has a trigger. Hope that is not the problem.
The SqlDataSource is:
and the radGrid is:
It would be really nice, if some pros can tell me, what is wrong.
Thanks in advance!
Andreas
I just try to setup a basic scenario with RadGrid using CRUD.
So far select and delete works, but update and insert fails. I cannot see, whats going wrong.
Here is my table definition:
CREATE
TABLE
[dbo].[Projects] (
[ProjectId]
INT
IDENTITY (1, 1)
NOT
NULL
,
[Project] NVARCHAR (
MAX
)
NOT
NULL
,
[OrganizationId] UNIQUEIDENTIFIER
NOT
NULL
,
[Created] DATETIME
DEFAULT
(getdate())
NULL
,
[Updated] DATETIME
DEFAULT
(getdate())
NULL
,
PRIMARY
KEY
CLUSTERED ([ProjectId]
ASC
)
);
The SqlDataSource is:
<
asp:SqlDataSource
ID
=
"SqlDataSourceProjects"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:DefaultConnection %>" DeleteCommand="DELETE FROM Projects WHERE (ProjectId = @ProjectId)" InsertCommand="INSERT INTO Projects(Project, OrganizationId) VALUES (@Project, @OrganizationId)" SelectCommand="SELECT Projects.* FROM Projects WHERE (OrganizationId = @OrganizationId)" UpdateCommand="UPDATE Projects SET Project = @Projects WHERE (OrganizationId = @OrganizationId)">
<
DeleteParameters
>
<
asp:Parameter
Name
=
"ProjectId"
DbType
=
"Int32"
/>
</
DeleteParameters
>
<
InsertParameters
>
<
asp:Parameter
Name
=
"Project"
DbType
=
"String"
/>
<
asp:SessionParameter
Name
=
"OrganizationId"
SessionField
=
"OrganizationId"
DbType
=
"Guid"
/>
</
InsertParameters
>
<
SelectParameters
>
<
asp:SessionParameter
Name
=
"OrganizationId"
SessionField
=
"OrganizationId"
/>
</
SelectParameters
>
<
UpdateParameters
>
<
asp:Parameter
Name
=
"Projects"
DbType
=
"String"
/>
<
asp:SessionParameter
Name
=
"OrganizationId"
SessionField
=
"OrganizationId"
DbType
=
"Guid"
/>
</
UpdateParameters
>
</
asp:SqlDataSource
>
<
telerik:RadGrid
ID
=
"RadGridProjects"
runat
=
"server"
AllowAutomaticDeletes
=
"True"
AllowAutomaticInserts
=
"True"
AllowAutomaticUpdates
=
"True"
AllowPaging
=
"True"
AllowSorting
=
"True"
AutoGenerateColumns
=
"False"
AutoGenerateDeleteColumn
=
"True"
AutoGenerateEditColumn
=
"True"
CellSpacing
=
"0"
Culture
=
"de-DE"
DataSourceID
=
"SqlDataSourceProjects"
GridLines
=
"None"
Skin
=
"Metro"
>
<
MasterTableView
DataKeyNames
=
"ProjectId"
DataSourceID
=
"SqlDataSourceProjects"
CommandItemDisplay
=
"TopAndBottom"
>
<
CommandItemSettings
ExportToPdfText
=
"Export to PDF"
></
CommandItemSettings
>
<
RowIndicatorColumn
Visible
=
"True"
FilterControlAltText
=
"Filter RowIndicator column"
>
<
HeaderStyle
Width
=
"20px"
></
HeaderStyle
>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
Visible
=
"True"
FilterControlAltText
=
"Filter ExpandColumn column"
>
<
HeaderStyle
Width
=
"20px"
></
HeaderStyle
>
</
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"ProjectId"
DataType
=
"System.Int32"
FilterControlAltText
=
"Filter ProjectId column"
HeaderText
=
"ProjectId"
ReadOnly
=
"True"
SortExpression
=
"ProjectId"
UniqueName
=
"ProjectId"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Project"
FilterControlAltText
=
"Filter Project column"
HeaderText
=
"Project"
SortExpression
=
"Project"
UniqueName
=
"Project"
>
</
telerik:GridBoundColumn
>
</
Columns
>
<
EditFormSettings
>
<
EditColumn
FilterControlAltText
=
"Filter EditCommandColumn column"
></
EditColumn
>
</
EditFormSettings
>
</
MasterTableView
>
<
FilterMenu
EnableImageSprites
=
"False"
></
FilterMenu
>
</
telerik:RadGrid
>
Thanks in advance!
Andreas