4 Answers, 1 is accepted
0
Shinu
Top achievements
Rank 2
answered on 20 Feb 2013, 11:15 AM
Hi,
Can you please elaborate which Attribute you want to set for the boundColumn. Please take look into the following code snippet to set BackGroundColor for Boundcolumn.
C#:
Thanks,
Shinu.
Can you please elaborate which Attribute you want to set for the boundColumn. Please take look into the following code snippet to set BackGroundColor for Boundcolumn.
C#:
boundColumn1.ItemStyle.BackColor = Color.Red;
OR
void
grid_ItemDataBound(
object
sender, GridItemEventArgs e)
{
if
(e.Item
is
GridDataItem)
{
GridDataItem item = (GridDataItem)e.Item;
item[
"UniqueName"
].Attributes.Add(
"style"
,
"background-color:Blue"
);
//OR
item[
"UniqueName"
].BackColor = Color.Red;
}
}
Thanks,
Shinu.
0
Marijn
Top achievements
Rank 1
answered on 22 Feb 2013, 07:27 AM
Hello Shinu,
Thnx, that helped me a lot.
Kind regards,
Marijn Ophelders
Thnx, that helped me a lot.
Kind regards,
Marijn Ophelders
0
Vasssek
Top achievements
Rank 1
answered on 29 Aug 2016, 04:03 PM
Hello,
is it possible to add custom attribute to GridBoundColumn declaratively (from .ASPX) ?
Thank you
Vasssek
0
Hello Vasssek,
I'm afraid this is not supported. If you want to pass a field value to the client, you can use the ClientDataKeyNames collection:
http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/rows/accessing-cells-and-rows#accessing-cells-and-values-in-client-side-code
Regards,
Eyup
Telerik by Progress
I'm afraid this is not supported. If you want to pass a field value to the client, you can use the ClientDataKeyNames collection:
http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/rows/accessing-cells-and-rows#accessing-cells-and-values-in-client-side-code
Regards,
Eyup
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.