Hi,
i am currently implementing a custom filter dropdown with radgridview, but i get confused with the following problem.
For simplification just imagine i have two columns, Status and Status2.
Status is just a representation of 0 or 1. Status2 is an image representing the status.
If i click the filter symbol inside of the TableFilteringRow my custom dropdown will be opened.
After choosing an option a handler fires and the filter is being applied to the column "Status".
That works as i would expect it.
But if i try that the second time, my custom dropdown shows up, i choose another option,
the handler fires but the filter symbol seems to be still pressed. And that is the reason why the data inside the gridview cannot be filtered because the filter action is not yet finished until i click into another column/row.
See also the attached image for better understanding what i mean.
Here is the code:
How can i fix that?
i am currently implementing a custom filter dropdown with radgridview, but i get confused with the following problem.
For simplification just imagine i have two columns, Status and Status2.
Status is just a representation of 0 or 1. Status2 is an image representing the status.
If i click the filter symbol inside of the TableFilteringRow my custom dropdown will be opened.
After choosing an option a handler fires and the filter is being applied to the column "Status".
That works as i would expect it.
But if i try that the second time, my custom dropdown shows up, i choose another option,
the handler fires but the filter symbol seems to be still pressed. And that is the reason why the data inside the gridview cannot be filtered because the filter action is not yet finished until i click into another column/row.
See also the attached image for better understanding what i mean.
Here is the code:
Private Sub grdViewPostleitregion_ContextMenuOpening(ByVal sender As System.Object, ByVal e As Telerik.WinControls.UI.ContextMenuOpeningEventArgs) Handles grdViewPostleitregion.ContextMenuOpening If (e.ContextMenuProvider Is Nothing) Then e.ContextMenu.Items.Clear() Dim dtMenu As New RadDropDownMenu Dim r As RadMenuItem Dim sepItm As RadMenuSeparatorItem 'No Filter r = New RadMenuItem r.Text = "No Filter" dtMenu.Items.Add(r) AddHandler r.Click, AddressOf PostRegionNoFilter_Click 'Separator sepItm = New RadMenuSeparatorItem e.ContextMenu.Items.Add(sepItm) 'Imagefilter r = New RadMenuItem r.Image = My.Resources.Status_0 r.Text = "OK" dtMenu.Items.Add(r) AddHandler r.Click, AddressOf PostRegionStatus0_Click r = New RadMenuItem r.Image = My.Resources.Status_1 r.Text = "Warning" dtMenu.Items.Add(r) AddHandler r.Click, AddressOf PostRegionStatus1_Click e.ContextMenu = dtMenu End If End Sub Private Sub NoFilter_Click(ByVal sender As Object, ByVal e As System.EventArgs) With Me.grdViewPostleitregion .Columns("Status").FilterDescriptor = Nothing .CurrentColumn = .Columns("Status") .CurrentRow = .MasterView.TableFilteringRow End With End Sub Private Sub Status0_Click(ByVal sender As Object, ByVal e As System.EventArgs) Dim Filter As New FilterDescriptor() Filter.Operator = FilterOperator.IsEqualTo Filter.Value = 0 Filter.IsFilterEditor = False With Me.grdViewPostleitregion .Columns("Status").FilterDescriptor = Nothing .Columns("Status").FilterDescriptor = Filter .CurrentColumn = .Columns("Status") .CurrentRow = .MasterView.TableFilteringRow .MasterView.TableFilteringRow.Cells(0).IsSelected = True End With End Sub Private Sub Status1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Dim Filter As New FilterDescriptor() Filter.Operator = FilterOperator.IsEqualTo Filter.Value = 1 Filter.IsFilterEditor = False With Me.grdViewPostleitregion .Columns("Status").FilterDescriptor = Filter .CurrentColumn = .Columns("Status") .CurrentRow = .MasterView.TableFilteringRow .MasterView.TableFilteringRow.Cells(0).IsSelected = True End With End SubHow can i fix that?