@@ -115,16 +115,16 @@ public MenuStrip(Type dataType)
115115 //initialize components
116116 InitializeComponent ( ) ;
117117
118+ //set type
119+ SetDataType ( dataType ) ;
120+
118121 //set component translations
119122 cancelSortMenuItem . Text = AdvancedDataGridView . Translations [ AdvancedDataGridView . TranslationKey . ADGVClearSort . ToString ( ) ] ;
120123 cancelFilterMenuItem . Text = AdvancedDataGridView . Translations [ AdvancedDataGridView . TranslationKey . ADGVClearFilter . ToString ( ) ] ;
121124 customFilterMenuItem . Text = AdvancedDataGridView . Translations [ AdvancedDataGridView . TranslationKey . ADGVAddCustomFilter . ToString ( ) ] ;
122125 button_filter . Text = AdvancedDataGridView . Translations [ AdvancedDataGridView . TranslationKey . ADGVButtonFilter . ToString ( ) ] ;
123126 button_undofilter . Text = AdvancedDataGridView . Translations [ AdvancedDataGridView . TranslationKey . ADGVButtonUndofilter . ToString ( ) ] ;
124127
125- //set type
126- SetDataType ( dataType ) ;
127-
128128 //set default NOT IN logic
129129 IsFilterNOTINLogicEnabled = false ;
130130
@@ -162,56 +162,6 @@ public MenuStrip(Type dataType)
162162 _textFilterTextChangedTimer . Tick += new EventHandler ( this . CheckTextFilterTextChangedTimer_Tick ) ;
163163 }
164164
165- internal void SetDataType ( Type dataType )
166- {
167- DataType = dataType ;
168-
169- //set components values
170- if ( DataType == typeof ( DateTime ) || DataType == typeof ( TimeSpan ) )
171- {
172- customFilterLastFiltersListMenuItem . Text = AdvancedDataGridView . Translations [ AdvancedDataGridView . TranslationKey . ADGVCustomFilter . ToString ( ) ] ;
173- sortASCMenuItem . Text = AdvancedDataGridView . Translations [ AdvancedDataGridView . TranslationKey . ADGVSortDateTimeASC . ToString ( ) ] ;
174- sortDESCMenuItem . Text = AdvancedDataGridView . Translations [ AdvancedDataGridView . TranslationKey . ADGVSortDateTimeDESC . ToString ( ) ] ;
175- sortASCMenuItem . Image = Properties . Resources . MenuStrip_OrderASCnum ;
176- sortDESCMenuItem . Image = Properties . Resources . MenuStrip_OrderDESCnum ;
177- }
178- else if ( DataType == typeof ( bool ) )
179- {
180- customFilterLastFiltersListMenuItem . Text = AdvancedDataGridView . Translations [ AdvancedDataGridView . TranslationKey . ADGVCustomFilter . ToString ( ) ] ;
181- sortASCMenuItem . Text = AdvancedDataGridView . Translations [ AdvancedDataGridView . TranslationKey . ADGVSortBoolASC . ToString ( ) ] ;
182- sortDESCMenuItem . Text = AdvancedDataGridView . Translations [ AdvancedDataGridView . TranslationKey . ADGVSortBoolDESC . ToString ( ) ] ;
183- sortASCMenuItem . Image = Properties . Resources . MenuStrip_OrderASCbool ;
184- sortDESCMenuItem . Image = Properties . Resources . MenuStrip_OrderDESCbool ;
185- }
186- else if ( DataType == typeof ( Int32 ) || DataType == typeof ( Int64 ) || DataType == typeof ( Int16 ) ||
187- DataType == typeof ( UInt32 ) || DataType == typeof ( UInt64 ) || DataType == typeof ( UInt16 ) ||
188- DataType == typeof ( Byte ) || DataType == typeof ( SByte ) || DataType == typeof ( Decimal ) ||
189- DataType == typeof ( Single ) || DataType == typeof ( Double ) )
190- {
191- customFilterLastFiltersListMenuItem . Text = AdvancedDataGridView . Translations [ AdvancedDataGridView . TranslationKey . ADGVCustomFilter . ToString ( ) ] ;
192- sortASCMenuItem . Text = AdvancedDataGridView . Translations [ AdvancedDataGridView . TranslationKey . ADGVSortNumASC . ToString ( ) ] ;
193- sortDESCMenuItem . Text = AdvancedDataGridView . Translations [ AdvancedDataGridView . TranslationKey . ADGVSortNumDESC . ToString ( ) ] ;
194- sortASCMenuItem . Image = Properties . Resources . MenuStrip_OrderASCnum ;
195- sortDESCMenuItem . Image = Properties . Resources . MenuStrip_OrderDESCnum ;
196- }
197- else
198- {
199- customFilterLastFiltersListMenuItem . Text = AdvancedDataGridView . Translations [ AdvancedDataGridView . TranslationKey . ADGVCustomFilter . ToString ( ) ] ;
200- sortASCMenuItem . Text = AdvancedDataGridView . Translations [ AdvancedDataGridView . TranslationKey . ADGVSortTextASC . ToString ( ) ] ;
201- sortDESCMenuItem . Text = AdvancedDataGridView . Translations [ AdvancedDataGridView . TranslationKey . ADGVSortTextDESC . ToString ( ) ] ;
202- sortASCMenuItem . Image = Properties . Resources . MenuStrip_OrderASCtxt ;
203- sortDESCMenuItem . Image = Properties . Resources . MenuStrip_OrderDESCtxt ;
204- }
205-
206- //set check filter textbox
207- if ( DataType == typeof ( DateTime ) || DataType == typeof ( TimeSpan ) || DataType == typeof ( bool ) )
208- checkTextFilter . Enabled = false ;
209-
210- //set default compoents
211- customFilterLastFiltersListMenuItem . Enabled = DataType != typeof ( bool ) ;
212- customFilterLastFiltersListMenuItem . Checked = ActiveFilterType == FilterType . Custom ;
213- }
214-
215165 /// <summary>
216166 /// Closed event
217167 /// </summary>
@@ -1887,6 +1837,66 @@ private void CancelSortMenuItem_MouseEnter(object sender, EventArgs e)
18871837 #endregion
18881838
18891839
1840+ #region datatype functions
1841+
1842+ /// <summary>
1843+ /// Update datatype
1844+ /// </summary>
1845+ /// <param name="dataType"></param>
1846+ internal void SetDataType ( Type dataType )
1847+ {
1848+ // set current datatype
1849+ DataType = dataType ;
1850+
1851+ //set components values
1852+ if ( dataType == typeof ( DateTime ) || dataType == typeof ( TimeSpan ) )
1853+ {
1854+ customFilterLastFiltersListMenuItem . Text = AdvancedDataGridView . Translations [ AdvancedDataGridView . TranslationKey . ADGVCustomFilter . ToString ( ) ] ;
1855+ sortASCMenuItem . Text = AdvancedDataGridView . Translations [ AdvancedDataGridView . TranslationKey . ADGVSortDateTimeASC . ToString ( ) ] ;
1856+ sortDESCMenuItem . Text = AdvancedDataGridView . Translations [ AdvancedDataGridView . TranslationKey . ADGVSortDateTimeDESC . ToString ( ) ] ;
1857+ sortASCMenuItem . Image = Properties . Resources . MenuStrip_OrderASCnum ;
1858+ sortDESCMenuItem . Image = Properties . Resources . MenuStrip_OrderDESCnum ;
1859+ }
1860+ else if ( dataType == typeof ( bool ) )
1861+ {
1862+ customFilterLastFiltersListMenuItem . Text = AdvancedDataGridView . Translations [ AdvancedDataGridView . TranslationKey . ADGVCustomFilter . ToString ( ) ] ;
1863+ sortASCMenuItem . Text = AdvancedDataGridView . Translations [ AdvancedDataGridView . TranslationKey . ADGVSortBoolASC . ToString ( ) ] ;
1864+ sortDESCMenuItem . Text = AdvancedDataGridView . Translations [ AdvancedDataGridView . TranslationKey . ADGVSortBoolDESC . ToString ( ) ] ;
1865+ sortASCMenuItem . Image = Properties . Resources . MenuStrip_OrderASCbool ;
1866+ sortDESCMenuItem . Image = Properties . Resources . MenuStrip_OrderDESCbool ;
1867+ }
1868+ else if ( dataType == typeof ( Int32 ) || dataType == typeof ( Int64 ) || dataType == typeof ( Int16 ) ||
1869+ dataType == typeof ( UInt32 ) || dataType == typeof ( UInt64 ) || dataType == typeof ( UInt16 ) ||
1870+ dataType == typeof ( Byte ) || dataType == typeof ( SByte ) || dataType == typeof ( Decimal ) ||
1871+ dataType == typeof ( Single ) || dataType == typeof ( Double ) )
1872+ {
1873+ customFilterLastFiltersListMenuItem . Text = AdvancedDataGridView . Translations [ AdvancedDataGridView . TranslationKey . ADGVCustomFilter . ToString ( ) ] ;
1874+ sortASCMenuItem . Text = AdvancedDataGridView . Translations [ AdvancedDataGridView . TranslationKey . ADGVSortNumASC . ToString ( ) ] ;
1875+ sortDESCMenuItem . Text = AdvancedDataGridView . Translations [ AdvancedDataGridView . TranslationKey . ADGVSortNumDESC . ToString ( ) ] ;
1876+ sortASCMenuItem . Image = Properties . Resources . MenuStrip_OrderASCnum ;
1877+ sortDESCMenuItem . Image = Properties . Resources . MenuStrip_OrderDESCnum ;
1878+ }
1879+ else
1880+ {
1881+ customFilterLastFiltersListMenuItem . Text = AdvancedDataGridView . Translations [ AdvancedDataGridView . TranslationKey . ADGVCustomFilter . ToString ( ) ] ;
1882+ sortASCMenuItem . Text = AdvancedDataGridView . Translations [ AdvancedDataGridView . TranslationKey . ADGVSortTextASC . ToString ( ) ] ;
1883+ sortDESCMenuItem . Text = AdvancedDataGridView . Translations [ AdvancedDataGridView . TranslationKey . ADGVSortTextDESC . ToString ( ) ] ;
1884+ sortASCMenuItem . Image = Properties . Resources . MenuStrip_OrderASCtxt ;
1885+ sortDESCMenuItem . Image = Properties . Resources . MenuStrip_OrderDESCtxt ;
1886+ }
1887+
1888+ //set check filter textbox
1889+ if ( dataType == typeof ( DateTime ) || dataType == typeof ( TimeSpan ) || dataType == typeof ( bool ) )
1890+ checkTextFilter . Enabled = false ;
1891+
1892+ //set default components
1893+ customFilterLastFiltersListMenuItem . Enabled = dataType != typeof ( bool ) ;
1894+ customFilterLastFiltersListMenuItem . Checked = ActiveFilterType == FilterType . Custom ;
1895+ }
1896+
1897+ #endregion
1898+
1899+
18901900 #region resize methods
18911901
18921902 /// <summary>
0 commit comments