|
.FocusControl(c.ClientID);| mychrt.Width = Unit.Point(507) |
| <telerik:RadGrid ID="entriesGrid" runat="server" | |
| AllowPaging="True" AutoGenerateColumns="False" Skin="Gray" GridLines="Both" AllowMultiRowEdit="True" | |
| ShowStatusBar="true" Font-Names="Arial"> |
| <TR id="ctl00_mainContentPlaceHolders_entriesGrid_ctl00__4" class="GridEditRow_Gray"> |
| <table> |
| <thead> |
| <tr> |
| <th></th> |
| <th></th> |
| <th></th> |
| <th></th> |
| </tr> |
| </thead> |
| <tbody> |
| <tr> |
| <td></td> |
| <td></td> |
| <td></td> |
| <td></td> |
| </tr> |
| ..... |
| </tbody> |
| </table> |

I have a heirachial grid that has several radcomboboxes. In the radcomboboxes I have found it now necessary to pass either a key from that heirachial grid, whereas I hadn't needed to before. I posted needed code
<telerik:RadGrid ID="rdgActivities" runat="server" EnableViewState="true"
AllowFilteringByColumn="True" Visible="True"
DataSourceID="objGetLifeCycleActivties"
Skin="Office2007"
GridLines="None">
<PagerStyle Mode="NextPrevAndNumeric" />
<MasterTableView DataSourceID="objGetLifeCycleActivties"
DataKeyNames="LifeCycleActivityID,ProjectLifeCyclePhaseID"
EditMode="EditForms"
CommandItemDisplay="Top"
CurrentResetPageIndexAction="SetPageIndexToFirst" Dir="LTR"
TableLayout="Auto" >
<DetailTables>
<telerik:GridTableView DataKeyNames="LifeCycleTaskID" CommandItemDisplay="Top"
DataSourceID="objGetLifeCycleTasks" AllowFilteringByColumn="False" Width="100%" runat="server">
<ParentTableRelation>
<telerik:GridRelationFields DetailKeyField="LifeCycleActivityID" MasterKeyField="LifeCycleActivityID" />
</ParentTableRelation>
<Columns>
<telerik:GridBoundColumn DataField="LifeCycleActivityID" Visible="False"
HeaderText="LifeCycleActivityID" SortExpression="LifeCycleActivityID"
UniqueName="LifeCycleActivityID" ReadOnly="True">
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn UniqueName="TaskID" Visible="False"
DataField="TaskID" HeaderText="Task">
<ItemTemplate></ItemTemplate>
<EditItemTemplate>
<telerik:RadComboBox ID="rdcTask" runat="server" Height="190px"
Skin="Office2007"
Width="150px" MarkFirstMatch="true"
HighlightTemplatedItems="true"
ItemRequestTimeout="500"
DataSourceID="objGetTasks"
SelectedValue='<%# Bind("TaskID")%>'
AllowCustomText="False"
DataTextField="TaskName" DataValueField="TaskID" >
<HeaderTemplate>
<div style="width:100%; position:inherit; ">
<span style="float:right; width: 100%;">Task</span>
</div>
</HeaderTemplate>
<ItemTemplate>
<div style="position:inherit">
<div style="width:100%;">
<span style="float:left; width:100%;"><%# DataBinder.Eval(Container.DataItem, "TaskName")%></span>
</div>
</div>
</ItemTemplate>
</telerik:RadComboBox>
</EditItemTemplate>
</telerik:GridTemplateColumn>
The object data source looks like this.
<asp:ObjectDataSource ID="objGetTasks" runat="server"
SelectMethod="GetTasksByLifeCycleActivityID"
TypeName="Hunt.LandDevelopment.Components.LDDController">
<SelectParameters>
<asp:SessionParameter Name="LifeCycleActivityID" SessionField="LifeCycleActivityID" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
So how can I reference the datakey parameter LifeCycleActivityID within the ObjectDataSource? In the heirchial grids I am able to reference the sessionparameter for that key and bind the sub grid using the sessionparameter in the select parameters of the child grid.
Thank you, Robin
| <telerik:GridTemplateColumn UniqueName="SetPrice" Display="false" HeaderText="SetPrice" HeaderStyle-Width="0px" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" ReadOnly="false"> |
| <ItemTemplate> |
| <asp:Label ID="lblSetPrice" runat="server" Text='<%# Eval("SetPrice") %>'></asp:Label> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| private void SetTotalAmount() |
| { |
| double total = 0; |
| foreach (GridDataItem item in grdContractItems.Items) |
| { |
| Label lblMetalValue = (Label)item.FindControl("lblExPrice") as Label; |
| Label lblLabor = (Label)item.FindControl("lblExPrice") as Label; |
| Label lblPrice = (Label)item.FindControl("lblExPrice") as Label; |
| Label lblExPrice = (Label)item.FindControl("lblExPrice") as Label; |
| Label lblSetPrice = (Label)item.FindControl("lblSetPrice") as Label; |
| if (lblSetPrice.Text != "0") |
| { |
| lblMetalValue.Text = lblLabor.Text = lblPrice.Text = ""; |
| lblExPrice.Text = lblSetPrice.Text; |
| } |
| if (lblExPrice != null && lblExPrice.Text.Trim() != string.Empty) |
| { |
| total += double.Parse(lblExPrice.Text); |
| } |
| } |
| lblTotalAmount.Text = GetDollar(total.ToString()); |
| } |