<DetailTables>
<telerik:GridTableView AutoGenerateColumns="false" ItemStyle-CssClass="RadGridview" DataKeyNames = "CGTASK_ID,Confirmed" Name="Schedules" AllowSorting="true" Width="100%" InsertItemPageIndexAction="ShowItemOnFirstPage" HierarchyDefaultExpanded="True">
<ParentTableRelation>
<telerik:GridRelationFields DetailKeyField="ClientID" MasterKeyField="ClientID" />
</ParentTableRelation>
<Columns>
<telerik:GridBoundColumn HeaderText="Date" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" ItemStyle-Width="8%" HeaderStyle-Width="8%" DataField="VisitDate" AllowSorting="true" SortExpression="VisitDate"> </telerik:GridBoundColumn>
<telerik:GridTemplateColumn UniqueName="CaregiverEditColumn" SortExpression="CaregiverNamewithAssign" ItemStyle-Width="22%" HeaderStyle-Width="22%" Reorderable="true" >
<HeaderTemplate>
<asp:Label ID="lbl_cgName" runat="server" Text="Clinician Name"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<a href="<%#winlocation%>"><%# CaregiverNamewithAssign %></a>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn HeaderText="DISP" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="8%" HeaderStyle-Width="8%" DataField="VPEDiscipline" AllowSorting="true" SortExpression="Discipline"> </telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Job Code" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="8%" HeaderStyle-Width="8%" DataField="JobCode" AllowSorting="true" SortExpression="JobCode"> </telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Description" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" ItemStyle-Width="22%" HeaderStyle-Width="22%" DataField="Description" AllowSorting="true" SortExpression="Description"> </telerik:GridBoundColumn>
<telerik:GridTemplateColumn Visible="true" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" >
<HeaderTemplate>
<asp:Label ID="lbl_cgconfirmed" UniqueName="Child1Template" runat="server" Text="Confirmed"></asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="chkbx_cgconfirmed" runat="server" oncheckedchanged="chkbx_cgconfirmed_CheckedChanged" AutoPostBack="true" TaskId="<%#TaskID%>" />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn HeaderText="Start Time" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="8%" HeaderStyle-Width="8%" DataField="StartTime" AllowSorting="true" SortExpression="StartTime"> </telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="End Time" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="8%" HeaderStyle-Width="8%" DataField="EndTime" AllowSorting="true" SortExpression="EndTime"> </telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Total Hours" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="8%" HeaderStyle-Width="8%" DataField="TotalHours" AllowSorting="true" SortExpression="TotalHours"> </telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Status" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" ItemStyle-Width="8%" HeaderStyle-Width="8%" DataField="Status" SortExpression="Status"> </telerik:GridBoundColumn>
</Columns>
<ClientSettings >
<Scrolling AllowScroll="true" UseStaticHeaders="false" SaveScrollPosition="true">
</Scrolling>
</ClientSettings>
</telerik:GridTableView>
</DetailTables>
</MasterTableView>
<
telerik:RadGrid ... AllowFilteringByColumn="True" />
<
telerik:GridNumericColumn DataField="CityId" DataType="System.Int32" HeaderText="ID" SortExpression="CityId" UniqueName="CityId" CurrentFilterFunction="EqualTo" ShowFilterIcon="false" AutoPostBackOnFilter="true"/>
<
rad:RadTreeView ID="RadTreeView1" runat="server" Height="96%" OnClientContextMenuShowing="OnClientContextmenuShowing"
OnClientNodeClicked="OnTreeNodeClick" OnClientDoubleClick="OnTreeNodeDoubleClick"
OnClientContextMenuItemClicked="OnTreeContextMenuClick" OnClientNodeExpanding="toggleHandler"
OnClientNodeCollapsing="toggleHandler">
</rad:RadTreeView>
function OnClientContextmenuShowing(sender, e) {
//Get the ajax manager object
clientAjaxRequest("UpdateMenu");
return false;
}
function clientAjaxRequest(arg) { var ajaxManagerObject = $find("<%= RadAjaxManager1.ClientID %>"); ajaxManagerObject.ajaxRequest(arg); } <
telerik:RadBinaryImage ID="RadBinaryImage1" runat="server" ImageUrl="Photo/Grid-Scrolling-Issue.jpg" ResizeMode="Fit" Height="100px" Width="100px"/>
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" OnDetailTableDataBind="RadGrid1_DetailTableDataBind" GridLines="None" onitemdatabound="RadGrid1_ItemDataBound" > <MasterTableView DataKeyNames="ParentID, LearningObjectID, IsCriteria, ShowOverview, ShowNotes, ShowSchematic, LearningObject_Overview, LearningObject_Notes, SchematicFilename, OriginalSchematicFilename" AllowSorting="true" Width="100%" HierarchyLoadMode="ServerOnDemand" CommandItemDisplay="Top"> <CommandItemTemplate> <asp:Table ID="tblInfo" runat="server"> <asp:TableRow ID="rowOverview"> <asp:TableCell> <asp:Label ID="ttlOverview" Font-Bold="true" Font-Size="Small" ForeColor="Black" runat="server" Text="Overview:"></asp:Label> </asp:TableCell> <asp:TableCell> <asp:Label ID="txtOverview" Font-Size="Small" ForeColor="Black" runat="server"></asp:Label> </asp:TableCell> </asp:TableRow> <asp:TableRow ID="rowNotes"> <asp:TableCell> <asp:Label ID="ttlNotes" Font-Bold="true" Font-Size="Small" ForeColor="Black" runat="server" Text="Notes:"></asp:Label> </asp:TableCell> <asp:TableCell> <asp:Label ID="txtNotes" Font-Size="Small" ForeColor="Black" runat="server"></asp:Label> </asp:TableCell> </asp:TableRow> <asp:TableRow ID="rowSchematic"> <asp:TableCell> <asp:Label ID="ttlSchematic" Font-Bold="true" Font-Size="Small" ForeColor="Black" runat="server" Text="Schematic:"></asp:Label> </asp:TableCell> <asp:TableCell> <asp:HyperLink ID="lnkSchematic" Font-Size="Small" ForeColor="Black" runat="server" Text="Click Here To View" Target="_blank" /> <asp:Label ID="txtSchematic" Font-Size="Small" ForeColor="Black" runat="server" Text="There is no schematic for this entry"></asp:Label> </asp:TableCell></asp:TableRow></asp:Table></CommandItemTemplate><CommandItemSettings ExportToPdfText="Export to Pdf"> </CommandItemSettings> <SelfHierarchySettings ParentKeyName="ParentID" KeyName="LearningObjectID" /> <RowIndicatorColumn> <HeaderStyle Width="20px"></HeaderStyle> </RowIndicatorColumn> <ExpandCollapseColumn> <HeaderStyle Width="20px"></HeaderStyle> </ExpandCollapseColumn> <Columns> <telerik:GridImageColumn HeaderStyle-Width="20px" DataImageUrlFields="IconURL"></telerik:GridImageColumn> <telerik:GridBoundColumn DataField="Code" HeaderText="<%$ Resources:Code %>" SortExpression="Code" UniqueName="Code" HeaderStyle-Width="100px" ItemStyle-Width="100px"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="LearningObjective" HeaderText="<%$ Resources:LearningObjective %>" SortExpression="LearningObjective" UniqueName="LearningObjective"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="CriticalPercentage" DataType="System.Double" HeaderStyle-Width="75px" ItemStyle-Width="75px" HeaderText="<%$ Resources:CriticalPercentage %>" ReadOnly="True" SortExpression="CriticalPercentage" UniqueName="CriticalPercentage" DataFormatString="{0}%"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="NonCriticalPercentage" DataType="System.Double" HeaderStyle-Width="75px" ItemStyle-Width="75px" HeaderText="<%$ Resources:NonCriticalPercentage %>" ReadOnly="True" SortExpression="NonCriticalPercentage" UniqueName="NonCriticalPercentage" DataFormatString="{0}%"> </telerik:GridBoundColumn> </Columns> </MasterTableView> </telerik:RadGrid>protected void RadGrid1_DetailTableDataBind(object source, GridDetailTableDataBindEventArgs e) { //Get the info on the parent item GridDataItem parentItem = e.DetailTableView.ParentItem as GridDataItem; int LearningObjectID = (int)parentItem.GetDataKeyValue("LearningObjectID"); //Get the info on the table that is to be opened. CMASDALTableAdapters.AssessUsersPositionSuitabilityTableAdapter assessment = new CMASDALTableAdapters.AssessUsersPositionSuitabilityTableAdapter(); CMASDAL.AssessUsersPositionSuitabilityDataTable dt = assessment.GetAssessUsersPositionSuitability(int.Parse(Session["ClientID"].ToString()), EmployeeSelector1.SelectedPositionID, LearningObjectID, EmployeeSelector1.SelectedEmployeeID); //Check it has children if (dt.Count > 0) { //Find out if the children are criteria and therefore the bottom level and need the alternate table layout. if (dt[0].IsCriteria) { //Get the data for the new table layout CMASDALTableAdapters.AssessUsersPositionSuitabilityCriteriaTableAdapter assessment2 = new CMASDALTableAdapters.AssessUsersPositionSuitabilityCriteriaTableAdapter(); e.DetailTableView.DataSource = assessment2.GetAssessUsersPositionSuitabilityCriteria(int.Parse(Session["ClientID"].ToString()), EmployeeSelector1.SelectedPositionID, LearningObjectID, EmployeeSelector1.SelectedEmployeeID); //Add the additional columns that I need to my collection. //Important: first Add column to the collection GridBoundColumn nameColumn = new GridBoundColumn(); e.DetailTableView.Columns.Add(nameColumn); //Then set properties nameColumn.DataField = "AssessorName"; nameColumn.HeaderText = "Assessor"; nameColumn.HeaderStyle.Width = 150; //Important: first Add column to the collection GridBoundColumn dateColumn = new GridBoundColumn(); e.DetailTableView.Columns.Add(dateColumn); //Then set properties dateColumn.DataField = "AssessmentDate"; dateColumn.HeaderText = "Assessment Date"; dateColumn.HeaderStyle.Width = 75; dateColumn.DataFormatString = "{0:d}"; //Important: first Add column to the collection GridBoundColumn statusColumn = new GridBoundColumn(); e.DetailTableView.Columns.Add(statusColumn); //Then set properties statusColumn.DataField = "AssessmentStatus"; statusColumn.HeaderText = "Assessment Status"; statusColumn.HeaderStyle.Width = 75; //Important: first Add column to the collection GridBoundColumn method1Column = new GridBoundColumn(); e.DetailTableView.Columns.Add(method1Column); //Then set properties method1Column.DataField = "AssessmentMethod1"; method1Column.HeaderText = "Assessment Method 1"; method1Column.HeaderStyle.Width = 75; //Important: first Add column to the collection GridBoundColumn method2Column = new GridBoundColumn(); e.DetailTableView.Columns.Add(method2Column); //Then set properties method2Column.DataField = "AssessmentMethod2"; method2Column.HeaderText = "Assessment Method 2"; method2Column.HeaderStyle.Width = 75; //Get rid of the columns I don't need. GridColumn critPercentageCol = e.DetailTableView.Columns[3]; GridColumn nonCritPercentageCol = e.DetailTableView.Columns[4]; e.DetailTableView.Columns.Remove(critPercentageCol); e.DetailTableView.Columns.Remove(nonCritPercentageCol); //GridColumn newCol = new GridColumn(); //e.DetailTableView.Columns.Add(); } else e.DetailTableView.DataSource = dt; } else e.DetailTableView.DataSource = dt; } protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) { //If its the command area prepare to show overview/notes etc. if (e.Item is GridCommandItem) { GridDataItem parentItem = e.Item.OwnerTableView.ParentItem as GridDataItem; if (parentItem != null) { //Get the information about the parent item bool showOverview = (bool)parentItem.GetDataKeyValue("ShowOverview"); bool showNotes = (bool)parentItem.GetDataKeyValue("ShowNotes"); bool showSchematic = (bool)parentItem.GetDataKeyValue("ShowSchematic"); string strOverview = (string)parentItem.GetDataKeyValue("LearningObject_Overview"); string strNotes = (string)parentItem.GetDataKeyValue("LearningObject_Notes"); string lnkSchematicFilename = (string)parentItem.GetDataKeyValue("SchematicFilename"); GridCommandItem commandItem = (GridCommandItem)e.Item; //Show and hide appropriate fields. if (showOverview) { Label txtOverview = (Label)commandItem.FindControl("txtOverview"); txtOverview.Text = strOverview; } else { TableRow rowOverview = (TableRow)commandItem.FindControl("rowOverview"); rowOverview.Visible = false; } if (showNotes) { Label txtNotes = (Label)commandItem.FindControl("txtNotes"); txtNotes.Text = strNotes; } else { TableRow rowNotes = (TableRow)commandItem.FindControl("rowNotes"); rowNotes.Visible = false; } if (showSchematic) { Label txtSchematic = (Label)commandItem.FindControl("txtSchematic"); HyperLink lnkSchematic = (HyperLink)commandItem.FindControl("lnkSchematic"); if (lnkSchematicFilename.Length == 0) lnkSchematic.Visible = false; else { lnkSchematic.NavigateUrl = lnkSchematicFilename; txtSchematic.Visible = false; } } else { TableRow rowSchematic = (TableRow)commandItem.FindControl("rowSchematic"); rowSchematic.Visible = false; } } else e.Item.Visible = false; } //if it's a criteria then hide the expand control if (e.Item is GridDataItem)// to access a row { GridDataItem item = (GridDataItem)e.Item; RadGrid parentGrid = (RadGrid)sender; if ((bool)item.GetDataKeyValue("IsCriteria") == true) { item.Cells[0].Controls[0].Visible = false; } } }