We have following requirements for lowest level grid items:
a.we required to expand only one item at a time means if we expand another item previous item should get collapse for last level of grid.
b. We don't want command template control state to carry for all other items of that level. Like if we change dropdown selected value it must be changed only for related item and other item dropdown will have default selected value.
'Format Code Block'
<rad:RadGrid ID="grdLineItem" runat="server" AutoGenerateColumns="true" Width="100%"
GridLines="None" PageSize="100" EnableAJAX="True" EnableAJAXLoadingTemplate="True"
LoadingTemplateTransparency="10" ShowStatusBar="true" AllowMultiRowEdit="true" AllowMultiRowSelection="true"
BorderColor="#4977b2" BorderStyle="Solid" BorderWidth="1px" >
<MasterTableView Name="Summary" DataKeyNames="Details" Width="100%"
BorderStyle="None" GridLines="Both" GroupsDefaultExpanded="False"
NoMasterRecordsText="No records to be displayed" HierarchyLoadMode="ServerOnDemand" >
<DetailTables>
<rad:GridTableView Name="AcctTypeID" DataKeyNames="AcctTypeID" Width="100%" runat="server" AutoGenerateColumns="true"
GroupsDefaultExpanded="False" HorizontalAlign="Right" NoDetailRecordsText="No records to be displayed" ShowHeadersWhenNoRecords="false">
<DetailTables>
<rad:GridTableView Name="DeptID" DataKeyNames="DeptID" Width="100%" runat="server" AutoGenerateColumns="true"
GroupsDefaultExpanded="False" HorizontalAlign="Right" NoDetailRecordsText="No records to be displayed" ShowHeadersWhenNoRecords="false">
<DetailTables>
<rad:GridTableView Name="LineItems" DataKeyNames="AcctID" Width="100%" runat="server" AutoGenerateColumns="false"
GroupsDefaultExpanded="False" HorizontalAlign="Right" NoDetailRecordsText="No records to be displayed"
ShowHeadersWhenNoRecords="True" EditMode="InPlace" AlternatingItemStyle-BackColor="#ddecfe"
GridLines="Vertical" AllowSorting="true" CommandItemDisplay="Top"
AllowMultiRowSelection="True" AllowMultiRowEdit="true">
<CommandItemTemplate>
<div>
<asp:Panel ID="pnlFilter" runat="server" GroupingText="FILTERS" Font-Bold="true">
Account Type:
<asp:DropDownList ID="ddlAcctSubType" CssClass="EditDropdown" runat="server" DataSource='<%# GetAccountSubTypeDV() %>'
DataTextField="AcctSubTypeName" DataValueField="AcctSubTypeID" SelectedValue='<%# SelectedAcctSubTypeID %>'
AppendDataBoundItems="True" AutoPostBack="true" OnSelectedIndexChanged="ddlAcctSubType_SelectedIndexChanged">
<asp:ListItem Text="All" Value="0"></asp:ListItem>
</asp:DropDownList>
<asp:CheckBox ID="chkShowOnlyUsed" Text="Show Used Items Only" Checked='<%# ShowUsedLineItemsOnly %>'
AutoPostBack="true" OnCheckedChanged="OnCheckedChanged_chkShowOnlyUsed" runat="server" />
</asp:Panel>
<asp:Panel ID="pnlAction" runat="server" GroupingText="ACTIONS" Font-Bold="true">
<asp:LinkButton CommandName="cmdEditSelected" ID="lbEditSelected" Visible='<%# grdLineItem.EditIndexes.Count = 0 And Not grdLineItem.MasterTableView.IsItemInserted %>'
runat="server">
<img id="Img1" alt="Edit selected row(s)" src="~/images/Edit.gif" runat="server" />
Edit Selected
</asp:LinkButton>
<asp:LinkButton CommandName="cmdEditAll" ID="lbEditAll" Visible='<%# grdLineItem.EditIndexes.Count = 0 And Not grdLineItem.MasterTableView.IsItemInserted %>'
runat="server">
<img id="Img2" alt="Edit all rows" src="~/images/Edit.gif" runat="server" />
Edit All
</asp:LinkButton>
<asp:LinkButton CommandName="cmdUpdateEdited" ID="lbUpdateEdited" visible='<%# grdLineItem.EditIndexes.Count > 0 Or grdLineItem.MasterTableView.IsItemInserted %>'
runat="server">
<img id="Img3" alt="Save edited row(s)" src="~/images/Save.gif" runat="server" />
Save Edit(s)
</asp:LinkButton>
<asp:LinkButton CommandName="cmdCancelAll" ID="lbCancelEdit" runat="server" Visible='<%# grdLineItem.EditIndexes.Count > 0 Or grdLineItem.MasterTableView.IsItemInserted %>'>
<img id="Img4" alt="Cancel edited row(s)" src="~/images/Cancel.gif" runat="server" />
Cancel Edit(s)
</asp:LinkButton>
<asp:LinkButton CommandName="cmdNewLine" ID="btnNewLine" runat="server" Visible='<%# grdLineItem.EditIndexes.Count = 0 And Not grdLineItem.MasterTableView.IsItemInserted %>'
OnClientClick="javascript:return showAddLinePopup();">
<img id="Img9" src="~/images/New.gif" runat="server" alt="" />
Add Line
</asp:LinkButton>
<asp:Label ID="Label4" Text="Legend:" runat="server" />
<asp:Label ID="Label1" BackColor="LightBlue" Text=" Linked " Font-Bold="false"
BorderWidth="1px" BorderStyle="Solid" BorderColor="DarkGray" runat="server" />
<asp:Label ID="Label2" BackColor="#faeeb0" Text=" Locked " Font-Bold="false"
BorderWidth="1px" BorderStyle="Solid" BorderColor="DarkGray" runat="server" />
<asp:Label ID="Label3" BackColor="LightGreen" Text=" Linked & Locked " Font-Bold="false"
BorderWidth="1px" BorderStyle="Solid" BorderColor="DarkGray" runat="server" />
</asp:Panel>
</div>
<asp:Label ID="lblDeptCaption" runat="server" CssClass="tableCaption" />
</CommandItemTemplate>
<Columns>
<rad:GridClientSelectColumn UniqueName="SelectColumn">
<HeaderStyle Width="16px" />
</rad:GridClientSelectColumn>
<rad:GridRowIndicatorColumn UniqueName="Select">
</rad:GridRowIndicatorColumn>
<rad:GridBoundColumn UniqueName="DeptID" HeaderText="Department ID" DataField="DeptID" DataType="System.Int32" ReadOnly="true" Display="false" />
<rad:GridBoundColumn UniqueName="AcctID" HeaderText="Account ID" DataField="AcctID" DataType="System.Int32" ReadOnly="true" Display="false" />
<rad:GridBoundColumn UniqueName="AcctSubTypeName" HeaderText="Account Type" DataField="AcctSubTypeName"
DataType="System.String" ItemStyle-CssClass="GridBoundColumnCss" ReadOnly="true" HeaderStyle-Font-Bold="true" HeaderStyle-VerticalAlign="Bottom" HeaderStyle-HorizontalAlign="Left" SortedBackColor="Transparent" />
<rad:GridBoundColumn UniqueName="AcctCode" HeaderText="Account Code" DataField="AcctCode"
DataType="System.String" ReadOnly="true" HeaderStyle-VerticalAlign="Bottom" HeaderStyle-HorizontalAlign="Left"
HeaderStyle-Font-Bold="true" ItemStyle-CssClass="GridBoundColumnCss" SortedBackColor="Transparent" />
<rad:GridBoundColumn UniqueName="AcctName" HeaderText="Account Name" DataField="AcctName"
DataType="System.String" ReadOnly="true" HeaderStyle-VerticalAlign="Bottom" HeaderStyle-HorizontalAlign="Left"
ItemStyle-CssClass="GridBoundColumnCss" HeaderStyle-Font-Bold="true" SortedBackColor="Transparent" />
<rad:GridTemplateColumn UniqueName="January" HeaderStyle-HorizontalAlign="Left" HeaderStyle-Font-Bold="true">
<ItemStyle HorizontalAlign="Center" VerticalAlign="Top" />
<HeaderTemplate>
<asp:Label ID="lblHdr_1" runat="server" Text="January" /><br />
</HeaderTemplate>
<EditItemTemplate>
<asp:Table ID="tbl1" runat="server">
<asp:TableRow ID="tblRow_DriverType_1" runat="server">
<asp:TableCell>
<span>Driver Type:</span>
</asp:TableCell>
<asp:TableCell>
<asp:DropDownList ID="ddlDriverType_1" runat="server" CssClass="EditDropdown" AppendDataBoundItems="True" Enabled="false">
</asp:DropDownList>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="tblRow_DriverAmt_1" runat="server">
<asp:TableCell>
<span>Driver Amt:</span>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtDriverAmt_1" CssClass="txtBox" runat="server" Text='<%# Eval("LineItemPeriod1.PlanMonthDriverAmount","{0:N2}") %>'
Width="100px" />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="tblRow_DriverAdjAmt_1" runat="server">
<asp:TableCell>
<span>Adjustment:</span>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtAdjAmt_1" CssClass="txtBox" runat="server" Text='<%# Eval("LineItemPeriod1.PlanMonthAdjAmount","{0:N2}") %>'
Width="100px" />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="tblRow_DriverNote_1" runat="server">
<asp:TableCell>
<span>Notes:</span>
</asp:TableCell>
<asp:TableCell HorizontalAlign="Left">
<asp:TextBox ID="txtNote_1" CssClass="txtBox" runat="server" Text='<%# Eval("LineItemPeriod1.PlanMonthRefText") %>'
TextMode="SingleLine" Width="150px" />
<asp:Label ID="lblPeriodGUID_1" runat="server" Text='<%# Eval("LineItemPeriod1.PlanMonthGUID") %>'
Visible="false" />
<asp:Label ID="lblLineGUID_1" runat="server" Text='<%# Eval("LineItemPeriod1.GUID") %>'
Visible="false" />
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblTotalAmt_1" runat="server" Text='<%# Eval("LineItemPeriod1.PlanMonthAmountValue","{0:N2}")%>' />
</ItemTemplate>
</rad:GridTemplateColumn>
<rad:GridTemplateColumn UniqueName="February" HeaderStyle-HorizontalAlign="Left" HeaderStyle-Font-Bold="true">
<ItemStyle HorizontalAlign="Center" VerticalAlign="Top" />
<HeaderTemplate>
<asp:Label ID="lblHdr_2" runat="server" Text="February" /><br />
</HeaderTemplate>
<EditItemTemplate>
<asp:Table ID="tbl2" runat="server">
<asp:TableRow ID="tblRow_DriverType_2" runat="server">
<asp:TableCell>
<span>Driver Type:</span>
</asp:TableCell>
<asp:TableCell>
<asp:DropDownList ID="ddlDriverType_2" runat="server" CssClass="EditDropdown" AppendDataBoundItems="True" Enabled="false">
</asp:DropDownList>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="tblRow_DriverAmt_2" runat="server">
<asp:TableCell>
<span>Driver Amt:</span>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtDriverAmt_2" CssClass="txtBox" runat="server" Text='<%# Eval("LineItemPeriod2.PlanMonthDriverAmount","{0:N2}") %>'
Width="100px" />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="tblRow_DriverAdjAmt_2" runat="server">
<asp:TableCell>
<span>Adjustment:</span>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtAdjAmt_2" CssClass="txtBox" runat="server" Text='<%# Eval("LineItemPeriod2.PlanMonthAdjAmount","{0:N2}") %>'
Width="100px" />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="tblRow_DriverNote_2" runat="server">
<asp:TableCell>
<span>Notes:</span>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtNote_2" CssClass="txtBox" runat="server" Text='<%# Eval("LineItemPeriod2.PlanMonthRefText") %>'
TextMode="SingleLine" Width="150px" />
<asp:Label ID="lblPeriodGUID_2" runat="server" Text='<%# Eval("LineItemPeriod2.PlanMonthGUID") %>'
Visible="false" />
<asp:Label ID="lblLineGUID_2" runat="server" Text='<%# Eval("LineItemPeriod2.GUID") %>'
Visible="false" />
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblTotalAmt_2" runat="server" Text='<%# Eval("LineItemPeriod2.PlanMonthAmountValue","{0:N2}")%>' />
</ItemTemplate>
</rad:GridTemplateColumn>
<rad:GridTemplateColumn UniqueName="March" HeaderStyle-HorizontalAlign="Left" HeaderStyle-Font-Bold="true">
<ItemStyle HorizontalAlign="Center" VerticalAlign="Top" />
<HeaderTemplate>
<asp:Label ID="lblHdr_3" runat="server" Text="March" /><br />
</HeaderTemplate>
<EditItemTemplate>
<asp:Table ID="tbl3" runat="server">
<asp:TableRow ID="tblRow_DriverType_3" runat="server">
<asp:TableCell>
<span>Driver Type:</span>
</asp:TableCell>
<asp:TableCell>
<asp:DropDownList ID="ddlDriverType_3" runat="server" CssClass="EditDropdown" AppendDataBoundItems="True"
Enabled="false">
</asp:DropDownList>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="tblRow_DriverAmt_3" runat="server">
<asp:TableCell>
<span>Driver Amt:</span>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtDriverAmt_3" CssClass="txtBox" runat="server" Text='<%# Eval("LineItemPeriod3.PlanMonthDriverAmount","{0:N2}") %>'
Width="100px" />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="tblRow_DriverAdjAmt_3" runat="server">
<asp:TableCell>
<span>Adjustment:</span>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtAdjAmt_3" CssClass="txtBox" runat="server" Text='<%# Eval("LineItemPeriod3.PlanMonthAdjAmount","{0:N2}") %>'
Width="100px" />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="tblRow_DriverNote_3" runat="server">
<asp:TableCell>
<span>Notes:</span>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtNote_3" CssClass="txtBox" runat="server" Text='<%# Eval("LineItemPeriod3.PlanMonthRefText") %>'
TextMode="SingleLine" Width="150px" />
<asp:Label ID="lblPeriodGUID_3" runat="server" Text='<%# Eval("LineItemPeriod3.PlanMonthGUID") %>'
Visible="false" />
<asp:Label ID="lblLineGUID_3" runat="server" Text='<%# Eval("LineItemPeriod3.GUID") %>'
Visible="false" />
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblTotalAmt_3" runat="server" Text='<%# Eval("LineItemPeriod3.PlanMonthAmountValue","{0:N2}")%>' />
</ItemTemplate>
</rad:GridTemplateColumn>
<rad:GridTemplateColumn UniqueName="April" HeaderStyle-HorizontalAlign="Left" HeaderStyle-Font-Bold="true">
<ItemStyle HorizontalAlign="Center" VerticalAlign="Top" />
<HeaderTemplate>
<asp:Label ID="lblHdr_4" runat="server" Text="April" /><br />
</HeaderTemplate>
<EditItemTemplate>
<asp:Table ID="tbl4" runat="server">
<asp:TableRow ID="tblRow_DriverType_4" runat="server">
<asp:TableCell>
<span>Driver Type:</span>
</asp:TableCell>
<asp:TableCell>
<asp:DropDownList ID="ddlDriverType_4" runat="server" CssClass="EditDropdown" AppendDataBoundItems="True"
Enabled="false">
</asp:DropDownList>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="tblRow_DriverAmt_4" runat="server">
<asp:TableCell>
<span>Driver Amount:</span>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtDriverAmt_4" CssClass="txtBox" runat="server" Text='<%# Eval("LineItemPeriod4.PlanMonthDriverAmount","{0:N2}") %>'
Width="100px" />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="tblRow_DriverAdjAmt_4" runat="server">
<asp:TableCell>
<span>Adjustment:</span>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtAdjAmt_4" CssClass="txtBox" runat="server" Text='<%# Eval("LineItemPeriod4.PlanMonthAdjAmount","{0:N2}") %>'
Width="100px" />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="tblRow_DriverNote_4" runat="server">
<asp:TableCell>
<span>Notes:</span>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtNote_4" CssClass="txtBox" runat="server" Text='<%# Eval("LineItemPeriod4.PlanMonthRefText") %>'
TextMode="SingleLine" Width="150px" />
<asp:Label ID="lblPeriodGUID_4" runat="server" Text='<%# Eval("LineItemPeriod4.PlanMonthGUID") %>'
Visible="false" />
<asp:Label ID="lblLineGUID_4" runat="server" Text='<%# Eval("LineItemPeriod4.GUID") %>'
Visible="false" />
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblTotalAmt_4" runat="server" Text='<%# Eval("LineItemPeriod4.PlanMonthAmountValue","{0:N2}")%>' />
</ItemTemplate>
</rad:GridTemplateColumn>
<rad:GridTemplateColumn UniqueName="May" HeaderStyle-HorizontalAlign="Left" HeaderStyle-Font-Bold="true">
<ItemStyle HorizontalAlign="Center" VerticalAlign="Top" />
<HeaderTemplate>
<asp:Label ID="lblHdr_5" runat="server" Text="May" /><br />
</HeaderTemplate>
<EditItemTemplate>
<asp:Table ID="tbl5" runat="server">
<asp:TableRow ID="tblRow_DriverType_5" runat="server">
<asp:TableCell>
<span>Driver Type:</span>
</asp:TableCell>
<asp:TableCell>
<asp:DropDownList ID="ddlDriverType_5" runat="server" CssClass="EditDropdown" AppendDataBoundItems="True"
Enabled="false">
</asp:DropDownList>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="tblRow_DriverAmt_5" runat="server">
<asp:TableCell>
<span>Driver Amount:</span>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtDriverAmt_5" CssClass="txtBox" runat="server" Text='<%# Eval("LineItemPeriod5.PlanMonthDriverAmount","{0:N2}") %>'
Width="100px" />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="tblRow_DriverAdjAmt_5" runat="server">
<asp:TableCell>
<span>Adjustment:</span>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtAdjAmt_5" CssClass="txtBox" runat="server" Text='<%# Eval("LineItemPeriod5.PlanMonthAdjAmount","{0:N2}") %>'
Width="100px" />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="tblRow_DriverNote_5" runat="server">
<asp:TableCell>
<span>Notes:</span>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtNote_5" CssClass="txtBox" runat="server" Text='<%# Eval("LineItemPeriod5.PlanMonthRefText") %>'
TextMode="SingleLine" Width="150px" />
<asp:Label ID="lblPeriodGUID_5" runat="server" Text='<%# Eval("LineItemPeriod5.PlanMonthGUID") %>'
Visible="false" />
<asp:Label ID="lblLineGUID_5" runat="server" Text='<%# Eval("LineItemPeriod5.GUID") %>'
Visible="false" />
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblTotalAmt_5" runat="server" Text='<%# Eval("LineItemPeriod5.PlanMonthAmountValue","{0:N2}")%>' />
</ItemTemplate>
</rad:GridTemplateColumn>
<rad:GridTemplateColumn UniqueName="June" HeaderStyle-HorizontalAlign="Left" HeaderStyle-Font-Bold="true">
<ItemStyle HorizontalAlign="Center" VerticalAlign="Top" />
<HeaderTemplate>
<asp:Label ID="lblHdr_6" runat="server" Text="June" /><br />
</HeaderTemplate>
<EditItemTemplate>
<asp:Table ID="tbl6" runat="server">
<asp:TableRow ID="tblRow_DriverType_6" runat="server">
<asp:TableCell>
<span>Driver Type:</span>
</asp:TableCell>
<asp:TableCell>
<asp:DropDownList ID="ddlDriverType_6" runat="server" CssClass="EditDropdown" AppendDataBoundItems="True"
Enabled="false">
</asp:DropDownList>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="tblRow_DriverAmt_6" runat="server">
<asp:TableCell>
<span>Driver Amt:</span>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtDriverAmt_6" CssClass="txtBox" runat="server" Text='<%# Eval("LineItemPeriod6.PlanMonthDriverAmount","{0:N2}") %>'
Width="100px" />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="tblRow_DriverAdjAmt_6" runat="server">
<asp:TableCell>
<span>Adjustment:</span>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtAdjAmt_6" CssClass="txtBox" runat="server" Text='<%# Eval("LineItemPeriod6.PlanMonthAdjAmount","{0:N2}") %>'
Width="100px" />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="tblRow_DriverNote_6" runat="server">
<asp:TableCell>
<span>Notes:</span>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtNote_6" CssClass="txtBox" runat="server" Text='<%# Eval("LineItemPeriod6.PlanMonthRefText") %>'
TextMode="SingleLine" Width="150px" />
<asp:Label ID="lblPeriodGUID_6" runat="server" Text='<%# Eval("LineItemPeriod6.PlanMonthGUID") %>'
Visible="false" />
<asp:Label ID="lblLineGUID_6" runat="server" Text='<%# Eval("LineItemPeriod6.GUID") %>'
Visible="false" />
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblTotalAmt_6" runat="server" Text='<%# Eval("LineItemPeriod6.PlanMonthAmountValue","{0:N2}")%>' />
</ItemTemplate>
</rad:GridTemplateColumn>
<rad:GridTemplateColumn UniqueName="July" HeaderStyle-HorizontalAlign="Left" HeaderStyle-Font-Bold="true">
<ItemStyle HorizontalAlign="Center" VerticalAlign="Top" />
<HeaderTemplate>
<asp:Label ID="lblHdr_7" runat="server" Text="July" /><br />
</HeaderTemplate>
<EditItemTemplate>
<asp:Table ID="tbl_7" runat="server">
<asp:TableRow ID="tblRow_DriverType_7" runat="server">
<asp:TableCell>
<span>Driver Type:</span>
</asp:TableCell>
<asp:TableCell>
<asp:DropDownList ID="ddlDriverType_7" runat="server" CssClass="EditDropdown" AppendDataBoundItems="True"
Enabled="false">
</asp:DropDownList>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="tblRow_DriverAmt_7" runat="server">
<asp:TableCell>
<span>Driver Amount:</span>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtDriverAmt_7" CssClass="txtBox" runat="server" Text='<%# Eval("LineItemPeriod7.PlanMonthDriverAmount","{0:N2}") %>'
Width="100px" />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="tblRow_DriverAdjAmt_7" runat="server">
<asp:TableCell>
<span>Adjustment:</span>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtAdjAmt_7" CssClass="txtBox" runat="server" Text='<%# Eval("LineItemPeriod7.PlanMonthAdjAmount","{0:N2}") %>'
Width="100px" />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="tblRow_DriverNote_7" runat="server">
<asp:TableCell>
<span>Notes:</span>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtNote_7" CssClass="txtBox" runat="server" Text='<%# Eval("LineItemPeriod7.PlanMonthRefText") %>'
TextMode="SingleLine" Width="150px" />
<asp:Label ID="lblPeriodGUID_7" runat="server" Text='<%# Eval("LineItemPeriod7.PlanMonthGUID") %>'
Visible="false" />
<asp:Label ID="lblLineGUID_7" runat="server" Text='<%# Eval("LineItemPeriod7.GUID") %>'
Visible="false" />
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblTotalAmt_7" runat="server" Text='<%# Eval("LineItemPeriod7.PlanMonthAmountValue","{0:N2}")%>' />
</ItemTemplate>
</rad:GridTemplateColumn>
<rad:GridTemplateColumn UniqueName="August" HeaderStyle-HorizontalAlign="Left" HeaderStyle-Font-Bold="true">
<ItemStyle HorizontalAlign="Center" VerticalAlign="Top" />
<HeaderTemplate>
<asp:Label ID="lblHdr_8" runat="server" Text="August" /><br />
</HeaderTemplate>
<EditItemTemplate>
<asp:Table ID="tbl_8" runat="server">
<asp:TableRow ID="tblRow_DriverType_8" runat="server">
<asp:TableCell>
<span>Driver Type:</span>
</asp:TableCell>
<asp:TableCell>
<asp:DropDownList ID="ddlDriverType_8" runat="server" CssClass="EditDropdown" AppendDataBoundItems="True"
Enabled="false">
</asp:DropDownList>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="tblRow_DriverAmt_8" runat="server">
<asp:TableCell>
<span>Driver Amount:</span>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtDriverAmt_8" CssClass="txtBox" runat="server" Text='<%# Eval("LineItemPeriod8.PlanMonthDriverAmount","{0:N2}") %>'
Width="100px" />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="tblRow_DriverAdjAmt_8" runat="server">
<asp:TableCell>
<span>Adjustment:</span>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtAdjAmt_8" CssClass="txtBox" runat="server" Text='<%# Eval("LineItemPeriod8.PlanMonthAdjAmount","{0:N2}") %>'
Width="100px" />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="tblRow_DriverNote_8" runat="server">
<asp:TableCell>
<span>Notes:</span>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtNote_8" CssClass="txtBox" runat="server" Text='<%# Eval("LineItemPeriod8.PlanMonthRefText") %>'
TextMode="SingleLine" Width="150px" />
<asp:Label ID="lblPeriodGUID_8" runat="server" Text='<%# Eval("LineItemPeriod8.PlanMonthGUID") %>'
Visible="false" />
<asp:Label ID="lblLineGUID_8" runat="server" Text='<%# Eval("LineItemPeriod8.GUID") %>'
Visible="false" />
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblTotalAmt_8" runat="server" Text='<%# Eval("LineItemPeriod8.PlanMonthAmountValue","{0:N2}")%>' />
</ItemTemplate>
</rad:GridTemplateColumn>
<rad:GridTemplateColumn UniqueName="September" HeaderStyle-HorizontalAlign="Left" HeaderStyle-Font-Bold="true">
<ItemStyle HorizontalAlign="Center" VerticalAlign="Top" />
<HeaderTemplate>
<asp:Label ID="lblHdr_9" runat="server" Text="September" /><br />
</HeaderTemplate>
<EditItemTemplate>
<asp:Table ID="tbl_9" runat="server">
<asp:TableRow ID="tblRow_DriverType_9" runat="server">
<asp:TableCell>
<span>Driver Type:</span>
</asp:TableCell>
<asp:TableCell>
<asp:DropDownList ID="ddlDriverType_9" runat="server" CssClass="EditDropdown" AppendDataBoundItems="True"
Enabled="false">
</asp:DropDownList>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="tblRow_DriverAmt_9" runat="server">
<asp:TableCell>
<span>Driver Amount:</span>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtDriverAmt_9" CssClass="txtBox" runat="server" Text='<%# Eval("LineItemPeriod9.PlanMonthDriverAmount","{0:N2}") %>'
Width="100px" />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="tblRow_DriverAdjAmt_9" runat="server">
<asp:TableCell>
<span>Adjustment:</span>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtAdjAmt_9" CssClass="txtBox" runat="server" Text='<%# Eval("LineItemPeriod9.PlanMonthAdjAmount","{0:N2}") %>'
Width="100px" />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="tblRow_DriverNote_9" runat="server">
<asp:TableCell>
<span>Notes:</span>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtNote_9" CssClass="txtBox" runat="server" Text='<%# Eval("LineItemPeriod9.PlanMonthRefText") %>'
TextMode="SingleLine" Width="150px" />
<asp:Label ID="lblPeriodGUID_9" runat="server" Text='<%# Eval("LineItemPeriod9.PlanMonthGUID") %>'
Visible="false" />
<asp:Label ID="lblLineGUID_9" runat="server" Text='<%# Eval("LineItemPeriod9.GUID") %>'
Visible="false" />
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblTotalAmt_9" runat="server" Text='<%# Eval("LineItemPeriod9.PlanMonthAmountValue","{0:N2}")%>' />
</ItemTemplate>
</rad:GridTemplateColumn>
<rad:GridTemplateColumn UniqueName="October" HeaderStyle-HorizontalAlign="Left"
HeaderStyle-Font-Bold="true">
<ItemStyle HorizontalAlign="Center" VerticalAlign="Top" />
<HeaderTemplate>
<asp:Label ID="lblHdr_10" runat="server" Text="October" /><br />
</HeaderTemplate>
<EditItemTemplate>
<asp:Table ID="tbl_10" runat="server">
<asp:TableRow ID="tblRow_DriverType_10" runat="server">
<asp:TableCell>
<span>Driver Type:</span>
</asp:TableCell>
<asp:TableCell>
<asp:DropDownList ID="ddlDriverType_10" runat="server" CssClass="EditDropdown" AppendDataBoundItems="True"
Enabled="false">
</asp:DropDownList>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="tblRow_DriverAmt_10" runat="server">
<asp:TableCell>
<span>Driver Amount:</span>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtDriverAmt_10" CssClass="txtBox" runat="server" Text='<%# Eval("LineItemPeriod10.PlanMonthDriverAmount","{0:N2}") %>'
Width="100px" />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="tblRow_DriverAdjAmt_10" runat="server">
<asp:TableCell>
<span>Adjustment:</span>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtAdjAmt_10" CssClass="txtBox" runat="server" Text='<%# Eval("LineItemPeriod10.PlanMonthAdjAmount","{0:N2}") %>'
Width="100px" />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="tblRow_DriverNote_10" runat="server">
<asp:TableCell>
<span>Notes:</span>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtNote_10" CssClass="txtBox" runat="server" Text='<%# Eval("LineItemPeriod10.PlanMonthRefText") %>'
TextMode="SingleLine" Width="150px" />
<asp:Label ID="lblPeriodGUID_10" runat="server" Text='<%# Eval("LineItemPeriod10.PlanMonthGUID") %>'
Visible="false" />
<asp:Label ID="lblLineGUID_10" runat="server" Text='<%# Eval("LineItemPeriod10.GUID") %>'
Visible="false" />
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblTotalAmt_10" runat="server" Text='<%# Eval("LineItemPeriod10.PlanMonthAmountValue","{0:N2}")%>' />
</ItemTemplate>
</rad:GridTemplateColumn>
<rad:GridTemplateColumn UniqueName="November" HeaderStyle-HorizontalAlign="Left"
HeaderStyle-Font-Bold="true">
<ItemStyle HorizontalAlign="Center" VerticalAlign="Top" />
<HeaderTemplate>
<asp:Label ID="lblHdr_11" runat="server" Text="November" /><br />
</HeaderTemplate>
<EditItemTemplate>
<asp:Table ID="tbl_11" runat="server">
<asp:TableRow ID="tblRow_DriverType_11" runat="server">
<asp:TableCell>
<span>Driver Type:</span>
</asp:TableCell>
<asp:TableCell>
<asp:DropDownList ID="ddlDriverType_11" runat="server" CssClass="EditDropdown" AppendDataBoundItems="True"
Enabled="false">
</asp:DropDownList>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="tblRow_DriverAmt_11" runat="server">
<asp:TableCell>
<span>Driver Amount:</span>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtDriverAmt_11" CssClass="txtBox" runat="server" Text='<%# Eval("LineItemPeriod11.PlanMonthDriverAmount","{0:N2}") %>'
Width="100px" />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="tblRow_DriverAdjAmt_11" runat="server">
<asp:TableCell>
<span>Adjustment:</span>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtAdjAmt_11" CssClass="txtBox" runat="server" Text='<%# Eval("LineItemPeriod11.PlanMonthAdjAmount","{0:N2}") %>'
Width="100px" />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="tblRow_DriverNote_11" runat="server">
<asp:TableCell>
<span>Notes:</span>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtNote_11" CssClass="txtBox" runat="server" Text='<%# Eval("LineItemPeriod11.PlanMonthRefText") %>'
TextMode="SingleLine" Width="150px" />
<asp:Label ID="lblPeriodGUID_11" runat="server" Text='<%# Eval("LineItemPeriod11.PlanMonthGUID") %>'
Visible="false" />
<asp:Label ID="lblLineGUID_11" runat="server" Text='<%# Eval("LineItemPeriod11.GUID") %>'
Visible="false" />
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblTotalAmt_11" runat="server" Text='<%# Eval("LineItemPeriod11.PlanMonthAmountValue","{0:N2}")%>' />
</ItemTemplate>
</rad:GridTemplateColumn>
<rad:GridTemplateColumn UniqueName="December" HeaderStyle-HorizontalAlign="Left"
HeaderStyle-Font-Bold="true">
<ItemStyle HorizontalAlign="Center" VerticalAlign="Top" />
<HeaderTemplate>
<asp:Label ID="lblHdr_12" runat="server" Text="December" /><br />
</HeaderTemplate>
<EditItemTemplate>
<asp:Table ID="tbl_12" runat="server">
<asp:TableRow ID="tblRow_DriverType_12" runat="server">
<asp:TableCell>
<span>Driver Type:</span>
</asp:TableCell>
<asp:TableCell>
<asp:DropDownList ID="ddlDriverType_12" runat="server" CssClass="EditDropdown" AppendDataBoundItems="True"
Enabled="false">
</asp:DropDownList>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="tblRow_DriverAmt_12" runat="server">
<asp:TableCell>
<span>Driver Amount:</span>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtDriverAmt_12" CssClass="txtBox" runat="server" Text='<%# Eval("LineItemPeriod12.PlanMonthDriverAmount","{0:N2}") %>'
Width="100px" />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="tblRow_DriverAdjAmt_12" runat="server">
<asp:TableCell>
<span>Adjustment:</span>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtAdjAmt_12" CssClass="txtBox" runat="server" Text='<%# Eval("LineItemPeriod12.PlanMonthAdjAmount","{0:N2}") %>'
Width="100px" />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="tblRow_DriverNote_12" runat="server">
<asp:TableCell>
<span>Notes:</span>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtNote_12" CssClass="txtBox" runat="server" Text='<%# Eval("LineItemPeriod12.PlanMonthRefText") %>'
TextMode="SingleLine" Width="150px" />
<asp:Label ID="lblPeriodGUID_12" runat="server" Text='<%# Eval("LineItemPeriod12.PlanMonthGUID") %>'
Visible="false" />
<asp:Label ID="lblLineGUID_12" runat="server" Text='<%# Eval("LineItemPeriod12.GUID") %>'
Visible="false" />
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblTotalAmt_12" runat="server" Text='<%# Eval("LineItemPeriod12.PlanMonthAmountValue","{0:N2}")%>' />
</ItemTemplate>
</rad:GridTemplateColumn>
<rad:GridBoundColumn UniqueName="Total" DataField="Total" HeaderText="Total" ReadOnly="true"
DataFormatString="{0:N2}" HeaderStyle-HorizontalAlign="Left" HeaderStyle-Font-Bold="true" />
<rad:GridBoundColumn UniqueName="POR" DataField="POR" HeaderText="POR" ReadOnly="true"
DataFormatString="{0:N2}" HeaderStyle-HorizontalAlign="Left" HeaderStyle-Font-Bold="true" />
<rad:GridBoundColumn UniqueName="PctRmRev" DataField="PctRmRev" HeaderText="% Rm Rev"
DataFormatString="{0:N2}%" HeaderStyle-HorizontalAlign="Left" HeaderStyle-Font-Bold="true"
ReadOnly="true" />
</Columns>
</rad:GridTableView>
</DetailTables>
<Columns>
</Columns>
<RowIndicatorColumn Visible="False">
<HeaderStyle Width="20px" />
</RowIndicatorColumn>
<ExpandCollapseColumn Visible="True">
<HeaderStyle Width="20px" />
</ExpandCollapseColumn>
</rad:GridTableView>
</DetailTables>
<Columns>
</Columns>
<RowIndicatorColumn Visible="False">
<HeaderStyle Width="20px" />
</RowIndicatorColumn>
<ExpandCollapseColumn Visible="True">
<HeaderStyle Width="20px" />
</ExpandCollapseColumn>
</rad:GridTableView>
</DetailTables>
<Columns>
</Columns>
<RowIndicatorColumn Visible="False">
<HeaderStyle Width="20px" />
</RowIndicatorColumn>
<ExpandCollapseColumn Visible="True">
<HeaderStyle Width="20px" />
</ExpandCollapseColumn>
</MasterTableView>
<ClientSettings EnableClientKeyValues="True">
<Selecting AllowRowSelect="True" />
<Resizing AllowColumnResize="True" EnableRealTimeResize="True" />
<Scrolling UseStaticHeaders="True" />
</ClientSettings>
<SortingSettings SortedBackColor="212, 208, 200" />
</rad:RadGrid>
'Format Code Block'
Private
Sub grdLineItem_NeedDataSource(ByVal source As Object, ByVal e As Telerik.WebControls.GridNeedDataSourceEventArgs) Handles grdLineItem.NeedDataSource
If Not e.IsFromDetailTable Then Me.grdLineItem.DataSource = Me.GetDataSource_Summary()
End Sub
Private Sub grdLineItem_DetailTableDataBind(ByVal source As Object, ByVal e As Telerik.WebControls.GridDetailTableDataBindEventArgs) Handles grdLineItem.DetailTableDataBind
If (TypeOf e.DetailTableView.ParentItem Is GridDataItem) Then
Dim oItem As GridDataItem = DirectCast(e.DetailTableView.ParentItem, GridDataItem)
Select e.DetailTableView.Name
Case "AcctTypeID"
Dim iDeptInGOPFlag As Integer = CType(oItem.OwnerTableView.Items(oItem.ItemIndex)("DeptInGOPFlag").Text, Integer)
e.DetailTableView.DataSource = GetDataSource_AcctType(iDeptInGOPFlag)
Case "DeptID"
Dim iDeptInGOPFlag As Integer = CType(oItem.OwnerTableView.Items(oItem.ItemIndex)("DeptInGOPFlag").Text, Integer)
Dim iAcctTypeID As Integer = CType(oItem.OwnerTableView.Items(oItem.ItemIndex)("AcctTypeID").Text, Integer)
e.DetailTableView.DataSource = GetDataSource_Dept(iAcctTypeID, iDeptInGOPFlag)
Case "LineItems"
Dim iDeptID As Integer = CType(oItem.OwnerTableView.Items(oItem.ItemIndex)("DeptID").Text, Integer)
Dim iAcctTypeID As Integer = CType(oItem.OwnerTableView.Items(oItem.ItemIndex)("AcctTypeID").Text, Integer)
e.DetailTableView.DataSource = mvarEditVersion.GetLineItemListForDisplay(iAcctTypeID,
Me.SelectedAcctSubTypeID, iDeptID, Me.ShowUsedLineItemsOnly)
End Select
End If
End Sub
Private Sub grdLineItem_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles grdLineItem.DataBound
'Expand all items using our custom storage
Dim sIndexes As String() = New String(Me.ExpandedStates.Keys.Count - 1) {}
Me.ExpandedStates.Keys.CopyTo(sIndexes, 0)
Dim aIndexes As New ArrayList(sIndexes)
'Sort so we can guarantee that a parent item is expanded before any of its children
aIndexes.Sort()
'Expanded states
For Each sKey As String In aIndexes
Dim bExpanded As Boolean = CBool(Me.ExpandedStates(sKey))
If bExpanded And Me.grdLineItem.Items.Count > 0 Then grdLineItem.Items(sKey).Expanded = True
Next
'Selected states
sIndexes =
New String(Me.SelectedStates.Keys.Count - 1) {}
Me.SelectedStates.Keys.CopyTo(sIndexes, 0)
aIndexes =
New ArrayList(sIndexes)
'Sort to ensure that a parent item is selected before any of its children
aIndexes.Sort()
For Each key As String In aIndexes
Dim bSelected As Boolean = CBool(Me.SelectedStates(key))
If bSelected Then Me.grdLineItem.Items(key).Selected = True
Next
End Sub
Private Sub grdLineItem_ItemCommand(ByVal source As Object, ByVal e As Telerik.WebControls.GridCommandEventArgs) Handles grdLineItem.ItemCommand
If e.CommandName = RadGrid.ExpandCollapseCommandName Then
If Not e.Item.Expanded Then
'CollapseExpandedDept(e.Item.OwnerTableView)
Me.ExpandedStates(e.Item.ItemIndexHierarchical) = True
Else
Me.ExpandedStates.Remove(e.Item.ItemIndexHierarchical)
Me.ClearExpandedChildren(e.Item.ItemIndexHierarchical)
End If
ElseIf e.CommandName = RadGrid.SelectCommandName Then
Me.SelectedStates(e.Item.ItemIndexHierarchical) = True
ElseIf e.CommandName = RadGrid.DeselectCommandName Then
Me.SelectedStates.Remove(e.Item.ItemIndexHierarchical)
ElseIf e.CommandName = "cmdEditSelected" Then
For Each oItem As GridItem In Me.grdLineItem.SelectedItems
If TypeOf oItem Is GridEditableItem Then
Dim oEdit As GridEditableItem = CType(oItem, GridDataItem)
oEdit.Edit =
True
End If
Next
e.Item.OwnerTableView.Rebind()
ElseIf e.CommandName = "cmdEditAll" Then
For Each oItem As GridItem In Me.grdLineItem.Items
If TypeOf oItem Is GridEditableItem Then
'Checking OwnerTableView ID for each oItem with event item so that only required item will be editable
If (oItem.OwnerTableView.Name = "LineItems") And (e.Item.OwnerTableView.ID = oItem.OwnerTableView.ID) Then
Dim oEdit As GridEditableItem = CType(oItem, GridDataItem)
oEdit.Edit =
True
End If
End If
Next
e.Item.OwnerTableView.Rebind()
ElseIf e.CommandName = RadGrid.UpdateEditedCommandName Or e.CommandName = RadGrid.UpdateCommandName Or e.CommandName = "cmdUpdateEdited" Then
If Me.grdLineItem.EditItems.Count > 0 Then
For Each oItem As GridDataItem In grdLineItem.EditItems
oItem.Edit =
Not UpdateObjectFromGridItem(oItem)
Next
e.Item.OwnerTableView.Rebind()
End If
ElseIf e.CommandName = RadGrid.CancelAllCommandName Or e.CommandName = "cmdCancelAll" Then
If Me.grdLineItem.EditItems.Count > 0 Then
For Each oItem As GridItem In Me.grdLineItem.EditItems
If TypeOf oItem Is GridEditableItem Then
Dim oEdit As GridEditableItem = CType(oItem, GridDataItem)
oEdit.Edit =
False
End If
Next
e.Item.OwnerTableView.Rebind()
End If
End If
End Sub
Private Sub grdLineItem_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.WebControls.GridItemEventArgs) Handles grdLineItem.ItemDataBound
If TypeOf (e.Item) Is GridHeaderItem Then
Dim oItem As GridHeaderItem = e.Item
''ERG - 2012.08.28 - Bold header item
'If oItem.OwnerTableView.Name = "Summary" Then oItem("Details").Font.Bold = True
For Each oMonth As CPlanMonth In mvarEditVersion.MonthList
oItem(SetMonthName(oMonth.MonthID)).Font.Bold =
True
' oItem(SetMonthName(oMonth.MonthID)).Text = oMonth.MonthName
Next
If (oItem("Total") IsNot Nothing) Then oItem("Total").Font.Bold = True
ElseIf TypeOf (e.Item) Is GridDataItem Then
Dim oItem As GridDataItem = e.Item
For Each Month As CPlanMonth In mvarEditVersion.MonthList
oItem(SetMonthName(Month.MonthID)).BackColor = SetPeriodBckColor(Month.MonthID)
oItem(SetMonthName(Month.MonthID)).CssClass =
"right"
Next
If oItem("Total") IsNot Nothing Then
oItem(
"Total").BackColor = System.Drawing.Color.LightGray
oItem(
"Total").CssClass = "right"
End If
End If
Select Case UCase(e.Item.OwnerTableView.Name)
Case "SUMMARY"
If TypeOf (e.Item) Is GridHeaderItem Then
Dim oItem As GridHeaderItem = e.Item
oItem(
"Details").Font.Bold = True
oItem(
"Expandable").Visible = False
oItem(
"DeptInGOPFlag").Visible = False
ElseIf TypeOf (e.Item) Is GridDataItem Then
Dim oItem As GridDataItem = e.Item
oItem(
"Expandable").Visible = False
oItem(
"DeptInGOPFlag").Visible = False
End If
Case "ACCTTYPEID"
If TypeOf (e.Item) Is GridHeaderItem Then
Dim oItem As GridHeaderItem = e.Item
oItem(
"Expandable").Visible = False
oItem(
"DeptInGOPFlag").Visible = False
oItem(
"AcctTypeID").Visible = False
If (oItem("Account Type") IsNot Nothing) Then oItem("Account Type").Font.Bold = True
If oItem("POR") IsNot Nothing Then oItem("POR").Font.Bold = True
If oItem("% Rm Rev") IsNot Nothing Then oItem("% Rm Rev").Font.Bold = True
ElseIf TypeOf (e.Item) Is GridDataItem Then
Dim oItem As GridDataItem = e.Item
oItem(
"Expandable").Visible = False
oItem(
"DeptInGOPFlag").Visible = False
oItem(
"AcctTypeID").Visible = False
If oItem("POR") IsNot Nothing Then
oItem(
"POR").BackColor = System.Drawing.Color.LightGray
oItem(
"POR").CssClass = "right"
End If
If oItem("% Rm Rev") IsNot Nothing Then
oItem(
"% Rm Rev").BackColor = System.Drawing.Color.LightGray
oItem(
"% Rm Rev").CssClass = "right"
End If
ElseIf TypeOf (e.Item) Is GridCommandItem Then
BindGridCommandItem(e.Item)
ElseIf TypeOf (e.Item) Is GridFooterItem Then
Dim oItem As GridFooterItem = e.Item
oItem(
"AcctTypeID").Visible = False
End If
Case "DEPTID"
If TypeOf (e.Item) Is GridHeaderItem Then
Dim oItem As GridHeaderItem = e.Item
oItem(
"AcctTypeID").Visible = False
oItem(
"DeptID").Visible = False
oItem(
"Expandable").Visible = False
oItem(
"DeptInGOPFlag").Visible = False
If (oItem("Department") IsNot Nothing) Then oItem("Department").Font.Bold = True
If oItem("POR") IsNot Nothing Then oItem("POR").Font.Bold = True
If oItem("% Rm Rev") IsNot Nothing Then oItem("% Rm Rev").Font.Bold = True
ElseIf TypeOf (e.Item) Is GridDataItem Then
Dim oItem As GridDataItem = e.Item
oItem(
"AcctTypeID").Visible = False
oItem(
"DeptID").Visible = False
oItem(
"Expandable").Visible = False
oItem(
"DeptInGOPFlag").Visible = False
If oItem("POR") IsNot Nothing Then
oItem(
"POR").BackColor = System.Drawing.Color.LightGray
oItem(
"POR").CssClass = "right"
End If
If oItem("% Rm Rev") IsNot Nothing Then
oItem(
"% Rm Rev").BackColor = System.Drawing.Color.LightGray
oItem(
"% Rm Rev").CssClass = "right"
End If
ElseIf TypeOf (e.Item) Is GridCommandItem Then
BindGridCommandItem(e.Item)
ElseIf TypeOf (e.Item) Is GridFooterItem Then
Dim oItem As GridFooterItem = e.Item
oItem(
"AcctTypeID").Visible = False
oItem(
"DeptID").Visible = False
End If
Case "LINEITEMS"
If TypeOf (e.Item) Is GridHeaderItem Then
Dim oItem As GridHeaderItem = e.Item
'Set visible false for periods column not contains in a plan
For iMonth As Integer = mvarEditVersion.MonthList.Count + 1 To 12
oItem(SetMonthName(iMonth)).Visible =
False
Next
ElseIf TypeOf (e.Item) Is GridDataItem Then
Dim oItem As GridDataItem = e.Item
'Set ToolTip, Lock/Link attribute settings for lineitem.
BindGridLineItem(e.Item)
BindDriverTypeDropdown(oItem)
'Set visible false for periods column not contains in a plan
For iMonth As Integer = mvarEditVersion.MonthList.Count + 1 To 12
oItem(SetMonthName(iMonth)).Visible =
False
Next
If oItem("POR") IsNot Nothing Then
oItem(
"POR").BackColor = System.Drawing.Color.LightGray
oItem(
"POR").CssClass = "right"
End If
If oItem("PctRmRev") IsNot Nothing Then
oItem(
"PctRmRev").BackColor = System.Drawing.Color.LightGray
oItem(
"PctRmRev").CssClass = "right"
End If
ElseIf TypeOf (e.Item) Is GridFooterItem Then
Dim oItem As GridFooterItem = e.Item
For iMonth As Integer = mvarEditVersion.MonthList.Count + 1 To 12
oItem(SetMonthName(iMonth)).Visible =
False
Next
End If
End Select
End Sub
Private
Sub ClearExpandedChildren(ByVal sParentIndex As String)
'Rekha on 19-July-2011- for retaining the expanded mode in grid
'Clear the state for all expanded children if a parent item is collapsed
Dim aIndex As String() = New String(Me.ExpandedStates.Keys.Count - 1) {}
Me.ExpandedStates.Keys.CopyTo(aIndex, 0)
For Each sIndex As String In aIndex
If sIndex.StartsWith(sParentIndex & "_") OrElse sIndex.StartsWith(sParentIndex & ":") Then Me.ExpandedStates.Remove(sIndex)
Next
End Sub
Private Sub CollapseExpandedDept(ByVal grdTblView As GridTableView)
'Clear the state for all expanded department Lineitems if a another on expanded
If grdTblView.Name = "DeptID" Then
Dim aIndex As String() = New String(Me.ExpandedStates.Keys.Count - 1) {}
Me.ExpandedStates.Keys.CopyTo(aIndex, 0)
For Each sIndex As String In aIndex
If sIndex.Split(":").Length > 2 Then
Me.ExpandedStates.Remove(sIndex)
If Me.grdLineItem.Items.Count > 0 Then grdLineItem.Items(sIndex).Expanded = False
End If
Next
End If
End Sub