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

GridTemplateColumn of RadGrid displays Button like plan text

1 Answer 54 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Nsi
Top achievements
Rank 1
Nsi asked on 18 Feb 2014, 10:12 PM
RadGrid displays Button like plan text. 
 <Columns>
 <telerik:GridBoundColumn HeaderText="On Calendar" DataField="IsOnCalendar" UniqueName="IsOnCalendar" CurrentFilterFunction="EqualTo" AutoPostBackOnFilter="true" />
                            <telerik:GridBoundColumn HeaderText="Status" DataField="Status" UniqueName="Status" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" Visible="false" FilterControlWidth="80px" />
 <telerik:GridTemplateColumn UniqueName="UpdateColumn" AllowFiltering="False">
   <ItemTemplate>
   <asp:Button ID="btnInactiveButton" ToolTip="Mark Inactive" runat="server" Text="Inactive" CommandName="Update" CommandArgument="0"            SkinID="defaultbutton" OnClientClick="return confirm('Are you sure you want to deactivate this?');" CausesValidation="false" />
<asp:Button ID="btnActivatebutton" ToolTip ="Mark Active" runat="server" Text="Activate" CommandName="Update" CommandArgument="1" SkinID="defaultbutton"
                                        OnClientClick="return confirm('Are you sure you want to activate this?');" CausesValidation="false" />
     </ItemTemplate>
 </telerik:GridTemplateColumn>
</Columns>

Buttons btnActivatebutton and btnInactiveButton show up like normal text. User will not know that they are buttons until they hover over them. I need fix for this.  Thnaks.



1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 19 Feb 2014, 11:19 AM
Hi,

Im not able to replicate such an issue at my end. I see that you have used SkinId for the buttons, make sure that the style is not affecting the look and feel of the Button. Please have a look at the below sample code snippet which works as expected.

ASPX:
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="false" AllowPaging="true" AllowFilteringByColumn="true" AllowMultiRowSelection="true" OnNeedDataSource="RadGrid1_NeedDataSource">
    <MasterTableView>
        <Columns>
            <telerik:GridBoundColumn HeaderText="ID" DataField="ID" UniqueName="ID" CurrentFilterFunction="EqualTo" AutoPostBackOnFilter="true" />
            <telerik:GridBoundColumn HeaderText="Name" DataField="Name" UniqueName="Name" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" />
            <telerik:GridTemplateColumn UniqueName="UpdateColumn" AllowFiltering="False">
                <ItemTemplate>
                    <asp:Button ID="btnInactive" runat="server" Text="Inactive" OnClientClick="return confirm('Inactive');" />
                    <asp:Button ID="btnActivate" runat="server" Text="Activate" OnClientClick="return confirm('Activate');" />
                </ItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

C#:
protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
    dynamic data = new[] {
new { ID = 1, Name = "Name1"},
new { ID = 2, Name = "Name2"},
new { ID = 3, Name = "Name3"},
new { ID = 4, Name = "Name4"},
new { ID = 5, Name = "Name5"},
new { ID = 6, Name = "Name6"},
new { ID = 7, Name = "Name7"},
new { ID = 8, Name = "Name8"},
new { ID = 9, Name = "Name9"}
};
    RadGrid1.DataSource = data;
}

Thanks,
Shinu
Tags
General Discussions
Asked by
Nsi
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or