5 Answers, 1 is accepted
0
Hello SKmatt,
You can achieve alternate row style programmatically or by setting an appropriate theme.
Should you prefer to do it by code, subscribe to the RowFormatting event and then in the event handler change the color of the row:
If you want to implement it in your theme, you should add the IsOdd state to the GridRowElement and adjust the other state tabs correspondingly.
If you need additional assistance, do not hesitate to contact me.
Best wishes,
Nikolay
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
You can achieve alternate row style programmatically or by setting an appropriate theme.
Should you prefer to do it by code, subscribe to the RowFormatting event and then in the event handler change the color of the row:
void radGridView1_RowFormatting(object sender, RowFormattingEventArgs e) |
{ |
if (e.RowElement.IsOdd) |
{ |
if (!e.RowElement.IsCurrent) |
{ |
e.RowElement.BackColor = Color.Beige; |
} |
else |
{ |
e.RowElement.BackColor = Color.LightBlue; |
} |
} |
} |
If you want to implement it in your theme, you should add the IsOdd state to the GridRowElement and adjust the other state tabs correspondingly.
If you need additional assistance, do not hesitate to contact me.
Best wishes,
Nikolay
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
SKmatt
Top achievements
Rank 1
answered on 18 Mar 2008, 10:02 AM
Thanks.
I prefer to use the style builder, but when i use the isOdd state my highlight on the cell make my state go to initial after.
What do i forgot to have a non initial return state after my mouse was over the row.
have a good day.
I prefer to use the style builder, but when i use the isOdd state my highlight on the cell make my state go to initial after.
What do i forgot to have a non initial return state after my mouse was over the row.
have a good day.
0
Hi SKmatt,
As I have mentioned, you need to adjust the rest of the state tabs of the GridRowElement, so to define the logic by which the states will turn into each other. Below are listed the sample steps for producing the right set of tabs, which will avoid returning to InitialState after MouseOver:
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
As I have mentioned, you need to adjust the rest of the state tabs of the GridRowElement, so to define the logic by which the states will turn into each other. Below are listed the sample steps for producing the right set of tabs, which will avoid returning to InitialState after MouseOver:
- Select GridRowElement in the Control Structure tree.
- Add a new state tab. Assing IsOdd and (!IsCurrent or !IsSelected) state. Uncheck Auto un-apply checkbox.
- Edit the IsMouseOver state tab by checking the Auto un-apply checkbox and unchecking the Animate checkbox.
- Delete IsMouseOver and (!IsSelected and !IsCurrent) tab.
- Set appropriate colors to the different tabs so to achieve the effect you are looking for.
Please notice that the above steps were applied to a pre-built theme. I have attached the result theme for your reference,
If you need additional assistance, do not hesitate to contact me.
Sincerely yours,
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
SKmatt
Top achievements
Rank 1
answered on 21 Mar 2008, 10:24 AM
Thank's, it work fine.
You make great job and I support you on aspnetpro.com :o)
You make great job and I support you on aspnetpro.com :o)
0
Hello SKmatt,
I am glad to hear that your issue has been resolved. If you need additional assistance, do not hesitate to contact us.
Greetings,
Nikolay
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
I am glad to hear that your issue has been resolved. If you need additional assistance, do not hesitate to contact us.
Greetings,
Nikolay
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center