Rad:Grid Change Row BackGround Color (RadGrid)
2009-07-16 13:06
375 查看
Change the back color of the expanded row and the collapsed rows.
protected void RadGrid1_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
{
//Expand a row , update the backcolor of the expanded row and other rows.
if (e.CommandName == RadGrid.ExpandCollapseCommandName && e.Item.Expanded == false)
{
foreach (GridDataItem item2 in RadGrid1.MasterTableView.Items)
{
if (item2 == (GridDataItem)e.Item)
{
item2.BackColor = System.Drawing.Color.White;
}
else
{
item2.BackColor = System.Drawing.Color.Gainsboro;
}
}
}
//Collaps a row , update the backcolor of all rows.
if (e.CommandName == RadGrid.ExpandCollapseCommandName && e.Item.Expanded == true)
{
foreach (GridDataItem item2 in RadGrid1.MasterTableView.Items)
{
item2.BackColor = System.Drawing.Color.White;
}
}
}
http://www.telerik.com/community/forums/aspnet-ajax/grid/rad-grid-change-row-background-color.aspx
http://www.telerik.com/community/forums/aspnet/grid/set-background-color-of-a-row-in-client-script.aspx
http://www.telerik.com/community/forums/aspnet-ajax/grid/grid-row-background-colour-confliction.aspx
http://www.telerik.com/help/aspnet-ajax/grdaccessingcellsandrows.html
protected void RadGrid1_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
{
//Expand a row , update the backcolor of the expanded row and other rows.
if (e.CommandName == RadGrid.ExpandCollapseCommandName && e.Item.Expanded == false)
{
foreach (GridDataItem item2 in RadGrid1.MasterTableView.Items)
{
if (item2 == (GridDataItem)e.Item)
{
item2.BackColor = System.Drawing.Color.White;
}
else
{
item2.BackColor = System.Drawing.Color.Gainsboro;
}
}
}
//Collaps a row , update the backcolor of all rows.
if (e.CommandName == RadGrid.ExpandCollapseCommandName && e.Item.Expanded == true)
{
foreach (GridDataItem item2 in RadGrid1.MasterTableView.Items)
{
item2.BackColor = System.Drawing.Color.White;
}
}
}
http://www.telerik.com/community/forums/aspnet-ajax/grid/rad-grid-change-row-background-color.aspx
http://www.telerik.com/community/forums/aspnet/grid/set-background-color-of-a-row-in-client-script.aspx
http://www.telerik.com/community/forums/aspnet-ajax/grid/grid-row-background-colour-confliction.aspx
http://www.telerik.com/help/aspnet-ajax/grdaccessingcellsandrows.html
相关文章推荐
- How To Change the Background Color of a Tab Control
- Android change background color smoothly
- 如何在Dev GridControl中添加颜色可变的ProgressBar(GridControl ProgressBar Change Color)
- how to change the background color of actionbar
- Get Selected Row Values From Kendo Grid On Change Event
- How to change background color of gedit embedded terminal
- How to change the background color of an Edit Box
- Change Rows Background color in GridView with selected Criteria
- Change background color of a UIAlertView
- Change GridView RowColor OnMouseClick
- RadGrid Expand/Collapse on Row click
- How to change the background color of form using C++ - 如何用C++改变窗体的颜色
- change background color in chrome
- QTabWiget Change Color 改变颜色(每个QWidget都有一个自己的调色板palette,设置它的颜色,然后setAutoFillBackground即可)
- (Sharepoint 2010) Change the background and font color of text for a web part header
- Change the xterm background color for ICEWM
- change textblock background color when text equal to referenceValue
- Change the background color of the header of a List Control
- How to change tooltip background color in Unity?
- qt 之 How to Change the Background Color of QWidget