Hi All,
I have a gridview. I have one linkbutton in the gridView and others are gridTemplatecolumns. I want to make the whole row bold whenever the user clicks on the link button
2344 abc def ghi nes
so for e.g.
whenever user clicks on 2344, I want to make 2344 abc gth rwe nes bold or of different color. Is it possible to do that.
so far my code is like below
<telerik:RadGrid ID="RadGrid_Picker" AllowSorting="True" PageSize="100" AllowPaging="True" AllowMultiRowSelection="True" runat="server" GridLines="None" OnPageIndexChanged="RadGrid_Picker_PageIndexChanged" OnPageSizeChanged="RadGrid_Picker_PageSizeChanged" Width="1500px" Visible="false" OnItemCommand="RadGrid_Picker_ItemCommand" OnItemDataBound="RadGrid_Picker_ItemDataBound" > <ClientSettings EnableRowHoverStyle="true"><Selecting AllowRowSelect="true" /></ClientSettings> <MasterTableView Width="100%" Summary="RadGrid table" DataKeyNames="ID" /> <MasterTableView RetrieveAllDataFields="true" AutoGenerateColumns="false" > <Columns> <telerik:GridBoundColumn DataField="ID" Visible="false"></telerik:GridBoundColumn> <telerik:GridTemplateColumn UniqueName="TemplateLinkColumn" AllowFiltering="false" HeaderText="ID"> <ItemTemplate> <asp:LinkButton ID="ID_Link" runat="server" OnClick="ID_Link_Click" Text='<%#Bind("ID") %>' CommandName="Bold"></asp:LinkButton> </ItemTemplate> </telerik:GridTemplateColumn> </Columns> </MasterTableView> <PagerStyle Mode="NextPrevAndNumeric" /> </telerik:RadGrid> and in the code behind protected void RadGrid_Picker_ItemCommand(object sender, GridCommandEventArgs e) { if (e.CommandName == "Bold") { GridDataItem item = (GridDataItem)e.Item; string value = item.GetDataKeyValue("ID").ToString(); e.Item.Style.Add(HtmlTextWriterStyle.FontWeight, "Bold"); } }
Thanks.