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

HtmlViewDefinition

3 Answers 210 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Marco
Top achievements
Rank 2
Veteran
Marco asked on 11 Feb 2013, 10:49 AM
Hello,

I have just started to look into the HTML View for the radgridview and I have some questions (Issues ?) about it:

First of all, I manage to create a view, playing with colspan and rowspan, linking to the columns and data (Big thanks for your documentation !). You can see the first result on BaseHtmlView.jpg

But I have some problem with (auto)sizing my RowHTMLTable !

I would like to autosize my columns to take the entire place on my gridview. But I also want to limit the max size of my first columns (the one with a picture). So I have set AutosizeColumnsMode to Fill, change the maxsize on the column (I haven't find something in the viewdefinition about it). You can see the result on AutoSizeHtmlView.jpg. Not so bad... The maxsize on the first column do nothing (I wasn't expecting too much about it), have to find another way. 

Then I tried to change my windows size to fullscreen. Outch... My grid is going outerspace ! See AutoSizeFullScreenHtmlView.jpg. 

As a bonus you can also try to set autosizeRows = True. It's not looking good !

So how could I configure my HTML view definition to have something like FinalAutoSizeHtmlView.Jpg (It works fine with mouse resizing on runtime).

On a html table, you can set the width and height with absolute value ("width=100px") or relative value ("width= 75%") and you can mix relative and absolute values ! Don't you think it will be a beautiful feature for Radgridview ?

Thanks for reading.

3 Answers, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 14 Feb 2013, 10:12 AM
Hi Marco,

Thank you for writing.

The AutoSizeColumnsMode = Fill is currently not supported by RadGridView. There is a feature request for such in our
Public Issue Tracking System. Feel free to add your vote for it here: http://www.telerik.com/support/pits.aspx#/details/Issue=9083

To achieve the desired layout, you have to set the column's width manually, once upon load and then in the grid's SizeChanged event:
void radGridView1_SizeChanged(object sender, EventArgs e)
{
    SetColumnsSizes();
}
 
private void SetColumnsSizes()
{
    radGridView1.Columns["Image"].Width = radGridView1.Width * 20 / 100;
    radGridView1.Columns["Nom"].Width = radGridView1.Width * 40 / 100;
    radGridView1.Columns["Adresse"].Width = radGridView1.Width * 40 / 100;
}

As to the AutoSizeRows, it is not supported as well. I am adding a new feature request in PITS: http://www.telerik.com/support/pits.aspx#/public/winforms/14281.

I have updated your Telerik Points for this request.

I hope that you find this information useful. Should you have any other questions or suggestions, do not hesitate to contact us.

Kind regards,
Stefan
the Telerik team
Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
0
Marco
Top achievements
Rank 2
Veteran
answered on 14 Feb 2013, 01:46 PM
Hello Stefan,

Ok, The AutoSizeColumnsMode isn't supported and I have to do the resize job myself (by the way thanks you for the exemple).

I'm going to vote for it right now :-)
0
Stefan
Telerik team
answered on 14 Feb 2013, 02:03 PM
I am glad I could help Marco. Let us know if you need anything else.
 
Greetings,
Stefan
the Telerik team
Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
Tags
GridView
Asked by
Marco
Top achievements
Rank 2
Veteran
Answers by
Stefan
Telerik team
Marco
Top achievements
Rank 2
Veteran
Share this question
or