I have a Telerik RadGrid that is using a MasterTableView and a DetailTable. Within the DetailsTable there is a GridTableView which looks like this:
<pre><DetailTables> <telerik:GridTableView Name="AssignmentGrid" Width="100%" DataKeyNames="ComplaintID,AssignmentID" NoDetailRecordsText="No Assignments Have been Entered" CommandItemDisplay="None" EnableNoRecordsTemplate="true" HierarchyDefaultExpanded="false" AllowSorting="false"> <NoRecordsTemplate> <asp:Label ID="Label8" runat="server" CssClass="label" Text="No Work Assigments have been added." /> </NoRecordsTemplate> <CommandItemSettings ShowRefreshButton="False" /> <Columns> </Columns> <ParentTableRelation> <telerik:GridRelationFields DetailKeyField="ComplaintID" MasterKeyField="ComplaintID" /> </ParentTableRelation> </telerik:GridTableView> </DetailTables>
I want to format some of the data within the Details GridTableView but can't figure it out, or find any documentation for help. Within the MasterTableView I use this code to highlight data within the cells, and it works fine.
<pre>protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) { if (e.Item is GridDataItem && e.Item.OwnerID == "ctl00_MainContent_RadGrid1_ctl00") { //Get the instance of the right type GridDataItem dataBoundItem = e.Item as GridDataItem; if (dataBoundItem["IsPriority"].Text == "Y") { dataBoundItem["IsPriority"].ForeColor = Color.Red; dataBoundItem["IsPriority"].Font.Bold = true; dataBoundItem["IsPriority"].Text = "YES"; }
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) { if (e.Item is GridDataItem && e.Item.OwnerID == "ctl00_MainContent_RadGrid1_ctl00") { //Get the instance of the right type GridDataItem dataBoundItem = e.Item as GridDataItem; if (dataBoundItem["IsPriority"].Text == "Y") { dataBoundItem["IsPriority"].ForeColor = Color.Red; dataBoundItem["IsPriority"].Font.Bold = true; dataBoundItem["IsPriority"].Text = "YES"; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)