<telerik:GridTemplateColumn HeaderText="Requestor" UniqueName="Requestor"
SortExpression="FullName">
<ItemTemplate>
<asp:Label ID="lblRequestor" Width="100px" runat="server" Text='<%#Bind("RequestorID") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadComboBox AutoPostBack="true" DataTextField="FullName" EmptyMessage="-- Select Requestor --" AppendDataBoundItems="true" DataValueField="EmployeeUserId"
ID="RadComboBox1" runat="server" SelectedValue='<%#Bind("RequestorID") %>'>
</telerik:RadComboBox>
<asp:CustomValidator ID="CustomValidator1" ControlToValidate="RadComboBox1" OnServerValidate="ValidateRequestor" runat="server" ErrorMessage="Select Requestor"></asp:CustomValidator>
</EditItemTemplate>
<ItemStyle Width="100px" />
<HeaderStyle Width="100px" />
</telerik:GridTemplateColumn>
if (Page.User.Identity.IsAuthenticated)
{
GridTableRow tblRowForInsert = formItem[
"Requestor"].Parent as GridTableRow;
tblRowForInsert.Enabled =
false;
}
It works fine with postbacks, but, if I use AJAX, the disabled RadComboBox's borders are not shown at the bottom and the control seems to look like as if bottom half is cut.
I tried getting the RadComboBox control using the FindControl Method of GridEditableItem and then setting its Enabled property to false , but that also gives the same results with AJAX enabled.
Can you please let me know how to fix this or if there's a workaround.
Thanks
-Raj

