3 Answers, 1 is accepted
0
Hello Glenn,
The only way to do this would be to manually override the CssClass property of the edited items as they are created. In the ItemDataBound event you can get a reference to your item and based on its ItemIndex being even or odd, you can set its CssClass property to one of the two css classes - for regular and alternating items.
Please see if this works for you.
Regards,
Veli
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
The only way to do this would be to manually override the CssClass property of the edited items as they are created. In the ItemDataBound event you can get a reference to your item and based on its ItemIndex being even or odd, you can set its CssClass property to one of the two css classes - for regular and alternating items.
Please see if this works for you.
Regards,
Veli
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
glenn
Top achievements
Rank 1
answered on 18 Jul 2008, 02:16 PM
Yes this is working. I still have one problem. How can i change the color of the textboxes(from the edit mode) to the color of the row?
Can i get a reference to them in the ItemDataBound event?
thx in advance,
Glenn
Can i get a reference to them in the ItemDataBound event?
thx in advance,
Glenn
0
Princy
Top achievements
Rank 2
answered on 21 Jul 2008, 05:22 AM
Hi Glenn,
Try out the following code snippet and see if it helps.
CS:
Thanks
Princy.
Try out the following code snippet and see if it helps.
CS:
int counter = 0; |
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) |
{ |
if (e.Item is GridEditableItem && e.Item.IsInEditMode) |
{ |
GridEditableItem edititem = (GridEditableItem)e.Item; |
TextBox txtbx = (TextBox)edititem["columnUniqueName"].Controls[0]; |
if (counter % 2 == 0) //even row |
{ |
txtbx.BorderColor = System.Drawing.Color.Red; |
} |
else //odd row |
{ |
txtbx.BorderColor = System.Drawing.Color.Blue; |
} |
counter++; |
} |
} |
Thanks
Princy.