This is a migrated thread and some comments may be shown as answers.

DetailTable CommandItem style being ignored

4 Answers 68 Views
Grid
This is a migrated thread and some comments may be shown as answers.
matt
Top achievements
Rank 1
matt asked on 28 Aug 2008, 07:43 PM
my RadGrid has this child DetailTable:

<DetailTables>           
    <Telerik:GridTableView  
        Width="100%" 
        Name="offenderCharges"  
        DataKeyNames="OffenderChargeID"  
        AutoGenerateColumns="false"  
        EditMode="EditForms"  
        Caption="&nbsp;"  
        CommandItemDisplay="Top"  
        CommandItemStyle-Font-Bold="true"  
        NoDetailRecordsText="No Charges"  
        CssClass="setMargin"
         
        <ParentTableRelation> 
            <Telerik:GridRelationFields MasterKeyField="OffenderID" DetailKeyField="OffenderID"/> 
        </ParentTableRelation> 
         
        <CommandItemSettings AddNewRecordText="Add new Charge" RefreshText="" RefreshImageUrl="~/1.gif" /> 
                             
        <Columns> 
            <Telerik:GridEditCommandColumn ButtonType="LinkButton" UniqueName="editColumn" ItemStyle-ForeColor="#333333" ItemStyle-Font-Bold="True" /> 
            <Telerik:GridButtonColumn CommandName="Delete" ButtonType="LinkButton" Text="Delete" UniqueName="deleteColumn" ConfirmText="Delete charge?" ConfirmTitle="Delete" ItemStyle-ForeColor="#333333" ItemStyle-Font-Bold="True" /> 
            <Telerik:GridBoundColumn HeaderText="OffenderChargeID" UniqueName="OffenderChargeID" DataField="OffenderChargeID" Visible="False" ReadOnly="true"/> 
            <Telerik:GridBoundColumn HeaderText="OffenderID" UniqueName="OffenderID" DataField="OffenderID" ReadOnly="true" Visible="false"/> 
            <Telerik:GridDropDownColumn HeaderText="Charge" UniqueName="Charge" DataField="ChargeID" DropDownControlType="RadComboBox"/> 
            <Telerik:GridDropDownColumn HeaderText="Victim #" UniqueName="VictimNumber" DataField="VictimNumber" DropDownControlType="RadComboBox"/> 
            <Telerik:GridDropDownColumn HeaderText="Relationship" UniqueName="Relationsip" DataField="OffenderVictimRelationshipTypeID" DropDownControlType="RadComboBox"/> 
        </Columns> 
    </Telerik:GridTableView>                 
</DetailTables> 

...problem is, the attribute CommandItemStyle-Font-Bold="true" doesnt work. none of the CommandItemStyles seem to work (font bold, italic, background color, etc).

they work in my MasterTableView, but not in the DetailView.

im using the office2007 skin.

any idea whats up?


thanks,
matt
sd

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 29 Aug 2008, 07:02 AM
Hi Matt,

One suggestion would be to set the CommandItemStyle in the main grid tag. Try it out as shown below and see if it is working.

ASPX:
<telerik:RadGrid ID="RadGrid1" runat="server"  DataSourceID="SqlDataSource1"  
  Skin="Office2007"     CommandItemStyle-Font-Bold="true" CommandItemStyle-Font-Italic="true"   > 
   <MasterTableView DataSourceID="SqlDataSource1"  CommandItemDisplay="Top"    > 
              



Thanks
Shinu.
0
matt
Top achievements
Rank 1
answered on 29 Aug 2008, 02:52 PM
shinu,

if i am trying to set this to a child DetailTable, why would i set it in the main grid?

also, this doesnt address why it isnt working in the DetailTable. bug, telerik??


matt

0
Accepted
Pavel
Telerik team
answered on 01 Sep 2008, 02:06 PM
Hi matt,

It seems this is indeed a bug that prevents the property to work as expected when set from the markup. You can work around it by using the ItemCreated event handler of the Grid like this:
protected void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e) 
    { 
        if ((e.Item is GridCommandItem)) 
        { 
            GridCommandItem commandItem = e.Item as GridCommandItem; 
            if (((Telerik.Web.UI.GridItem)(commandItem)).OwnerTableView.Name == "TableName"
            { 
                commandItem.Font.Bold = true
            } 
        } 
    } 

Hope this helps.

Regards,
Pavel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
matt
Top achievements
Rank 1
answered on 01 Sep 2008, 04:13 PM
thanks pavel.
Tags
Grid
Asked by
matt
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
matt
Top achievements
Rank 1
Pavel
Telerik team
Share this question
or