Hello,
In my grid, I have a user control that provides functionality for my insert/updates. I am getting the all too famous error:
"DataBinding: 'Telerik.WebControls.GridInsertionObject' does not contain a property with the name"
Now, in my code I have so far been successful with this issue by using the following coding:
protected
void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
{
if (e.CommandName == RadGrid.InitInsertCommandName)
{
e.Canceled =
true;
ListDictionary newValues = new ListDictionary();
newValues[
"BudgetWSTypeID"] = string.Empty;
newValues[
"ProgramNameID"] = string.Empty;
newValues[
"FiscalYearID"] = string.Empty;
ECT.....
However, if you look at the below control (where the problem is occuring), you will notice that the selected value is coming from "DataItem.Grantee.GranteeID" -- how do I add this to my listDictionary for this to work? Perhaps I need to use a different object?
<
rad:RadComboBox selectedvalue='<%# DataBinder.Eval( Container, "DataItem.Grantee.GranteeID") %>' MarkFirstMatch="true"
Hi,
Please guide me how to Bind & Perform DML(Insert/Update/Delete) operations for the following scenario..
The following Example I implemented on NorthWind Database.
<
table cellpadding="0" cellspacing="0" width="100%" border="1" style="border-color: Green">
<tr>
<td>
<telerik:RadGrid ID="RadGrid1" runat="server" Skin="Default" Width="95%" AutoGenerateColumns="False"
PageSize="5" AllowSorting="True" AllowPaging="True" AllowAutomaticUpdates="True"
AllowAutomaticInserts="True" AllowAutomaticDeletes="True"
ShowStatusBar="true" onitemcreated="RadGrid1_ItemCreated"
onitemdatabound="RadGrid1_ItemDataBound"
onneeddatasource="RadGrid1_NeedDataSource">
<PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
<MasterTableView SkinID="Default" DataKeyNames="EmployeeID"
AllowMultiColumnSorting="True" AllowAutomaticDeletes="true" AllowAutomaticUpdates="true"
AllowAutomaticInserts="true">
<DetailTables>
<telerik:GridTableView SkinID="Default" DataKeyNames="EmployeeID, OrderID" DataSourceID="nestedTableSource" Name="GrdTableView" Width="100%"
runat="server" AllowAutomaticDeletes="true" AllowAutomaticInserts="true" AllowAutomaticUpdates="true"
CommandItemDisplay="Top">
<ParentTableRelation>
<telerik:GridRelationFields DetailKeyField="EmployeeID" MasterKeyField="EmployeeID" />
</ParentTableRelation>
<Columns>
<telerik:GridBoundColumn SortExpression="OrderID" HeaderText="OrderID" HeaderButtonType="TextButton"
DataField="OrderID" UniqueName="OrderID" ReadOnly="true">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression="ShipVia" HeaderText="Ship via" HeaderButtonType="TextButton"
DataField="ShipVia" UniqueName="ShipVia">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression="ShipName" HeaderText="Ship name" HeaderButtonType="TextButton"
DataField="ShipName" UniqueName="ShipName">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression="ShipCity" HeaderText="Ship city" HeaderButtonType="TextButton"
DataField="ShipCity" UniqueName="ShipCity">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression="ShipCountry" HeaderText="Ship country" HeaderButtonType="TextButton"
DataField="ShipCountry" UniqueName="ShipCountry">
</telerik:GridBoundColumn>
<telerik:GridEditCommandColumn UniqueName="EditCommandColumn" />
<telerik:GridButtonColumn UniqueName="DeleteColumn" Text="Delete" CommandName="Delete" />
</Columns>
</telerik:GridTableView>
</DetailTables>
<Columns>
<telerik:GridBoundColumn SortExpression="EmployeeID" HeaderText="EmployeeID" HeaderButtonType="TextButton"
DataField="EmployeeID" UniqueName="EmployeeID" ReadOnly="true">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression="FirstName" HeaderText="First name" HeaderButtonType="TextButton"
DataField="FirstName" UniqueName="FirstName">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression="LastName" HeaderText="Last name" HeaderButtonType="TextButton"
DataField="LastName" UniqueName="LastName">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression="Address" HeaderText="Address" HeaderButtonType="TextButton"
DataField="Address" UniqueName="Address">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression="City" HeaderText="City" HeaderButtonType="TextButton"
DataField="City" UniqueName="City" />
<telerik:GridBoundColumn SortExpression="Country" HeaderText="Country" HeaderButtonType="TextButton"
DataField="Country" UniqueName="Country">
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
<asp:SqlDataSource ID="nestedTableSource" SelectCommand="SELECT [OrderID],[EmployeeID], [ShipVia], [ShipName], [ShipCity], [ShipCountry] FROM [Orders] WHERE ([EmployeeID] = @EmployeeID)"
runat="server" ConflictDetection="CompareAllValues" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
DeleteCommand="DELETE FROM [Orders] WHERE [OrderID] = @original_OrderID" InsertCommand="INSERT INTO [Orders] ([EmployeeID], [ShipVia], [ShipName], [ShipCity], [ShipCountry]) VALUES (@EmployeeID, @ShipVia, @ShipName, @ShipCity, @ShipCountry)"
OldValuesParameterFormatString="original_{0}" UpdateCommand="UPDATE [Orders] SET [ShipVia] = @ShipVia, [ShipName] = @ShipName, [ShipCity] = @ShipCity, [ShipCountry] = @ShipCountry WHERE [OrderID] = @original_OrderID AND [ShipVia] = @original_ShipVia AND [ShipName] = @original_ShipName AND [ShipCity] = @original_ShipCity AND [ShipCountry] = @original_ShipCountry">
<SelectParameters>
<asp:SessionParameter Name="EmployeeID" SessionField="EmployeeID" Type="Int32" Direction="Input" />
</SelectParameters>
<DeleteParameters>
<asp:Parameter Name="original_OrderID" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="ShipVia" Type="Int32" />
<asp:Parameter Name="ShipName" Type="String" />
<asp:Parameter Name="ShipCity" Type="String" />
<asp:Parameter Name="ShipCountry" Type="String" />
<asp:Parameter Name="original_OrderID" Type="Int32" />
<asp:Parameter Name="original_ShipVia" Type="Int32" />
<asp:Parameter Name="original_ShipName" Type="String" />
<asp:Parameter Name="original_ShipCity" Type="String" />
<asp:Parameter Name="original_ShipCountry" Type="String" />
</UpdateParameters>
<InsertParameters>
<asp:SessionParameter Name="EmployeeID" SessionField="EmployeeID" Type="Int32" />
<asp:Parameter Name="ShipVia" Type="Int32" />
<asp:Parameter Name="ShipName" Type="String" />
<asp:Parameter Name="ShipCity" Type="String" />
<asp:Parameter Name="ShipCountry" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
</td>
</tr>
</table>
| Name Date Weight |
| John 2008-08-29 300 |
| John 2008-09-05 295 |
| John 2008-09-10 290 |
| Jane 2008-08-29 150 |
| Jane 2008-09-05 140 |
| Jane 2008-09-10 130 |
Hello!
I've used "Business Grid demo" to build my own sample app from.
I have a setup with main table, .persons (access db) containing names and ID for their workingplace and a table, .workingplace containing the names of the workingplace.
When i try to update the form a get an OleDbException error. "Data type mismatch in criteria expression".
I have been trying for days to solve this probably easy error but without any luck. Hope somebody can help me out here.
I'm running the app with ASP.NET-version:2.0.50727.3053 and Telerik RadGrid.Net2.dll ver 5.0.1.0
Regards
Janne P
Here's my code:
The Grid:
<
radG:RadGrid ID="DetailsGrid" runat="server" AutoGenerateColumns="False" GridLines="None" DataSourceID="ds_details" EnableAJAXLoadingTemplate="True" LoadingTemplateTransparency="15" ShowHeader="False" AllowAutomaticUpdates="True" AllowAutomaticInserts="True" EnableAJAX="True" OnItemInserted="DetailsGrid_ItemInserted" OnItemUpdated="DetailsGrid_ItemUpdated" OnPreRender="DetailsGrid_PreRender" OnCancelCommand="DetailsGrid_CancelCommand" OnItemCreated="DetailsGrid_ItemCreated" OnInsertCommand="DetailsGrid_InsertCommand" Width="464px" Style="overflow: hidden;">
<MasterTableView DataSourceID="ds_details" DataKeyNames="fldInstId" Width="219px">
<Columns>
<radG:GridBoundColumn DataField="fldIdNr" HeaderText="IdNr" UniqueName="fldIdNr" ColumnEditorID="TextEditor" />
<radG:GridBoundColumn DataField="fldFnamn" HeaderText="Förnamn" UniqueName="fldFnamn" ColumnEditorID="TextEditor" />
<radG:GridBoundColumn DataField="fldEnamn" HeaderText="Efternamn" UniqueName="fldEnamn" ColumnEditorID="TextEditor" />
<radG:GridDropDownColumn DataField="fldInstId" ListTextField="fldNamn" ListValueField="fldIdNr"ColumnEditorID="DropDownEditor1" DataSourceID="ds_arbetsplats" HeaderText="Arbetsplats" UniqueName="fldInstId" DataType="System.Int32" />
<radG:GridBoundColumn DataField="fldTitle" HeaderText="Titel" UniqueName="fldTitle" ColumnEditorID="TextEditor"/>
</Columns>
</MasterTableView>
</radG:RadGrid>
The data source for the grid:
<
asp:SqlDataSource ID="ds_details" runat="server"
ConnectionString="<%$ ConnectionStrings:conn_clients %>"
DeleteCommand="DELETE FROM [tblDr] WHERE [fldIdNr] = ?" InsertCommand="INSERT INTO [tdlDr] ([fldFnamn], [fldEnamn]) VALUES (?, ?)" ProviderName="<%$ ConnectionStrings:conn_clients.ProviderName %>" SelectCommand="SELECT fldIdNr, fldFnamn, fldEnamn, fldInstId, fldTitle FROM tblDr WHERE (fldIdNr = ?)"
UpdateCommand="UPDATE tblDr SET fldFnamn = ?, fldEnamn = ?, fldInstId = ?, fldTitle = ? WHERE (fldIdNr = ?)">
<SelectParameters>
<asp:ControlParameter ControlID="BusinessGrid" DefaultValue="" Name="fldIdNr" PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="fldFnamn" Type="String" />
<asp:Parameter Name="fldEnamn" Type="String" />
<asp:Parameter Name="fldInstId" Type="Int16" />
<asp:Parameter Name="fldTitle" Type="String" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="fldFnamn" Type="String" />
<asp:Parameter Name="fldEnamn" Type="String" />
</InsertParameters>
<DeleteParameters>
<asp:Parameter Name="fldIdNr" Type="Int32" />
</DeleteParameters>
</asp:SqlDataSource>
Data source for the dropdowncolumn:
<asp:SqlDataSource ID="ds_arbetsplats" runat="server"
ConnectionString="<%$ ConnectionStrings:conn_clients %>"
ProviderName="<%$ ConnectionStrings:conn_clients.ProviderName %>" SelectCommand="SELECT [fldIdNr], [fldNamn] FROM [tblInstitutioner]">
</asp:SqlDataSource>
<
html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
<telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
</telerik:RadScriptManager>
<div>
<telerik:RadGrid ID="RadGrid1" runat="server" Skin="Gray" Width="470px" AutoGenerateColumns="False">
<
MasterTableView DataKeyNames="GroupID" Width="100%" HorizontalAlign="Right">
<
RowIndicatorColumn>
<
HeaderStyle Width="20px"></HeaderStyle>
</
RowIndicatorColumn>
<
ExpandCollapseColumn>
<
HeaderStyle Width="20px"></HeaderStyle>
</
ExpandCollapseColumn>
<
DetailTables>
<
telerik:GridTableView DataKeyNames="GroupID" Width="100%" ShowHeader="false" TableLayout="Auto" BorderStyle="None" HorizontalAlign="Right">
<
ParentTableRelation>
<
telerik:GridRelationFields MasterKeyField="GroupID" DetailKeyField="GroupID" />
</
ParentTableRelation>
<
RowIndicatorColumn>
<
HeaderStyle Width="20px"></HeaderStyle>
</
RowIndicatorColumn>
<
ExpandCollapseColumn>
<
HeaderStyle Width="20px"></HeaderStyle>
</
ExpandCollapseColumn>
<
Columns>
<
telerik:GridBoundColumn DataField="NameID"> <HeaderStyle Width="115px" /></telerik:GridBoundColumn>
<
telerik:GridBoundColumn HeaderText="Name" DataField="Name"><HeaderStyle Width="157px" /></telerik:GridBoundColumn>
<
telerik:GridBoundColumn HeaderText="Date" DataField="CreatedDate" DataFormatString="{0:d}"><HeaderStyle Width="155px" /></telerik:GridBoundColumn>
<
telerik:GridBoundColumn HeaderText="Active" DataField="Active"><HeaderStyle Width="125px" /></telerik:GridBoundColumn>
</
Columns>
</
telerik:GridTableView>
</
DetailTables>
<
Columns>
<
telerik:GridBoundColumn HeaderText="Group ID" DataField="GroupID"><HeaderStyle Width="150px" /></telerik:GridBoundColumn>
<
telerik:GridBoundColumn HeaderText="Name" DataField="GroupName"><HeaderStyle Width="200px" /></telerik:GridBoundColumn>
<
telerik:GridBoundColumn HeaderText="Date" DataField="CreatedDate" DataFormatString="{0:d}"><HeaderStyle Width="200px" /></telerik:GridBoundColumn>
<
telerik:GridBoundColumn HeaderText="Active" DataField="Active"><HeaderStyle Width="150px" /></telerik:GridBoundColumn>
</
Columns>
</
MasterTableView>
<
FilterMenu EnableTheming="True">
<
CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
</
FilterMenu>
</telerik:RadGrid>
</div>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:FPSCoreDevConnectionString3 %>"
SelectCommand="SELECT * FROM [LookupGroup]"></asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:FPSCoreDevConnectionString3 %>"
SelectCommand="SELECT * FROM [LookupName]"></asp:SqlDataSource>
</form>
</
body>
</
html>

| <body> |
| <form id="form1" runat="server"> |
| <div> |
| <telerik:RadScriptManager ID="RadScriptManager1" runat="server" /> |
| <telerik:RadTabStrip ID="RadTabStrip1" runat="server" Skin="Office2007" SelectedIndex="0" MultiPageID="RadMultiPage1"> |
| <Tabs> |
| <telerik:RadTab Text="General" /> |
| <telerik:RadTab Text="Pages" /> |
| <telerik:RadTab Text="Users" /> |
| <telerik:RadTab Text="SEO" /> |
| <telerik:RadTab Text="Help" /> |
| </Tabs> |
| </telerik:RadTabStrip> |
| <div id="Inner"> |
| <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0"> |
| <telerik:RadPageView ID="RadPageView1" runat="server"> |
| RadPageView1 |
| </telerik:RadPageView> |
| <telerik:RadPageView ID="RadPageView2" runat="server"> |
| RadPageView2 |
| </telerik:RadPageView> |
| <telerik:RadPageView ID="RadPageView3" runat="server"> |
| RadPageView3 |
| </telerik:RadPageView> |
| <telerik:RadPageView ID="RadPageView4" runat="server"> |
| RadPageView4 |
| </telerik:RadPageView> |
| <telerik:RadPageView ID="RadPageView5" runat="server"> |
| <iframe width="100%" height="100%" src="http://mysite.com/help.html"></iframe> |
| </telerik:RadPageView> |
| </telerik:RadMultiPage> |
| </div> |
| </div> |
| </form> |
| </body> |