
<telerik:RadGrid ID="rgFileList" runat="server" OnItemCommand="rgFileList_ItemCommand"> <MasterTableView HorizontalAlign="Right"> <EditFormSettings EditFormType="Template"> <FormTemplate> <table style="width: 85%" align="center"> <tr> <td style="width: 35%" align="right" >Description: </td> <td style="width: 65%"> <asp:TextBox ID="txtDescription" runat="server" Text='<%# Bind("description") %>'></asp:TextBox> </td> </tr> <tr><tdcolspan="2"> </td></tr> <tr> <td colspan="2" align="center"> <asp:Button ID="btnUpdate" runat="server" Text="Update" CommandName="Update" /> <asp:Button ID="btnCancel" runat="server" Text="Cancel" CommandName="Cancel" /> </td> </tr> </table> </FormTemplate> </EditFormSettings>rgFileList_ItemCommand where the code is:
protected void rgFileList_ItemCommand(object source, GridCommandEventArgs e) { string strCommand = e.CommandName.ToUpper().Trim(); if (strCommand == "UPDATE") { GridEditableItem grdSelected = (GridEditableItem)e.Item; string filename = grdSelected.GetDataKeyValue("filename").ToString().Trim(); TextBox tb = (TextBox)grdSelected.FindControl("txtDescription"); string description = tb.Text.ToString().Trim();
EditManager = 'grdSelected.EditManager' threw an exception of type 'Telerik.Web.UI.GridBindingException'GridEditableItem
{"The current EditFormType does not support the requested editing capabilities."}
Hi together,
I have a question about the RadGrid. I have now created a RadGrid with a Edit, Delete and Add new Record Button. The Edit Mask shows fine, but if I Edit a record it dosn't update it. When I debug I see that it doesnt't run my Update Method in my Code.
Below my apsx and my methods.
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="radGrid1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="radGrid1" LoadingPanelID="RadAjaxLoadingPanel1" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="RadioButton1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" /> <telerik:AjaxUpdatedControl ControlID="RadioButton2" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="RadioButton2"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" /> <telerik:AjaxUpdatedControl ControlID="RadioButton1" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="CheckBox1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px" Width="75px" Transparency="25"> <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' style="border: 0;" /> </telerik:RadAjaxLoadingPanel> <telerik:RadGrid ID="radGrid1" AutoGenerateEditColumn="True" DataSourceID="objectDataSource1" runat="server" GridLines="None" Skin="Office2010Blue"> <MasterTableView AllowAutomaticUpdates="True" AllowAutomaticInserts="True" CommandItemDisplay="Top" DataSourceID="ObjectDataSource1"> <Columns> <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn"> <ItemStyle CssClass="MyImageButton" /> </telerik:GridEditCommandColumn> <telerik:GridButtonColumn ConfirmText="Delete this product?" ConfirmDialogType="RadWindow" ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete" UniqueName="DeleteColumn"> <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" /> </telerik:GridButtonColumn> </Columns> <EditFormSettings ColumnNumber="2" CaptionDataField="Address" CaptionFormatString="Edit properties of Address Case Relations"> <FormTableItemStyle Wrap="False"></FormTableItemStyle> <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle> <FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="3" BackColor="White" Width="100%" /> <FormTableStyle CellSpacing="0" CellPadding="2" Height="110px" BackColor="White" /> <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle> <EditColumn ButtonType="ImageButton" InsertText="Insert Order" UpdateText="Update record" UniqueName="EditCommandColumn1" CancelText="Cancel edit"/> <FormTableItemStyle Wrap="False"></FormTableItemStyle> <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle> <FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="3" BackColor="White" Width="100%" /> <FormTableStyle CellSpacing="0" CellPadding="2" Height="110px" BackColor="White" /> <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle> <EditColumn ButtonType="ImageButton" InsertText="Insert Order" UpdateText="Update record" UniqueName="EditCommandColumn1" CancelText="Cancel edit"> </EditColumn> <FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle> <PopUpSettings ScrollBars="None" /> </EditFormSettings> <RowIndicatorColumn Visible="False"> <HeaderStyle Width="20px" /> </RowIndicatorColumn> <ExpandCollapseColumn Resizable="False" Visible="False"> <HeaderStyle Width="20px" /> </ExpandCollapseColumn> </MasterTableView> </telerik:RadGrid> <asp:ObjectDataSource ID="objectDataSource1" TypeName="ESTV.A3.Logic.AddressCaseRelationBll" SelectMethod="Select" UpdateMethod="Update" InsertMethod="Insert" DeleteMethod="Delete" runat="server" OldValuesParameterFormatString="original_{0}"> <SelectParameters> <asp:QueryStringParameter Name="addressId" Type="String" Direction="Input" QueryStringField="id"> </asp:QueryStringParameter> </SelectParameters> <UpdateParameters> <asp:Parameter Name="id" Type="String" /> <asp:Parameter Name="NotificationDate" Type="DateTime" /> <asp:Parameter Name="NoticeOfReceipt" Type="Boolean" /> </UpdateParameters> <InsertParameters> <asp:Parameter Name="id" Type="String" /> <asp:Parameter Name="NotificationDate" Type="DateTime" /> <asp:Parameter Name="NoticeOfReceipt" Type="Boolean" /> </InsertParameters> <DeleteParameters> <asp:Parameter Name="id" Type="String"/> </DeleteParameters> </asp:ObjectDataSource>And here my Code
public List<AddressCaseRelation> Select(string addressId) { ////TODO: validation and error handling Guid guidId = new Guid(addressId); return entityDao.GetByAddressId(guidId); } public void Update(string id, bool noticeOfReceipt, DateTime notificationDate) { Guid guidId = new Guid(id); AddressCaseRelation addressCaseRelation = entityDao.GetById(guidId); addressCaseRelation.NoticeOfReceipt = noticeOfReceipt; addressCaseRelation.NotificationDate = notificationDate; entityDao.Update(addressCaseRelation); entityDao.CommitChanges(); } public void Insert(string id, bool noticeOfReceipt, DateTime notificationDate) { Guid guidId = new Guid(id); AddressCaseRelation addressCaseRelation = entityDao.GetById(guidId); addressCaseRelation.NoticeOfReceipt = noticeOfReceipt; addressCaseRelation.NotificationDate = notificationDate; entityDao.Update(addressCaseRelation); entityDao.CommitChanges(); } public void Delete(string id) { Guid guidId = new Guid(id); AddressCaseRelation addressCaseRelation = entityDao.GetById(guidId); entityDao.Delete(addressCaseRelation); entityDao.CommitChanges(); }I have also the same problem if i click the Add new Record Button, the form doesnt appear. What is here wrong?
Regards and thanks
<telerik:GridTemplateColumn>
<ItemTemplate>
<asp:Label ID="lblComp" Text='<% #Eval("CompetencyName") %>' runat="server"></asp:Label>
<!-- POP Up control for displaying competency info -->
<telerik:RadToolTipManager runat="server" ID="RadToolTip3" Height="240px" Width="500px"
TargetControlID="lblComp" IsClientID="true" OffsetY="4" Sticky="true" Animation="Fade"
Position="BottomCenter" RelativeTo="Element" Skin="Telerik" OnAjaxUpdate="OnAjaxUpdate">
</telerik:RadToolTipManager>
<!-- end of pop up control for displaying info -->
</ItemTemplate>
</telerik:GridTemplateColumn>
I have just tried displaying a tooltip with some text but nothing is being displayed.please help i did not understand the sample already provided by telerik. <span class="rtSp"></span><span class="rtPlus"></span><div class="rtIn"> <div class="rtTemplate"> <span></span><span></span> </div> </div></div></li><li class="rtLI"><div class="rtMid"> <span class="rtSp"></span><span class="rtPlus"></span><div class="rtIn"> <div class="rtTemplate"> <span></span><span></span> </div> </div></div></li><li class="rtLI"><div class="rtMid"> <span class="rtSp"></span><span class="rtPlus"></span><div class="rtIn"> <div class="rtTemplate"> <span></span><span></span> </div> </div></div></li><li class="rtLI"><div class="rtMid"> <span class="rtSp"></span><span class="rtPlus"></span><div class="rtIn"> <div class="rtTemplate"> <span></span><span></span> </div> </div></div></li><li class="rtLI"><div class="rtMid"> <span class="rtSp"></span><span class="rtPlus"></span><div class="rtIn"> <div class="rtTemplate"> <span></span><span></span> </div> </div></div></li><li class="rtLI"><div class="rtMid"> <span class="rtSp"></span><span class="rtPlus"></span><div class="rtIn"> <div class="rtTemplate"> <span></span><span></span> </div> </div></div></li><li class="rtLI"><div class="rtMid"> <span class="rtSp"></span><span class="rtPlus"></span><div class="rtIn"> <div class="rtTemplate"> <span></span><span></span> </div> </div></div></li><li class="rtLI"><div class="rtMid"> <span class="rtSp"></span><span class="rtPlus"></span><div class="rtIn"> <div class="rtTemplate"> <span></span><span></span> </div> </div></div></li><li class="rtLI"><div class="rtMid"> <span class="rtSp"></span><span class="rtPlus"></span><div class="rtIn"> <div class="rtTemplate"> <span></span><span></span> </div> </div></div></li><li class="rtLI"><div class="rtMid"> <span class="rtSp"></span><span class="rtPlus"></span><div class="rtIn"> <div class="rtTemplate"> <span></span><span></span> </div>
...
var hideColumn = DBContext.TankMeasurementTypes.Where(p => p.TankMeasurementType_id == strpID); foreach (var x in hideColumn) { if (x.FK_MeasurementId == 2) { grdTakStrap.MasterTableView.DetailTables[0].GetColumn("Tot_Volumne").Visible = false; grdTakStrap.MasterTableView.DetailTables[0].GetColumn("Est").Visible = true; grdTakStrap.MasterTableView.DetailTables[0].GetColumn("Feetperinch").Visible = true; grdTakStrap.MasterTableView.DetailTables[0].GetColumn("Increment_Start").Visible = true; grdTakStrap.MasterTableView.DetailTables[0].GetColumn("Increment_End").Visible = true; grdTakStrap.MasterTableView.DetailTables[0].GetColumn("StrapLength").Visible = true; grdTakStrap.MasterTableView.DetailTables[0].CommandItemSettings.AddNewRecordText = "Add Strap"; } else { grdTakStrap.MasterTableView.DetailTables[0].GetColumn("Tot_Volumne").Visible = true; grdTakStrap.MasterTableView.DetailTables[0].GetColumn("Est").Visible = false; grdTakStrap.MasterTableView.DetailTables[0].GetColumn("Feetperinch").Visible = false; grdTakStrap.MasterTableView.DetailTables[0].GetColumn("Increment_Start").Visible = false; grdTakStrap.MasterTableView.DetailTables[0].GetColumn("Increment_End").Visible = false; grdTakStrap.MasterTableView.DetailTables[0].GetColumn("StrapLength").Visible = false; grdTakStrap.MasterTableView.DetailTables[0].CommandItemSettings.AddNewRecordText = "Add BBL/Inch"; }<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <telerik:RadStyleSheetManager id="StyleSheetManager" runat="server" > <StyleSheets > <telerik:StyleSheetReference Path="~/Webforms/UI/Mobile/as.mobile.default.theme.min.css" /> <telerik:StyleSheetReference Path="~/Webforms/UI/Mobile/jquery.mobile.structure-1.0.1.min.css" /> </StyleSheets> </telerik:RadStyleSheetManager> </head> <body> <form id="form1" runat="server"> <telerik:RadScriptManager ID="ScriptManager" Runat="Server" ClientIDMode="Static" EnableScriptCombine="true" OutputCompression="AutoDetect" ScriptMode="Release" AjaxFrameworkMode="Disabled" EnablePartialRendering="false" CompositeScript-ScriptMode="Release" LoadScriptsBeforeUI="false" > <CompositeScript> <Scripts> <asp:ScriptReference Name="WebForms.js" Assembly="System.Web" /> <asp:ScriptReference Name="WebUIValidation.js" Assembly="System.Web" /> <asp:ScriptReference Name="jQuery" /> </Scripts> </CompositeScript> </telerik:RadScriptManager> </form> </body></html><script type="text/javascript">//<![CDATA[;(function() { function loadHandler() { var hf = $get('StyleSheetManager_TSSM'); if (!hf._RSSM_init) { hf._RSSM_init = true; hf.value = ''; } hf.value += ';|634643790138684980:20a54711:5489a487'; Sys.Application.remove_load(loadHandler); }; Sys.Application.add_load(loadHandler); })();//]]></script>