Web Connection
HtmlDataGrid Question
Gravatar is a globally recognized avatar based on your email address. HtmlDataGrid Question
  Steve
  All
  Nov 30, 2025 @ 06:30am

Hi All,
I am trying to use the HtmlDataGrid on a simple web page. To start, the page displays an RO_Number and Customer_Name field. I am using pushbuttons at the bottom of the form to navigate and perform the requested actions such as Save, or display more info on the Repair Order via a different page. My goal for this page is to display Parts and Labor that have been allocated to the Repair Order, and take actions based on which button is clicked, similar to what the TimeTrakker app does. Before I add the HtmlDataGrid, the page works correctly and it navigates as expected when I click the various btnMain, btnUnit, btnNotes, etc... Similar to TimeTrakker, the process object po_RepairOrders checks which button was clicked and takes the requested action.

All works well until I add the HtmlDataGrid to display the Parts and Labor. It does display the Parts and Labor as expected, so that's good. However, now when I click any of the buttons to navigate, the "Id" value passed back to the po_RepairOrders process object is different. Instead of returning the RO_Number value assigned to the ID variable, it is returning "_Page" in the Id variable. The page has a hidden variable called ID, and it is assigned the value of RO_Number. All works as expected until I add the HtmlDataGrid object. It's like the HtmlDataGrid is also using or setting the value of ID and this is interfering with the RO_Number assignment. I have paging turned off on the HtmlDataGrid object.

Any ideas? I am basically needing to display a Parent and Child page, but somehow the Id key value is getting set to _Page whenever the HtmlDataGrid is added to the page. What am I missing, I am stumped.

TIA,
Steve

Gravatar is a globally recognized avatar based on your email address. re: HtmlDataGrid Question
  Rick Strahl
  Steve
  Nov 30, 2025 @ 11:19am

The IDs used by the HtmlDataGrid are prefixed with the name of the control - the ID field in the HtmlDataGridConfig. It's easy to check by looking at the HTML and checking the Name= values on the various controls. The IDs shouldn't be the problem of interference.

Preserving the Grid state can be tricky if you have multiple form submission operations. In some cases extra logic may be required to capture the control's state especially as it relates to sorting and paging. If possible (ie. your list isn't very large) don't use these on the grid in these embedded scenarios. It works but it may require some extra work to capture the state correctly.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: HtmlDataGrid Question
  Steve
  Rick Strahl
  Nov 30, 2025 @ 06:51pm

In my scenario, the list is typically not large, anywhere from 1 to 10 items. I do not have a need to sort the grid or use paging. Are you saying it's probably best not to use the HTMLDataGrid for this (Parent/Child display)? Should I just manually create an HTML Table to display the child records?

Thanks,
Steve

Gravatar is a globally recognized avatar based on your email address. re: HtmlDataGrid Question
  Rick Strahl
  Steve
  Nov 30, 2025 @ 07:06pm

Honestly I use straight HTML in most cases because to me that's simpler as I can see and control exactly what's being rendered rather than manually creating fields and using expressions. But... if you're just displaying the table and not relying on sorting and paging HtmlDataGrid works just fine parent/child forms. If the list is not large sorting and paging is overkill anyway.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: HtmlDataGrid Question
  Steve
  Rick Strahl
  Dec 1, 2025 @ 11:02am

Thanks Rick! I went with your suggestion. The ShowAlbums code sample is just what I needed to get it done! Very easy!

Steve

© 1996-2026