We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Custom Filter Action in GDBG

Hi, After filtering with custom option, on which row and column(or on which cell) the focus will be focussed. How to avoid the click events on the filter combo box. How to restrict the filter combo box to filtering only. As I seen, after filtering if I click the check box which is a immediate row of the filter, the filter custom filter is popping up every time I click the check box. How to avoid such a unwanted event. Thanks in advance, logicengineer.

7 Replies

AD Administrator Syncfusion Team June 13, 2004 05:30 PM UTC

>After filtering with custom option, on which row and column(or on which cell) the focus will be focussed. > The grid''s current cell is left on the filter combobox cell. The position of the currencymanager is left where it was. You can set these items yourself by handling the CurrentCellComfirmedChanges event.
private void gridDataBoundGrid1_CurrentCellAcceptedChanges(object sender, CancelEventArgs e)
{
	GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
	if(cc.RowIndex == 1)
	{
		cc.MoveTo(this.gridDataBoundGrid1.Model.Rows.FrozenCount + 1, cc.ColIndex);
		this.gridDataBoundGrid1.Binder.CurrentPosition = 0;
	}
}
>How to avoid the click events on the filter combo box. > You can set the cell''s style.Enabled = false. this.gridDataBoundGrid1[1,1].Enabled = false; this.gridDataBoundGrid1.CurrentCell.ResetCurrentCellWithoutDeactivate(); //in case 1,1 is the currentcell >How to restrict the filter combo box to filtering only. > I am not sure what you mean by this question. How can I see the behavior you want to avoid in the FilterBar sample we ship. >As I seen, after filtering if I click the check box which is a immediate row of the filter, the filter custom filter is popping up every time I click the check box. > >How to avoid such a unwanted event. > So, you have added a checkbox to a cell in the filterbar row? Are you handling GridFilterBarCreatingColumnHeader, and returning e.Cancel = true to tell the grid not to put a FilterBar cell on this column? If that does not solve the problem, can you post a sample showing the problem so we can look at it here.


UK Umesh Kumar June 16, 2004 10:56 AM UTC

Hi Clay Burch, It worked very well. Thanks alot for the code snippet. How to avoid the double click event(without losing the sorting property of the column) on the column headers for the columns defined in the grid. Thanks & Regards, logicengineer. >>After filtering with custom option, on which row and column(or on which cell) the focus will be focussed. >> >The grid''s current cell is left on the filter combobox cell. The position of the currencymanager is left where it was. You can set these items yourself by handling the CurrentCellComfirmedChanges event. >
>private void gridDataBoundGrid1_CurrentCellAcceptedChanges(object sender, CancelEventArgs e)
>{
>	GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
>	if(cc.RowIndex == 1)
>	{
>		cc.MoveTo(this.gridDataBoundGrid1.Model.Rows.FrozenCount + 1, cc.ColIndex);
>		this.gridDataBoundGrid1.Binder.CurrentPosition = 0;
>	}
>}
>
> >>How to avoid the click events on the filter combo box. >> > >You can set the cell''s style.Enabled = false. > >this.gridDataBoundGrid1[1,1].Enabled = false; >this.gridDataBoundGrid1.CurrentCell.ResetCurrentCellWithoutDeactivate(); //in case 1,1 is the currentcell > > >>How to restrict the filter combo box to filtering only. >> > >I am not sure what you mean by this question. How can I see the behavior you want to avoid in the FilterBar sample we ship. > > >>As I seen, after filtering if I click the check box which is a immediate row of the filter, the filter custom filter is popping up every time I click the check box. >> >>How to avoid such a unwanted event. >> >So, you have added a checkbox to a cell in the filterbar row? Are you handling GridFilterBarCreatingColumnHeader, and returning e.Cancel = true to tell the grid not to put a FilterBar cell on this column? > >If that does not solve the problem, can you post a sample showing the problem so we can look at it here.


AD Administrator Syncfusion Team June 16, 2004 11:15 AM UTC

I may not understand your question. In 2.0, CellDoubleClick is a canceable event by setting e.Cancel = true. Is this the event you want to avoid? If not, then you will have to derived the grid, and override OnDoubleClick and not call the baseclass if you want to avoid the grid''s DoubleClick event.


UK Umesh Kumar June 16, 2004 04:22 PM UTC

Hi, Let me give you a detailed scenerio: 1. If the user double clicks any of the GDBG row, then a new form pops up, to edit the contents of the present double clicked row. 2. If the user double clicks the column header then this new form should not pop-up and only sorting of the column should happen. 3. But in the present case if i tried to double click the header columns, this new form is poping up. 4. Here the double click is handled through cell double click event. 5. On double click event,it is observed that the row index showed as 2(which is read through a message box)instead of 0. I unable to understand the reason behind. 6. The problem is, double click on any of the header columns this new form should not pop-up, it should be restricted to the sorting action only. 7. what is override OnDoubleclick? Is it possible for you to explain the override OnDoubleClick with a sample code. 8. where one can get the details of all the events and methods associated with the GDBG and other syncfusion tools. pls. reply as soon as possible. Thanks & Regards, logicengineer >I may not understand your question. > >In 2.0, CellDoubleClick is a canceable event by setting e.Cancel = true. Is this the event you want to avoid? > >If not, then you will have to derived the grid, and override OnDoubleClick and not call the baseclass if you want to avoid the grid''s DoubleClick event.


AD Administrator Syncfusion Team June 16, 2004 04:35 PM UTC

You must have code in the CellDoubleClick event that pops up this form, right? So, you can check e.RowIndex <= this.grid.Model.Rows.HeaderCount to decide whether to display your form. Will this work for you?


UK Umesh Kumar June 18, 2004 05:42 PM UTC

Hi Clay Burch, Thanks for the response. This is not helping me to sort out the problem. Is there any way to implement. the requirement is whenever the user double clicks any of the column headers,the action should be restricted to sorting only even though some other actions are associated with the double click event. Thanks & Regards, logicengineer. >You must have code in the CellDoubleClick event that pops up this form, right? > >So, you can check e.RowIndex <= this.grid.Model.Rows.HeaderCount to decide whether to display your form. > >Will this work for you?


AD Administrator Syncfusion Team June 18, 2004 07:32 PM UTC

Can you attach a sample showing the problem? Normally, the only time you get a sort is if you double click a header (other than on a border). So, I am not sure why you cannot test the e.ColIndex of the CellDoubleClick event to cancel it when e.RowIndex is not a header. If you can provide a sample project showing what the problem is, then maybe we can suggest a solution.

Loader.
Live Chat Icon For mobile
Up arrow icon