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

Combo Column Height

3 Answers 60 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Phillip
Top achievements
Rank 1
Phillip asked on 30 Apr 2009, 03:54 PM
Hi,
I have a grid showing an image, which makes the row about 100pix high. The grid has a combo column in it, and several other different types of column. On the standard text box column the grid positions the editor centrally on the row, and on the combo column it expands the combo to be 100pix tall.

1) Can I direct the table to place the editing controls for the column TopLeft instead of CentreLeft ?
2) Can I stop the combo column autosizing to fill the entire grid cell ?

I have tried 

e.CellElement.Alignment =

ContentAlignment.TopLeft;
on the ViewCellFormatting event but it doesn't make any difference.

 



3 Answers, 1 is accepted

Sort by
0
Accepted
Nick
Telerik team
answered on 01 May 2009, 09:54 AM
Hello Phillip,

Thank you for contacting us. Regarding your questions you need to use the EditorRequired event:

1. You can control the editor Margin in the cell. For instance:

private void radGridView1_EditorRequired(object sender, EditorRequiredEventArgs e) 
    if (e.Editor is RadTextBoxEditor)  
    { 
                ((RadTextBoxEditor)e.Editor).Margin = new Padding(0, 0, 0, this.radGridView1.CurrentCell.RowInfo.Height/2); 

2. You can set MaxSize for the given editor. For example:

private void radGridView1_EditorRequired(object sender, EditorRequiredEventArgs e) 
{      
    if (e.Editor is RadComboBoxEditor) 
    { 
                ((RadComboBoxEditor)e.Editor).MaxSize = new Size(100, 20);      
    } 

Thus you will prevent the combobox editor to expand to the cell height.

Do not hesitate to write me back if you have further questions.

All the best,
Nick
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Ankur
Top achievements
Rank 1
answered on 25 Jun 2009, 11:14 AM
hi

I have a table in which i have used style='table-layout: fixed'. further i specified each column width. i designed the code for add remove columns and thus when a column is removed, other columns are shifted to the width of preceding columns. 
Any suggestions please 
0
Nick
Telerik team
answered on 29 Jun 2009, 08:00 AM
Hi Ankur,

Thank you for contacting us. You wrote in our WinForms forums. Please ask your question in our ASP.NET Ajax forums as it seems that you are interested in our ASP.NET controls.

Best wishes,
Nick
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
GridView
Asked by
Phillip
Top achievements
Rank 1
Answers by
Nick
Telerik team
Ankur
Top achievements
Rank 1
Share this question
or