Invalid Postback when clicking edit button in RadGrid

2 posts, 0 answers
  1. Randy
    Randy avatar
    1 posts
    Member since:
    Sep 2014

    Posted 29 Jun Link to this post

    I have a radgrid that, since the upgrade to the newest telerik version and VS2013 from 2012, will not allow any edits, sorting, or paging.  I continue to get the invalid postback or callback argument error.  I can set the page validation if that is necessary, but I shouldn't have to open up security holes to make this work.  I am already using the NeedDataSource event and nowhere in my code behind am I calling a DataBind() or ReBind().  Please help. 

     

    <telerik:RadGrid ID="WOAdminGrid" runat="server" AllowPaging="True" NeedDataSource="WOAdminGrid_NeedDataSource" PageSize="20" AutoGenerateColumns="False" style="min-width:1100px;" AllowFilteringByColumn="True" AllowSorting="True" ShowGroupPanel="True" Skin="Bootstrap" CellSpacing="-1" GridLines="Both" OnNeedDataSource="WOAdminGrid_NeedDataSource1" >
    <GroupingSettings CaseSensitive="False" />
    <ValidationSettings ValidationGroup="edit" />
    <ClientSettings AllowDragToGroup="True">
    <Selecting AllowRowSelect="True" />
    </ClientSettings>
    <MasterTableView DataKeyNames="ID,Picture1,Picture2">
    <RowIndicatorColumn Visible="False">
    <HeaderStyle Width="41px" />
    </RowIndicatorColumn>
    <ExpandCollapseColumn Created="True">
    <HeaderStyle Width="41px" />
    </ExpandCollapseColumn>
    <Columns>
    <telerik:GridButtonColumn ButtonType="PushButton" CommandName="Edit" FilterControlAltText="Filter column1 column" Text="Edit" UniqueName="column1">
    </telerik:GridButtonColumn>
    <telerik:GridBoundColumn DataField="ID" Display="False" FilterControlAltText="Filter ID column" HeaderText="ID" SortExpression="ID" UniqueName="ID">
    </telerik:GridBoundColumn>
    <telerik:GridBoundColumn DataField="WOID" FilterControlAltText="Filter WOID column" HeaderText="WOID" SortExpression="WOID" UniqueName="WOID">
    </telerik:GridBoundColumn>
    <telerik:GridBoundColumn DataField="Tag" FilterControlAltText="Filter Tag column" HeaderText="Tag" SortExpression="Tag" UniqueName="Tag">
    </telerik:GridBoundColumn>
    <telerik:GridBoundColumn DataField="Name" FilterControlAltText="Filter Name column" HeaderText="Name" SortExpression="Name" UniqueName="Name">
    </telerik:GridBoundColumn>
    <telerik:GridBoundColumn DataField="Location" FilterControlAltText="Filter Location column" HeaderText="Location" SortExpression="Location" UniqueName="Location">
    </telerik:GridBoundColumn>
    <telerik:GridBoundColumn DataField="Priority" FilterControlAltText="Filter Priority column" HeaderText="Priority" SortExpression="Priority" UniqueName="Priority">
    </telerik:GridBoundColumn>
    <telerik:GridBoundColumn DataField="Issue" FilterControlAltText="Filter Issue column" HeaderText="Issue" SortExpression="Issue" UniqueName="Issue">
    </telerik:GridBoundColumn>
    <telerik:GridBoundColumn DataField="Department" FilterControlAltText="Filter Department column" HeaderText="Department" SortExpression="Department" UniqueName="Department">
    </telerik:GridBoundColumn>
    <telerik:GridBoundColumn DataField="EntryDate" FilterControlAltText="Filter EntryDate column" HeaderText="Entry Date" SortExpression="EntryDate" UniqueName="EntryDate">
    </telerik:GridBoundColumn>
    <telerik:GridBoundColumn DataField="Status" FilterControlAltText="Filter Status column" HeaderText="Status" SortExpression="Status" UniqueName="Status">
    </telerik:GridBoundColumn>
    <telerik:GridBoundColumn DataField="Classification" FilterControlAltText="Filter column column" HeaderText="Classification" SortExpression="Classification" UniqueName="column">
    </telerik:GridBoundColumn>
    </Columns>
    <EditFormSettings EditFormType="Template">
    <EditColumn FilterControlAltText="Filter EditCommandColumn1 column" UniqueName="EditCommandColumn1">
    </EditColumn>
    <FormTemplate>
    <div style="min-width: 1100px;">
    <div style="border: solid; width: 525px; float: left; margin-left: auto; margin-right: auto;">
    <div style="width: 49%; float: left; display: inline-block;">
    <asp:Label runat="server" ID="woidLBL" Text="WO #:" CssClass="left"></asp:Label>
    <telerik:RadTextBox runat="server" ID="woidTB" ReadOnly="true" WrapperCssClass="right" CssClass="right" LabelWidth="64px" Resize="None" Text='<%# Bind("WOID") %>' Width="160px" Skin="Sunset"></telerik:RadTextBox>
    <div class="clear"></div>
    <asp:Label runat="server" ID="deptLBL" Text="Dept:" CssClass="left"></asp:Label>
    <telerik:RadTextBox runat="server" ID="deptTB" ReadOnly="true" WrapperCssClass="right" CssClass="right" LabelWidth="64px" Resize="None" Text='<%# Bind("Department") %>' Width="160px" Skin="Sunset"></telerik:RadTextBox>
    <div class="clear"></div>
    </div>
    <div style="width: 49%; float: right; display: inline-block;">
    <asp:Label runat="server" ID="nameLBL" Text="Requestor:" CssClass="left"></asp:Label>
    <telerik:RadTextBox runat="server" ID="nameTB" ReadOnly="true" CssClass="right" LabelWidth="64px" Resize="None" Text='<%# Bind("Name") %>' Width="160px" Skin="Sunset"></telerik:RadTextBox>
    <div class="clear"></div>

    </div>
    <div class="clear"></div>
    <div style="width: 100%; margin-left: auto; margin-right: auto;">
    <asp:Label runat="server" ID="issueLBL" Text="Issue:" CssClass="left" Style="width: 10%;"></asp:Label>
    <div class="clear"></div>
    <telerik:RadTextBox ID="issueTB" runat="server" Rows="12" TextMode="MultiLine" Width="100%" LabelWidth="40%" Resize="None" Text='<%# Bind("Issue") %>' Skin="Bootstrap"></telerik:RadTextBox>
    </div>
    <div class="clear"></div>
    <div style="width: 100%; margin-left: auto; margin-right: auto;">
    <telerik:RadBinaryImage ID="RadBinaryImage1" runat="server" DataValue='<%#Eval("Picture1") is DBNull ? null : Eval("Picture1") %>' Height="40px" Width="40px" AutoAdjustImageControlSize="false" ClientIDMode="Static" />
    <telerik:RadToolTip ID="pic1TT" runat="server" TargetControlID="RadBinaryImage1" Position="MiddleRight" Height="600px" Width="600px" RelativeTo="Element">
    <telerik:RadBinaryImage ID="RB3" runat="server" DataValue='<%#Eval("Picture1") is DBNull ? null : Eval("Picture1") %>' AutoAdjustImageControlSize="false" Height="600px" Width="600px" />
    </telerik:RadToolTip>
    <div class="clear"></div>
    <asp:Label ID="beforepicLBL" runat="server" Text="Picture 1:"></asp:Label>
    <telerik:RadAsyncUpload ID="beforepicUL" runat="server" MaxFileInputsCount="1" Skin="Sunset">
    </telerik:RadAsyncUpload>
    <div class="clear">
    </div>
    <telerik:RadBinaryImage ID="RadBinaryImage2" runat="server" Height="40px" Width="40px" DataValue='<%# Eval("Picture2") is DBNull ? null : Eval("Picture2") %>' ImageStorageLocation="Cache" />
    <telerik:RadToolTip ID="RadToolTip1" runat="server" Position="MiddleRight" RelativeTo="Element" TargetControlID="RadBinaryImage2" Height="600px" Width="600px">
    <telerik:RadBinaryImage ID="RadBinaryImage3" runat="server" DataValue='<%# Eval("Picture2") is DBNull ? null : Eval("Picture2") %>' Height="600px" ImageStorageLocation="Cache" Width="600px" />
    </telerik:RadToolTip>
    <div class="clear"></div>
    <asp:Label ID="afterpicLBL" runat="server" Text="Picture 2:"></asp:Label>
    <telerik:RadAsyncUpload ID="afterpicUL" runat="server" MaxFileInputsCount="1" Skin="Sunset">
    </telerik:RadAsyncUpload>
    </div>
    </div>
    <div style="border: solid; width: 575px; float: left; margin-left: 10px; margin-right: auto;">
    <div style="width: 49%; float: left; display: inline-block;">
    <div class="clear"></div>
    <asp:Label runat="server" ID="woedateLBL" Text="Entry Date:" CssClass="left"></asp:Label><asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ErrorMessage="Starting date is required!" ControlToValidate="startdateDP" ValidationGroup="edit" Font-Bold="true" Font-Size="Larger" ForeColor="Yellow" BackColor="Red" Text="*"></asp:RequiredFieldValidator>
    <telerik:RadDatePicker ID="startdateDP" runat="server" WrapperCssClass="right" CssClass="right" LabelWidth="64px" Resize="None" DbSelectedDate='<%# Bind("StartDate") %>' Width="160px" Skin="Sunset">
    <Calendar EnableWeekends="True" FastNavigationNextText="&amp;lt;&amp;lt;" Skin="Sunset" UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False">
    </Calendar>
    <DateInput DateFormat="M/d/yyyy" DisplayDateFormat="M/d/yyyy" LabelWidth="40%">
    <EmptyMessageStyle Resize="None" />
    <ReadOnlyStyle Resize="None" />
    <FocusedStyle Resize="None" />
    <DisabledStyle Resize="None" />
    <InvalidStyle Resize="None" />
    <HoveredStyle Resize="None" />
    <EnabledStyle Resize="None" />
    </DateInput>
    <DatePopupButton HoverImageUrl="" ImageUrl="" />
    </telerik:RadDatePicker>
    <div class="clear"></div>
    <div class="clear"></div>
    <asp:Label runat="server" ID="tagLBL" Text="Equip Tag:" CssClass="left"></asp:Label><asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ErrorMessage="Equipment tag is required!" ControlToValidate="tagCB" ValidationGroup="edit" Font-Bold="true" Font-Size="Larger" ForeColor="Yellow" BackColor="Red" Text="*"></asp:RequiredFieldValidator>
    <telerik:RadComboBox runat="server" ID="tagCB" CssClass="right" EmptyMessage="Select One" DataSourceID="TagDS" DataTextField="TagName" DataValueField="TagName" SelectedValue='<%# Bind("Tag") %>' Filter="Contains" Skin="Sunset"></telerik:RadComboBox>
    <div class="clear"></div>
    <div class="clear"></div>
    <asp:Label runat="server" ID="workcenterLBL" Text="Work Center:" CssClass="left"></asp:Label><asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ErrorMessage="Work Center is required!" ControlToValidate="wcCB" ValidationGroup="edit" Font-Bold="true" Font-Size="Larger" ForeColor="Yellow" BackColor="Red" Text="*"></asp:RequiredFieldValidator>
    <telerik:RadComboBox runat="server" ID="wcCB" CssClass="right" SelectedValue='<%# Bind("WorkCenter") %>' AppendDataBoundItems="True" DataSourceID="WorkCenterDS" DataTextField="Text" DataValueField="WCText" EmptyMessage="Select One" Skin="Sunset"></telerik:RadComboBox>
    <div class="clear"></div>
    <div class="clear"></div>
    <asp:Label runat="server" ID="wbsLBL" Text="WBS#:" CssClass="left"></asp:Label><asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ErrorMessage="WBS is required!" ControlToValidate="wbsTB" ValidationGroup="edit" Font-Bold="true" Font-Size="Larger" ForeColor="Yellow" BackColor="Red" Text="*"></asp:RequiredFieldValidator>
    <telerik:RadTextBox runat="server" ID="wbsTB" WrapperCssClass="right" CssClass="right" LabelWidth="64px" Resize="None" Text='<%# Bind("WBS") %>' Width="160px" Skin="Sunset"></telerik:RadTextBox>
    <div class="clear"></div>
    <asp:CheckBox ID="ageCB" runat="server" Text="Age" TextAlign="Left" Checked='<%# Eval("Age") == DBNull.Value ? false : Eval("Age") %>' />
    <div class="clear"></div>
    <asp:CheckBox ID="weatherCB" runat="server" Text="Weather" TextAlign="Left" Checked='<%# Eval("Weather") == DBNull.Value ? false : Eval("Weather") %>' />
    <div class="clear"></div>
    <asp:CheckBox ID="fiveSCB" runat="server" Text="5S Audit" TextAlign="Left" Checked='<%# Eval("5S") == DBNull.Value ? false : Eval("5S") %>' />
    </div>
    <div style="width: 49%; float: left; display: inline-block">
    <div class="clear"></div>
    <asp:Label runat="server" ID="compdateLBL" Text="Completion Date:" CssClass="left"></asp:Label>
    <telerik:RadDatePicker ID="compdateDP" runat="server" CssClass="right" DateInput-WrapperCssClass="right" DbSelectedDate='<%# Bind("CompDate") %>' Skin="Sunset">
    <Calendar EnableWeekends="True" FastNavigationNextText="&amp;lt;&amp;lt;" Skin="Sunset" UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False">
    </Calendar>
    <DateInput DateFormat="M/d/yyyy" DisplayDateFormat="M/d/yyyy" LabelWidth="40%" WrapperCssClass="right">
    <EmptyMessageStyle Resize="None" />
    <ReadOnlyStyle Resize="None" />
    <FocusedStyle Resize="None" />
    <DisabledStyle Resize="None" />
    <InvalidStyle Resize="None" />
    <HoveredStyle Resize="None" />
    <EnabledStyle Resize="None" />
    </DateInput>
    <DatePopupButton HoverImageUrl="" ImageUrl="" />
    </telerik:RadDatePicker>
    <div class="clear"></div>
    <div class="clear"></div>
    <asp:Label runat="server" ID="classificationLBL" Text="Classification:" CssClass="left"></asp:Label><asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="Classification is required!" ControlToValidate="classificationCB" ValidationGroup="edit" Font-Bold="true" Font-Size="Larger" ForeColor="Yellow" BackColor="Red" Text="*"></asp:RequiredFieldValidator>
    <telerik:RadComboBox runat="server" ID="classificationCB" CssClass="right" SelectedValue='<%# Bind("Classification") %>' EmptyMessage="Select One" Skin="Sunset">
    <Items>
    <telerik:RadComboBoxItem runat="server" Text="CIP" Value="CIP" />
    <telerik:RadComboBoxItem runat="server" Text="Emergency" Value="Emergency" />
    <telerik:RadComboBoxItem runat="server" Text="Scheduled" Value="SCHEDULED" />
    <telerik:RadComboBoxItem runat="server" Text="Project" Value="Project" />
    <telerik:RadComboBoxItem runat="server" Text="FC" Value="FC" />
    <telerik:RadComboBoxItem runat="server" Text="PM" Value="PM" />
    <telerik:RadComboBoxItem runat="server" Text="Non CIP Jobs" Value="Non CIP Jobs" />
    <telerik:RadComboBoxItem runat="server" Text="PM Crew/Technical Assistance" Value="PM Crew/Technical Assistance" />
    </Items>
    </telerik:RadComboBox>
    <div class="clear"></div>
    <div class="clear"></div>
    <asp:Label runat="server" ID="priorityLBL" Text="Priority:" CssClass="left"></asp:Label><asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="Priority is required!" ControlToValidate="priorityCB" ValidationGroup="edit" Font-Bold="true" Font-Size="Larger" ForeColor="Yellow" BackColor="Red" Text="*"></asp:RequiredFieldValidator>
    <telerik:RadComboBox runat="server" ID="priorityCB" CssClass="right" SelectedValue='<%# Bind("Priority") %>' EmptyMessage="Select One" Skin="Sunset">
    <Items>
    <telerik:RadComboBoxItem runat="server" Text="Emergency" Value="Emergency" />
    <telerik:RadComboBoxItem runat="server" Text="Urgent" Value="Urgent" />
    <telerik:RadComboBoxItem runat="server" Text="High Priority" Value="High Priority" />
    <telerik:RadComboBoxItem runat="server" Text="Routine" Value="Routine" />
    <telerik:RadComboBoxItem runat="server" Text="Project" Value="Project" />
    </Items>
    </telerik:RadComboBox>
    <div class="clear"></div>
    <div class="clear"></div>
    <asp:Label runat="server" ID="statusLBL" Text="Status:" CssClass="left"></asp:Label><asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Status is required!" Text="*" ControlToValidate="statusDDL" ValidationGroup="edit" Font-Bold="true" Font-Size="Larger" ForeColor="Yellow" BackColor="Red"></asp:RequiredFieldValidator>
    <telerik:RadDropDownList runat="server" ID="statusDDL" CssClass="right" DefaultMessage="Select One" SelectedValue='<%# Bind("Status") %>' Skin="Sunset">
    <Items>
    <telerik:DropDownListItem runat="server" Text="In Process" Value="In Process" />
    <telerik:DropDownListItem runat="server" Text="Duplicate" Value="Duplicate" />
    <telerik:DropDownListItem runat="server" Text="Shut Down" Value="Shut Down" />
    <telerik:DropDownListItem runat="server" Text="Completed" Value="Completed" />
    <telerik:DropDownListItem runat="server" Text="Hold" Value="Hold" />
    <telerik:DropDownListItem runat="server" Text="Reject" Value="Reject" />
    <telerik:DropDownListItem runat="server" Text="Monitoring" Value="Monitoring" />
    </Items>
    </telerik:RadDropDownList>
    <div class="clear"></div>
    <asp:CheckBox ID="safetyCB" runat="server" Text="Safety" TextAlign="Left" Checked='<%# Eval("Safety") == DBNull.Value ? false : Eval("Safety") %>' />
    <div class="clear"></div>
    <asp:CheckBox ID="envCB" runat="server" Text="Environmental" TextAlign="Left" Checked='<%# Eval("Environmental") == DBNull.Value ? false : Eval("Environmental") %>' />
    <div class="clear"></div>
    <asp:CheckBox ID="qualityCB" runat="server" Text="Quality" TextAlign="Left" Checked='<%# Eval("Quality") == DBNull.Value ? false : Eval("Quality") %>' />
    </div>
    <div class="clear"></div>
    <div style="width: 100%; margin-left: auto; margin-right: auto;">
    <div class="clear"></div>
    <asp:Label runat="server" ID="resolutionLBL" Text="Resolution:" Style="margin-left: 2px; float: left; display: inline-block;"></asp:Label><asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Resolution notes are required!" Text="*" ControlToValidate="resolutionTB" ValidationGroup="edit" Font-Bold="true" Font-Size="Larger" ForeColor="Yellow" BackColor="Red"></asp:RequiredFieldValidator>
    <div class="clear"></div>
    <telerik:RadTextBox ID="resolutionTB" runat="server" Rows="12" TextMode="MultiLine" Width="100%" LabelWidth="40%" Resize="None" Text='<%# Bind("Resolution") %>' Skin="Sunset"></telerik:RadTextBox>
    </div>
    <div>
    <telerik:RadGrid ID="techGrid" runat="server" GroupPanelPosition="Top" AllowMultiRowSelection="True" AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True" AutoGenerateColumns="False" OnDeleteCommand="techGrid_DeleteCommand" OnInsertCommand="techGrid_InsertCommand" OnItemDataBound="techGrid_ItemDataBound1" OnNeedDataSource="techGrid_NeedDataSource" OnUpdateCommand="techGrid_UpdateCommand" ShowFooter="True" Skin="Telerik">
    <MasterTableView CommandItemDisplay="Top" DataKeyNames="ID">
    <Columns>
    <telerik:GridTemplateColumn DataField="Tech" FilterControlAltText="Filter Tech column" HeaderText="Tech" UniqueName="Tech">
    <EditItemTemplate>
    <asp:Label ID="techLBL" runat="server" Text='<%# Eval("Tech") %>'></asp:Label>
    </EditItemTemplate>
    <InsertItemTemplate>
    <telerik:RadComboBox ID="techCB" Runat="server">
    </telerik:RadComboBox>
    </InsertItemTemplate>
    <ItemTemplate>
    <asp:Label ID="techLBL" runat="server" Text='<%# Eval("Tech") %>'></asp:Label>
    </ItemTemplate>
    </telerik:GridTemplateColumn>
    <telerik:GridNumericColumn Aggregate="Sum" DataField="Hours" DecimalDigits="2" FilterControlAltText="Filter Hours column" HeaderText="Hours" UniqueName="Hours">
    </telerik:GridNumericColumn>
    <telerik:GridBoundColumn DataField="ID" FilterControlAltText="ID" UniqueName="ID" Display="False" EditFormHeaderTextFormat="">
    </telerik:GridBoundColumn>
    </Columns>
    </MasterTableView>
    </telerik:RadGrid>
    </div>
    </div>
    <%--<div class="clear" style="padding-top:15px;"></div>--%>
    <div class="editButtonsDiv">
    <telerik:RadButton ID="cancelBTN" CssClass="editButtons" runat="server" Text="Cancel" CommandName="Cancel" Skin="Sunset"></telerik:RadButton>
    <telerik:RadButton ID="submitBTN" CssClass="editButtons" runat="server" Text="Submit" CommandName="Update" Skin="Sunset"></telerik:RadButton>
    </div>
    <div class="clear"></div>
    <asp:ValidationSummary ID="ValidationSummary1" runat="server" ValidationGroup="edit" Font-Size="Larger" BackColor="Red" ForeColor="Yellow" />
    </div>
    </FormTemplate>
    </EditFormSettings>
    </MasterTableView>
    </telerik:RadGrid>

    protected void Page_Load(object sender, EventArgs e)
    {

    }

     

  2. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 04 Jul Link to this post

    Hello Randy,

    I have examined the code and it seems correct. The Grid should be populated with data.

    Nevertheless, please ensure that you are using the latest version of the controls. The current release is version 2016.2.607.

    Also, try to disable the Browser Link feature in Visual Studio and see if it makes a difference.

    Regards,
    Viktor Tachev
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top