Hi,
In it's simplest form I have a RadGrid containing a Milestone indicator column, a Title and a Value.
If the particular row is a Milestone, then this should not have an associated value.
I am unsure how to get a reference to whether the current row is a 'Milestone' row and, if so, simply hide the label that is generated for the 'External Costs' column.
My grid is structured as follows (simplified): -
Many thanks,
Mike.
In it's simplest form I have a RadGrid containing a Milestone indicator column, a Title and a Value.
If the particular row is a Milestone, then this should not have an associated value.
I am unsure how to get a reference to whether the current row is a 'Milestone' row and, if so, simply hide the label that is generated for the 'External Costs' column.
My grid is structured as follows (simplified): -
<
telerik:RadGrid
ID
=
"costingGrid"
runat
=
"server"
RenderMode
=
"Auto"
OnNeedDataSource
=
"costingGrid_NeedDataSource"
AllowAutomaticUpdates
=
"true"
ClientSettings-AllowKeyboardNavigation
=
"true"
>
<
ClientSettings
>
<
Selecting
AllowRowSelect
=
"true"
/>
<
ClientEvents
OnRowCreated
=
"gridRowCreated"
/>
<
Scrolling
AllowScroll
=
"true"
UseStaticHeaders
=
"true"
/>
</
ClientSettings
>
<
MasterTableView
AutoGenerateColumns
=
"false"
DataKeyNames
=
"ID"
Width
=
"100%"
EditMode
=
"Batch"
CommandItemDisplay
=
"Top"
ShowFooter
=
"true"
>
<
BatchEditingSettings
EditType
=
"Cell"
OpenEditingEvent
=
"Click"
/>
<
Columns
>
<
telerik:GridBoundColumn
UniqueName
=
"ID"
DataField
=
"ID"
Visible
=
"false"
/>
<
telerik:GridBoundColumn
UniqueName
=
"IsMilestone"
DataField
=
"IsMilestone"
Display
=
"false"
/>
<
telerik:GridTemplateColumn
UniqueName
=
"Title"
DataField
=
"Title"
HeaderText
=
"Title"
HeaderStyle-Width
=
"400px"
>
<
ItemTemplate
>
<
asp:Label
ID
=
"titleLabel"
runat
=
"server"
Width
=
"100%"
Text='<%#Bind("Title") %>' />
</
ItemTemplate
>
<
EditItemTemplate
>
<
telerik:RadTextBox
ID
=
"titleInput"
runat
=
"server"
Width
=
"100%"
TextMode
=
"MultiLine"
/>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"ExternalCosts"
DataField
=
"ExternalCosts"
HeaderText
=
"3rd Party Costs"
HeaderStyle-Width
=
"80px"
DataFormatString
=
"{0:N2}"
HeaderStyle-HorizontalAlign
=
"Right"
ItemStyle-HorizontalAlign
=
"Right"
Aggregate
=
"Sum"
FooterAggregateFormatString
=
"£{0:F2}"
/>
</
MasterTableView
>
</
telerik:RadGrid
>
<
telerik:RadScriptBlock
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function gridRowCreated(sender, args) {
}
</
script
>
</
telerik:RadScriptBlock
>
protected
void
costingGrid_NeedDataSource(
object
sender, GridNeedDataSourceEventArgs e)
{
costingGrid.DataSource = CurrentCosting.Lines.OrderBy(l => l.LineNumber).ToList();
}
Many thanks,
Mike.