I have an ultrwebgrid bound to a sqldatasource. The UpdateRow event fires when I add a row, along with the AddRow event, but it does not fire when I update a row. I think I have all the AllowUpdate type fields set. The adding of rows run fine. I have taken out the paging to simplify. I can edit the lone updateable cell just fine. I have a multiple field primary key, but it is supposed to handle it as I input the fields, in the correct order, separated by commas in the DataKeyFields property. I have attached the pertinent markup and C# code.
How are you binding your grid to the SqlDataSource?
If you're doing this in code, you may need to move this to a different location (Page_Load is the most often used and may be too late in the page's lifecycle), or possibly avoid calling DataBind().
If you're doing this in the designer, then I can't think of a reason why this should occur. Can you reproduce in a sample application that we can run and debug?
Hi,
i am also facing same problem ,debugger not hitting to update Row event. Any resolution on this will help me to proceed further.
Note:in feature picker, I have enabled the AJAX for grid.
protected void UltraWebGrid1_UpdateRow(object sender, RowEventArgs e) {
}
The original issue was caused by a bug in WebGrid, where events such as UpdateRow were not being raised when the grid was bound to a table with a composite primary key. This was addressed in development issue 16500, and the fix is present in the current service release of NetAdvantage for .NET 2008 Volume 3 and later.
prasantrout: Please test the latest service release to see if this resolves your issue. If it does not, then I recommend that you submit a support request and provide a sample project, so that a Developer Support Engineer can investigate what is happening in more detail.
Thanks for your prompt reply, As mentioned i checked with my installed version, which is the NetAdvantage for .NET 2008 Volume 2. May be for that it's not firing.
Currently we don't have rights to install the newer version or any new patches to my machine .for which we changed our design where we are adding hyperlink button to the end of each row to update the record .please refer to my screen shot attached below.
Here my question is how do i post back to the server side on click of Save Hyperlink button.also wanted my selected row information in backend to update into the database.please put some sample so i can refer it .
Code attached i am using presently
prasantrout,
This will require more in-depth assistance than we can reasonably provide through the forums. I am going to pass this information to a Developer Support Engineer, who will create a support case, research your issue, and assist you through our normal support system.
In the future, please create new forum threads for new issues you encounter. This will make it much easier for you, us, and other readers to tell at a glance what threads are resolved and what ones are still open.
Hi Vince ,
Thanks ,As you said..now i disable the Ajax from grid..where update event on grid is firing fine.i am facing a samall issue here ..
Scenario :
1. Defined my Columns in ASPX page and then bind the grid from back end dynamically .Here my column includes both the templete columns and Normal columns .
Here issue is , after biding the grid the Column order i defined in aspx page ..not retaing .Templete column defined at end [Please check to my attachment] in aspx page pushed as first Column .
Column Defined Sequence in aspx page :
<Columns >
<igtbl:UltraGridColumn Key="Device_Name" IsBound="True" AllowUpdate="No" Width="150px" BaseColumnName
="Device_Name">
<Header Caption
="Device Name">
</Header
>
</igtbl:UltraGridColumn
<igtbl:UltraGridColumn Key="Running_Id" Hidden="true" IsBound="True" AllowUpdate="No" Width="175px" BaseColumnName
="Running_Id">
<Footer
<RowLayoutColumnInfo OriginX="1"
/>
</Footer
="Running Id">
<igtbl:UltraGridColumn Key="Project" IsBound="True" AllowUpdate="No" Width="175px" BaseColumnName
="Project">
<RowLayoutColumnInfo OriginX="2"
<igtbl:UltraGridColumn Key="BU" IsBound="True" AllowUpdate="No" Width="175px" BaseColumnName
="BU">
<RowLayoutColumnInfo OriginX="3"
<igtbl:UltraGridColumn Key="Event" IsBound="True" AllowUpdate="No" Width="175px" BaseColumnName
="Event">
<RowLayoutColumnInfo OriginX="4"
<igtbl:UltraGridColumn Key="Migration_Start_Date" DataType="System.DateTime" IsBound="True" AllowUpdate="No" Width="175px" BaseColumnName
="Migration_Start_Date">
<RowLayoutColumnInfo OriginX="5"
="Migration Start Date">
<igtbl:UltraGridColumn Key="Migration_END_Date" DataType="System.DateTime" IsBound="True" AllowUpdate="No" Width="175px" BaseColumnName
="Migration_END_Date">
<CellStyle HorizontalAlign
="Center">
</CellStyle
<RowLayoutColumnInfo OriginX="6"
="Migration End Date">
<igtbl:UltraGridColumn Key="HANDOVER_NAME" IsBound="True" EditorControlID="WbCmbContacts" Width="175px" BaseColumnName
="HANDOVER_NAME">
<RowLayoutColumnInfo OriginX="7"
="Handover Name">
<igtbl:UltraGridColumn Key="HANDOVER_DATE" IsBound="True" Width="175px" BaseColumnName
="HANDOVER_DATE"
Type="Custom" Format="MM-dd-yyyy" DataType="System.DateTime" EditorControlID
="webDtChooser">
<RowLayoutColumnInfo OriginX="8"
<HeaderStyle HorizontalAlign="Center"></HeaderStyle
="Handover Date">
<igtbl:UltraGridColumn Key="HANDOVER_TIME" IsBound="True" Width="175px" BaseColumnName
="HANDOVER_TIME">
<RowLayoutColumnInfo OriginX="9"
="Handover Time">
<igtbl:UltraGridColumn Key="TESTING_CONTACT" EditorControlID="WbCmbContacts" IsBound="True" Width="175px" BaseColumnName
="TESTING_CONTACT">
<RowLayoutColumnInfo OriginX="10"
="Testing Contact">
<igtbl:UltraGridColumn Key="TESTING_DATE" IsBound="True" Width="175px" BaseColumnName
="TESTING_DATE"
<RowLayoutColumnInfo OriginX="11"
="Testing Date">
<igtbl:UltraGridColumn Key="TESTING_TIME" IsBound="True" Width="175px" BaseColumnName
="TESTING_TIME">
<RowLayoutColumnInfo OriginX="12"
="Testing Time">
<igtbl:UltraGridColumn Key="Last_Changed_BY" IsBound="True" Width="175px" AllowUpdate="No" BaseColumnName
="Last_Changed_BY">
<RowLayoutColumnInfo OriginX="13"
="Last Changed By">
<igtbl:UltraGridColumn Key="Last_Changed_ON" IsBound="True" AllowUpdate="No" Width="175px" BaseColumnName
="Last_Changed_ON">
<RowLayoutColumnInfo OriginX="14"
="Last Changed On">
<igtbl:TemplatedColumn Key="save" BaseColumnName="save" Width
="75px">
<CellTemplate
<asp:Button Text="Save" ID="btnSave" runat="server" OnClick="UlWebGridLookup_ClickCellButton"
</CellTemplate
="Save">
<RowLayoutColumnInfo OriginX="15"
</igtbl:TemplatedColumn
</Columns
please check the attached aspx page with codebehind file
prasantrout said:Here my question is how do i post back to the server side on click of Save Hyperlink button.also wanted my selected row information in backend to update into the database.
If you want to post back when clicking the hyperlink, use a LinkButton in a templated column instead of a regular hyperlink. A LinkButton can appear as a regular hyperlink, and can cause a regular postback instead of navigating.
You will need to post back to the server to be able to have any data changes updated. When using regular hyperlinks, the browser performs navigation relatively immediately, and doesn't give WebGrid any chance to send any updates to the server.
Given that the links say "Save," I would recommend instead using a "Save" button entirely outside of the grid, rather than putting hyperlinks or LinkButton controls in each row. If you're not using the grid's AJAX capabilities, you can use the grid's UpdateRowBatch event to process all updates to the grid during one postback.