HtmlViewDefinition

4 posts, 1 answers
  1. Marco
    Marco avatar
    87 posts
    Member since:
    Apr 2011

    Posted 11 Feb 2013 Link to this post

    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.
  2. Answer
    Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 14 Feb 2013 Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Marco
    Marco avatar
    87 posts
    Member since:
    Apr 2011

    Posted 14 Feb 2013 Link to this post

    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 :-)
  5. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 14 Feb 2013 Link to this post

    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.
Back to Top