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
8 Answers, 1 is accepted
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
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
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
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
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
Perfect !!!
That is exactly what I was looking for.
Thank you for your help,
-Steve
Hello, Reddy,
If I understand you correctly, you would like to be able to resize the popup of a GridViewComboBoxColumn. To achieve this you can handle the CellEditorInitialized event and set the DropDownSizingMode of RadDropDownListEditor. The sizing mode offers an enumeration of several options.
private void RadGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)
{
if (e.Column is GridViewComboBoxColumn)
{
RadDropDownListEditor editor = (RadDropDownListEditor)this.radGridView1.ActiveEditor;
editor.DropDownSizingMode = SizingMode.UpDownAndRightBottom;
}
}
I hope this helps. Should you have any other questions do not hesitate to contact us.
Regards,
Nadya
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.
Hi,
Not the coboboxcolumn popup.
I need to resize the FilteringControl popup. While clicking any column filter Icon, popup is loaded right to filter the data.
That popup I need to resize. Please provide the suggestions.
Thanks,
Hello, Reddy,
It is not clear which filtering mechanism you use: basic filtering or Excel-like filtering. Can you please clarify this?
In Excel-like filtering the filtering menu items are displayed in a custom filter form which is resizable out-of-the-box. See the attached gif file. However, if you are using basic filtering it displays a simple RadDropDownMenu and it is not resizable.
I hope this information helps. Please let me know if I can assist you further.
Regards,
Nadya
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.