This is a migrated thread and some comments may be shown as answers.

Row Selected Theme

3 Answers 128 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Adam
Top achievements
Rank 2
Adam asked on 05 Aug 2008, 11:22 AM
Is there a mechanism to change how a selected row appears?  When using a grid with the Office2007Black theme, setting IsSelected or IsCurrent doesn't highlight the row.  The selectionchange event fires properly, but I can see no visual cue which row is selected.

Thanks.

3 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 05 Aug 2008, 12:39 PM
Hello Adam,

Which theme do you mean? RadGridView doesn't have Office2007Black theme.

The color can be easy modified trough the theme. Load the theme into VSB and select GridDataRowElement via Element tree (see the attached screenshot)

Don't hesitate to contact us if you have other questions.


Kind regards,
Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Adam
Top achievements
Rank 2
answered on 05 Aug 2008, 01:26 PM
Sorry, I mean Vista Telerik (its a black/grey theme).  I'll have to wait until we have access to the theme xml files to try that out.

Is the MaxLength property of a column respected when binding from a data source?  I've tried setting the property in the property builder and also on the DataBindingComplete event.  The column can have large amount of text and I want to keep the rows limited to one line even if all of the text cannot fit.  Is there a different property that can do this?

Thanks for your quick response,
Adam
0
Peter
Telerik team
answered on 05 Aug 2008, 02:34 PM
Hello Adam,

You can select rows programmatically using the IsSelected property:
 
this.radGridView1.Rows[0].IsSelected = true;  
this.radGridView1.Rows[2].IsSelected = true;  
this.radGridView1.Rows[3].IsSelected = true

However, currently the above code snippet itself will not give you any visual representation for the selected rows automatically. Therefore, you should also call the Update method of the GridElement:
 
this.radGridView1.GridElement.Update(GridUINotifyAction.StateChanged); 

The MaxLength property is only for TextColumn and represents the Max Length of the field in edit mode (prevents user to input more then max length characters in text column field)

If you need additional assistance, feel free to contact me.


Best wishes,
Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
GridView
Asked by
Adam
Top achievements
Rank 2
Answers by
Peter
Telerik team
Adam
Top achievements
Rank 2
Share this question
or