Radgrid Filter popup width

7 posts, 0 answers
  1. Razeen
    Razeen avatar
    10 posts
    Member since:
    Apr 2009

    Posted 04 Aug 2012 Link to this post

    Hi,

    Is there any way to best fit the Radgrids filter popup width? Now when i click filter button , filter popups with available values..If value is long i have to do horizontal scrolling to read the value.I dont want to that..

    Thanks
  2. Stefan
    Admin
    Stefan avatar
    2890 posts

    Posted 09 Aug 2012 Link to this post

    Hello Razeen,

    Thank you for writing.

    You can set the size of the filter popup to whatever you need in the FilterPopupInitialized event:
    void radGridView1_FilterPopupInitialized(object sender, FilterPopupInitializedEventArgs e)
    {
        ((BaseFilterPopup)e.FilterPopup).MinimumSize = new System.Drawing.Size(400, 400);
    }

    I hope that you find this information useful.
     
    Regards,
    Stefan
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Steve
    Steve avatar
    6 posts
    Member since:
    Jul 2015

    Posted 21 Jun in reply to Stefan Link to this post

    Hi, I know this is an old post, but I am trying to accomplish the same in my GridView w/o success.  Mine is a vb.net winforms app.

    I tried both the FilterPopupInitialized event:

    Private Sub RadGridView1_FilterPopupInitialized(sender As Object, e As FilterPopupInitializedEventArgs) Handles RadGridView1.FilterPopupInitialized

            DirectCast(e.FilterPopup, BaseFilterPopup).MinimumSize = New System.Drawing.Size(400, 400)
        End Sub

     

    And the FilterPopupRequired event:

      Private Sub RadGridView1_FilterPopupRequired(sender As Object, e As FilterPopupRequiredEventArgs) Handles RadGridView1.FilterPopupRequired
            MessageBox.Show("Hello World")
        End Sub

     

    Neither event fires, I added breakpoints and never hit them.

    I'm probably missing something simple, I would be grateful for any help.

     

    Thanks,

    -Steve

  5. Hristo
    Admin
    Hristo avatar
    716 posts

    Posted 22 Jun Link to this post

    Hello Steve,

    Thank you for writing.

    On my end, the event fires successfully. The question my colleague answered refers to the filter popup when excel-like filtering is enabled.

    In case you refer to the context menu of the grid filter cells, you would need to handle the ContextMenuOpening event. I am sending you attached my test project.

    I hope this helps. Should you have further questions please do not hesitate to write back.

    Regards,
    Hristo Merdjanov
    Telerik
    Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms. For more information check out this blog post and share your thoughts.
  6. Steve
    Steve avatar
    6 posts
    Member since:
    Jul 2015

    Posted 22 Jun in reply to Hristo Link to this post

    Hristo,

    Thanks for sending the example.  It appears that we are not trying to accomplish the same thing.

     

    I've included a picture of my RadGrid.  You will note that the column width for column "Home Dept" is proper to display the data.  However, when the user clicks the dropdown list to select valid Home Departments for filtering he cannot read the options as the dropdown is too narrow.

    I could solve this by changing the width of the column so that it is wide enough to display the dropdown, but of course that results in much wasted space on the grid.

    Is there any way to allow the dropdown selections to be wide while retaining the current column width ?

    Thanks,

    -Steve

  7. Hristo
    Admin
    Hristo avatar
    716 posts

    Posted 22 Jun Link to this post

    Hi Steve,

    Thank you for writing back.

    The screenshot indicates that you are using a GridViewComboBoxColumn . If that is really the case you would need to handle the CellEditorInitialized event and resize the popup. Please check my code snippet below: 
    private void radGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)
    {
        if (e.Column is GridViewComboBoxColumn)
        {
            RadDropDownListEditor editor = (RadDropDownListEditor)this.radGridView1.ActiveEditor;
            RadDropDownListEditorElement editorElement = (RadDropDownListEditorElement)editor.EditorElement;
     
            editorElement.Popup.MinimumSize = new System.Drawing.Size(200, 0);
        }
    }

    I am also sending you a gif file showing the result on my end.

    I hope this helps. Should you have further questions please do not hesitate to write back.

    Regards,
    Hristo Merdjanov
    Telerik
    Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
  8. Steve
    Steve avatar
    6 posts
    Member since:
    Jul 2015

    Posted 22 Jun in reply to Hristo Link to this post

    Perfect !!!

    That is exactly what I was looking for.  

    Thank you for your help,

    -Steve

Back to Top
UI for WinForms is Visual Studio 2017 Ready