I want to change the expand and collapse arrows from black to red only on certain rows that meat a specific criteria. What's the best way to go about doing this?
One suggestion is to use ImageButton inside Itemtemplate of GridTemplateColumn with CommandName as 'ExpandCollapse' instead of using default ExpandCollapseColumn. Then hide the default ExpandCollapseColumn which is demonstrated in this forum link.
In ItemDataBound event, set the ImageUrl of ImageButton based on the condition to simulate ExpandCollapse column.
I have implemented a similar scenario. I wanted to disable the expand/collapse button for certain records. Below is the code -
public void radGrid_ItemDataBound(object sender, GridItemEventArgs e) { if (e.Item is GridDataItem) { //The condition when I wanted the expand/collapse button to be disabled if(<condition>) { //disable the expand/collapse button (e.Item as GridDataItem)["ExpandColumn"].Enabled = false; } } }
Tough this is an old post, I am replying, hoping this would help someone.