﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - WebGrid Enterprise - WEBGRID Retrieve values child rows server side</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WEBGRID-Retrieve-values-child-rows-server-side/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>WEBGRID Retrieve values child rows server side</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WEBGRID-Retrieve-values-child-rows-server-side/</link><pubDate>Mon, 26 Oct 2009 04:39:46 GMT</pubDate><dc:creator>lucisit</dc:creator><description>&lt;blockquote&gt;&lt;p&gt;Hi Glenn, I have apreciate your effort to find a workaroud for something that isn't supported by WG. Considering that WG returns the entire composite key for the child selected row I prefer to retrieve it by querying the data adapter. &lt;/p&gt;&lt;p&gt;I must say that I'm very disappoited because I am waiting since WG release 3.5 for a real composite key management. &lt;/p&gt;&lt;p&gt;In any way, I must &amp;nbsp;tank you for helping me. &lt;/p&gt;&lt;p&gt;My best regards.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Luciano&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/blockquote&gt;
</description></item><item><title>WEBGRID Retrieve values child rows server side</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WEBGRID-Retrieve-values-child-rows-server-side/</link><pubDate>Mon, 26 Oct 2009 04:38:26 GMT</pubDate><dc:creator>lucisit</dc:creator><description>&lt;p&gt;Hi Glenn, I have apreciate your effort to find a workaroud for something that isn't supported by WG. Considering that WG returns the entire composite key for the child selected row I prefer to retrieve it by querying the data adapter. &lt;/p&gt;
&lt;p&gt;I must say that I'm very disappoited because I am waiting since WG release 3.5 for a real composite key management. &lt;/p&gt;
&lt;p&gt;In any way, I must  tank you for helping me. &lt;/p&gt;
&lt;p&gt;My best regards.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Luciano&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item><item><title>WEBGRID Retrieve values child rows server side</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WEBGRID-Retrieve-values-child-rows-server-side/</link><pubDate>Mon, 26 Oct 2009 04:00:39 GMT</pubDate><dc:creator>Glayaar</dc:creator><description>Per you request, I modified my first sample for composite key scenario. &amp;nbsp;In this sample, I buffer the parent composite key in a data column and bound the value in the WebGrid button column. &amp;nbsp;&amp;nbsp;</description></item><item><title>WEBGRID Retrieve values child rows server side</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WEBGRID-Retrieve-values-child-rows-server-side/</link><pubDate>Fri, 23 Oct 2009 06:51:51 GMT</pubDate><dc:creator>lucisit</dc:creator><description>&lt;p&gt;Hi Glenn, I could retrieve child row's values with the code below and using only one field as key but I couldn't when the key is composite by more fields. How shoud I declare a coposite key in WG? &lt;/p&gt;
&lt;p&gt;Thank you, regards. &lt;/p&gt;
&lt;p&gt;Luciano&lt;/p&gt;
&lt;p&gt;Dim Protocollo As Integer = CInt(WebGrid1.RetrieveClientLastSelectedObject().KeyValue)&lt;br /&gt;            Session("PROTOCOLLO") = Protocollo&lt;br /&gt;            Session("CODICE_RICHIEDENTE") = WebGrid1.GetTableByName("Pratiche").Rows.GetRowByKeyValue(Protocollo).Cells.GetNamedItem("CODICE_RICHIEDENTE").Value&lt;/p&gt;</description></item><item><title>WEBGRID Retrieve values child rows server side</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WEBGRID-Retrieve-values-child-rows-server-side/</link><pubDate>Fri, 23 Oct 2009 03:41:03 GMT</pubDate><dc:creator>lucisit</dc:creator><description>&lt;p&gt;Hi Glenn, I followed your advice but it still doesn't work, see the attachment. Is this feature supported in WG 6.0 2008 SP2? Because at this point I don't know what to think. If you can, please send me a database containing two tables parent and child, both having a composite key, plus the page when you retrieve the selected child row row by RetrieveClientLastSelectedObject KeyValues property.&lt;/p&gt;
&lt;p&gt;Thank you, regards.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Luciano&lt;/p&gt;</description></item><item><title>WEBGRID Retrieve values child rows server side</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WEBGRID-Retrieve-values-child-rows-server-side/</link><pubDate>Fri, 23 Oct 2009 00:46:20 GMT</pubDate><dc:creator>Glayaar</dc:creator><description>&lt;p&gt;The snippet is for the WebGrid1_ButtonClick in the 4_Glenn.jpg attachment. In this case the ChildKey variable will be RetrieveClientLastSelectedObject KeyValues property. &lt;/p&gt;&lt;p&gt;For the snippet to work, you will also need to use the RestoreExpandedChildRows="true" property in the LayoutSetting &lt;/p&gt;</description></item><item><title>WEBGRID Retrieve values child rows server side</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WEBGRID-Retrieve-values-child-rows-server-side/</link><pubDate>Thu, 22 Oct 2009 05:20:11 GMT</pubDate><dc:creator>lucisit</dc:creator><description>&lt;p&gt;Hi Glenn, my composite keys have the following fields:&lt;/p&gt;
&lt;p&gt;Composite ParentKey = FirstKeyField is String -  SecondKeyField is numeric&lt;/p&gt;
&lt;p&gt;Composite ChidKey  = FirstKeyField is Numeric - SecondKF Is string - ThirdKF is String&lt;/p&gt;
&lt;p&gt;What format shuld have ChildKey  to pass it  as  parameter in the following code (String, or what else)? &lt;/p&gt;
&lt;p&gt;WebGrid1.GetTableByName("childTableName").Rows.GetRowByKeyValue(ChildKey)&lt;/p&gt;
&lt;p&gt;If you don't mind please send me a sample about how to retrieve a row parent or child using a composite Key&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Thank you, regards.&lt;/p&gt;
&lt;p&gt;Luciano&lt;/p&gt;</description></item><item><title>WEBGRID Retrieve values child rows server side</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WEBGRID-Retrieve-values-child-rows-server-side/</link><pubDate>Thu, 22 Oct 2009 04:05:08 GMT</pubDate><dc:creator>Glayaar</dc:creator><description>&lt;p&gt;Based on the error message in the screenshot, the error is returned because the GetRowByKeyValue return null. My hunch is because the data type in the ArrayList and the KeyValues of the parent row does not match. Have you tried using the object of the ChildKey item without casting the item to String?&lt;/p&gt;&lt;p&gt;Or you could use the RestoreExpandedChildRows="true" property in the LayoutSetting so the child row will be expanded and you could retrieve the child row info using the ChildKey variable:&lt;/p&gt;&lt;pre&gt;//Acquire the selected child row
WebGrid1.GetTableByName("childTableName").Rows.GetRowByKeyValue(ChildKey)
//Acquire the selected child parent row
WebGrid1.GetTableByName("childTableName").Rows.GetRowByKeyValue(ChildKey).Parent&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item><item><title>WEBGRID Retrieve values child rows server side</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WEBGRID-Retrieve-values-child-rows-server-side/</link><pubDate>Thu, 22 Oct 2009 02:55:11 GMT</pubDate><dc:creator>lucisit</dc:creator><description>&lt;p&gt;Hi Glenn, I have attached the code from my test page and it doesn't work. I can retrieve correctly the child and the parent composite key  but, how you can see it doesn't work. Would you be so kind to tell me what is wrong. Thank you, regards. Luciano&lt;/p&gt;</description></item><item><title>WEBGRID Retrieve values child rows server side</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WEBGRID-Retrieve-values-child-rows-server-side/</link><pubDate>Wed, 21 Oct 2009 23:30:41 GMT</pubDate><dc:creator>Glayaar</dc:creator><description>&lt;p /&gt;&lt;p style="margin-top: 10px; margin-bottom: 10px; "&gt;The snippet to retrieve the data in the childrow for a non composite parent row during button click is &lt;/p&gt;
&lt;p style="margin-top: 10px; margin-bottom: 10px; " /&gt;&lt;pre style="background-color: rgb(255, 252, 225); font-family: 'courier new', tahoma; font-size: 9pt; "&gt;WebGrid1.RootTable.Rows.GetRowByKeyValue(e.CellValue).ExpandChildRow();
string selectedKey = WebGrid1.RetrieveClientLastSelectedObject().KeyValue;&lt;/pre&gt;
&lt;p style="margin-top: 10px; margin-bottom: 10px; "&gt;The idea here is we need to expand the parent row first in order to retrieve the child data. The e.CellValue is the value of the button column which in the attached sample is referring to the parentKey column. In other words, in your compsoite key situation, you will need to buffer the composite key parent in a column to be able to reference it if you wanted to expand the row.&lt;/p&gt;
&lt;p style="margin-top: 10px; margin-bottom: 10px; "&gt;Or you could use a simpler solution, by adding the property RestoreExpandedChildRows="true" in the WebGrid LayoutSettings property to ensure the child row will be expanded. Without this property, you will need to use the above technique to ensure the child row table is loaded.&lt;/p&gt;
&lt;p /&gt;</description></item><item><title>WEBGRID Retrieve values child rows server side</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WEBGRID-Retrieve-values-child-rows-server-side/</link><pubDate>Fri, 16 Oct 2009 06:55:11 GMT</pubDate><dc:creator>lucisit</dc:creator><description>&lt;p&gt;Hello, I have a hierarchical structure and each child row has a button that raises a postback event when I try to retrieve values in WebGrd1_ButtonClick with the code below I get an error because it can't retieve the object. Would be so kind to send me a sample to solve this problem. Thank you, luciano.&lt;/p&gt;
&lt;p&gt;Dim SelObj As SelectedObject = WebGrid1.RetrieveClientLastSelectedObject()&lt;br /&gt;Dim SelInd As Integer &lt;/p&gt;
&lt;p&gt;SelInd = SelObj.RowIndex&lt;/p&gt;
&lt;p&gt;Dim TempVar = WebGrid1.RootTable.ChildTables(0).Rows(SelInd).Cells.GetNamedItem("NUMERO_PROTOCOLLO").Value&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item></channel></rss>