Telerik Forums
UI for WinForms Forum
2 answers
764 views
Hi,

All columns in my grid are added manually in code. Then I set the grid DataSource so most columns are mapped via by FieldName. But there are also not mapped columns that contains expression. I have problem with filtering those columns.

To get the error, do 3 quick steps:

1. Add new form and then add new Grid with 4 columns (GridViewTextBoxColumn).
2. Copy and paste code:
private void Form1_Load(object sender, EventArgs e)
  {
      radGridView1.AllowEditRow = false;
      radGridView1.AllowAddNewRow = false;
      radGridView1.EnableFiltering = true;
      radGridView1.ShowFilteringRow = true;
      radGridView1.SelectionMode = GridViewSelectionMode.CellSelect;
 
      DataTable dt = new DataTable();
      dt.Columns.Add( new DataColumn("sql1", typeof(Int32)));
      dt.Columns.Add( new DataColumn("sql2", typeof(Int32)));
 
      dt.Rows.Add(new Object[] { 1, 0 });
      dt.Rows.Add(new Object[] { 1, 1 });
      dt.Rows.Add(new Object[] { 1, 1 });
      dt.Rows.Add(new Object[] { 0, 1 });
      dt.Rows.Add(new Object[] { 1, 0 });
      dt.Rows.Add(new Object[] { 1, 1 });
      dt.Rows.Add(new Object[] { 1, 0 });
 
 
      radGridView1.DataSource = dt;
 
      radGridView1.Columns[2].Expression = "IIF(column1 = 1,  'YES', 'NO' )";
      radGridView1.Columns[3].Expression = "IIF(column2 = 1,  'YES', 'NO' )";
  }


3. Run application and add filter: "y" to column 3, then enter "y" to column 4.

You will get error like in title of this post.

Output:
A first chance exception of type 'Telerik.WinControls.Data.FilterExpressionException' occurred in Telerik.WinControls.dll
An unhandled exception of type 
'Telerik.WinControls.Data.FilterExpressionException' occurred in Telerik.WinControls.dll
Additional information: Invalid filter expression.

Screen exception:
************** Exception Text **************
Telerik.WinControls.Data.FilterExpressionException: Invalid filter expression. ---> Telerik.Data.Expressions.InvalidExpressionException: The expression contains object 'column4' that is not defined in the current context.
   at Telerik.Data.Expressions.NameNode.Eval(Object row, Object context)
   at Telerik.Data.Expressions.LikeNode.Eval(Object row, Object context)
   at Telerik.Data.Expressions.Operator.AndFunc(Operand lhs, Operand rhs, OperatorContext context)
   at Telerik.Data.Expressions.BinaryOpNode.Eval(Object row, Object context)
   at Telerik.WinControls.Data.RadCollectionView`1.PerformExpressionFilter(TDataItem item)
   --- End of inner exception stack trace ---
   at Telerik.WinControls.Data.RadCollectionView`1.PerformExpressionFilter(TDataItem item)
   at Telerik.WinControls.Data.RadCollectionView`1.PassesFilter(TDataItem item)
   at Telerik.Collections.Generic.HybridIndex`1.PerformWithQuickSort()
   at Telerik.Collections.Generic.HybridIndex`1.Perform()
   at Telerik.Collections.Generic.HybridIndex`1.get_Items()
   at Telerik.Collections.Generic.Index`1.get_Count()
   at Telerik.WinControls.Data.GroupBuilder`1.get_Groups()
   at Telerik.WinControls.Data.RadDataView`1.get_Groups()
   at Telerik.WinControls.UI.GridViewTemplate.get_Groups()
   at Telerik.WinControls.UI.GridViewTemplate.RefreshSummaryRowsInGroup(NotifyCollectionChangedEventArgs e)
   at Telerik.WinControls.UI.GridViewTemplate.RefreshAggregates(NotifyCollectionChangedEventArgs e)
   at Telerik.WinControls.UI.GridViewTemplate.OnViewChanged(Object sender, DataViewChangedEventArgs e)
   at Telerik.WinControls.UI.GridViewTemplate.CollectionView_CollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at Telerik.WinControls.Data.RadCollectionView`1.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
   at Telerik.WinControls.Data.RadDataView`1.RebuildData(Boolean notify)
   at Telerik.WinControls.Data.RadDataView`1.RefreshOverride()
   at Telerik.WinControls.Data.RadDataView`1.OnNotifyPropertyChanged(PropertyChangedEventArgs e)
   at Telerik.WinControls.Data.RadCollectionView`1.set_FilterExpression(String value)
   at Telerik.WinControls.UI.GridViewFilterDescriptorCollection.ApplyFilter()
   at Telerik.WinControls.UI.GridViewFilterDescriptorCollection.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
   at Telerik.Collections.Generic.NotifyCollection`1.InsertItem(Int32 index, T item)
   at Telerik.WinControls.UI.GridViewFilterDescriptorCollection.InsertItem(Int32 index, FilterDescriptor item)
   at System.Collections.ObjectModel.Collection`1.Add(T item)
   at Telerik.WinControls.UI.GridViewDataColumn.SetFilterDescriptor(FilterDescriptor value)
   at Telerik.WinControls.UI.GridViewFilteringRowInfo.SetFilterDesriptor(GridViewDataColumn dataColumn, FilterDescriptor descriptor)
   at Telerik.WinControls.UI.GridViewFilteringRowInfo.set_Item(GridViewColumn column, Object value)
   at Telerik.WinControls.UI.GridDataCellElement.set_Value(Object value)
   at Telerik.WinControls.UI.GridFilterCellElement.set_Value(Object value)
   at Telerik.WinControls.UI.GridFilterCellElement.Editor_ValueChanged(Object sender, EventArgs e)
   at Telerik.WinControls.UI.BaseInputEditor.OnValueChanged()
   at Telerik.WinControls.UI.BaseGridEditor.OnValueChanged()
   at Telerik.WinControls.UI.RadTextBoxEditor.TextBoxItem_TextChanged(Object sender, EventArgs e)
   at System.EventHandler.Invoke(Object sender, EventArgs e)
   at Telerik.WinControls.RadItem.OnTextChanged(EventArgs e)
   at Telerik.WinControls.RadItem.OnPropertyChanged(RadPropertyChangedEventArgs e)
   at Telerik.WinControls.RadHostItem.OnPropertyChanged(RadPropertyChangedEventArgs e)
   at Telerik.WinControls.UI.RadTextBoxItem.OnPropertyChanged(RadPropertyChangedEventArgs e)
   at Telerik.WinControls.RadObject.RaisePropertyNotifications(RadPropertyValue propVal, Object oldValue, Object newValue, ValueSource oldSource)
   at Telerik.WinControls.RadObject.SetValueCore(RadPropertyValue propVal, Object propModifier, Object newValue, ValueSource source)
   at Telerik.WinControls.RadElement.SetValueCore(RadPropertyValue propVal, Object propModifier, Object newValue, ValueSource source)
   at Telerik.WinControls.UI.RadTextBoxItem.TextBoxControl_TextChanged(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnTextChanged(EventArgs e)
   at System.Windows.Forms.TextBoxBase.OnTextChanged(EventArgs e)
   at System.Windows.Forms.TextBoxBase.WmReflectCommand(Message& m)
   at System.Windows.Forms.TextBoxBase.WndProc(Message& m)
   at System.Windows.Forms.TextBox.WndProc(Message& m)
   at Telerik.WinControls.UI.HostedTextBoxBase.WndProc(Message& message)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
konrad
Top achievements
Rank 1
 answered on 20 Jun 2013
10 answers
730 views
When i change the color of the tile the default mouse-over color change effect disappears. How do i re enable this.
Stefan
Telerik team
 answered on 20 Jun 2013
7 answers
276 views
When a person creates a recurring appointment, our database decodes the recurrence rule and creates an appointment for each occurrence, then saves the recurrence rule as a text string. When loading appointments the recurrence rule is not loaded because all the appointments are loaded.
When a person edits one of those appointments we want to set the recurrence rule to the original value in case they go to edit it the values will be set.
Currently we attempting to set the custom appointment's recurrence rule in the LoadSettingsFromEvent event of the custom apppointment form.

tmpRule = RecurrenceRule.CreateRule(RecurrenceType.Weekly)
tmpRule.count = 25

appointmentWithEmail.RecurrenceRule = tmpRule


How do we add the ByDay value, i.e. "MO,WE,FR", or the WKST value?


Thanks
Art
Stefan
Telerik team
 answered on 20 Jun 2013
1 answer
99 views
Hello,

I am evaluating the Telerik controls for use in a presentation app.  I am looking for a way to show individual PDF pages in a slideshow type format.  I was wondering if there is a way to load a PDF file and show each page in the rotator in this manner?  The PDFViewer control is not what I am looking for, as it shows the entire PDF at once, while scrolling through the pages.  I want to see the pages one at a time.

Thank you.
Stefan
Telerik team
 answered on 19 Jun 2013
13 answers
282 views
Hello,

I have a class that inherits from Telerik.WinControls.UI.Appointment. After clicking a checkbox on the edit-dialog of said appointment subclass and clicking OK, I need this single appointment to be read-only.

I have tried setting the AllowDelete and AllowEdit properties of the Appointment to false, which does the trick with regard to blocking the delete-button and preventing the edit-dialog from opening. However, I can still 'resize' and drag an appointment that is on/inside the Scheduler. Is there a way to prevent that, i.e. make this one Appointment perfectly read-only?

Thanks in advance for your answer.
Georgios
Top achievements
Rank 1
 answered on 19 Jun 2013
1 answer
115 views
What is the best practice for repeatedly changing the grid's datasource when the structure varies? Should the rows be cleared and the columns list be cleared before resetting the DataSource to a new datatable?  Should the DataSource be set to null first?

 

Stefan
Telerik team
 answered on 19 Jun 2013
11 answers
254 views
Is it possible to import a docx Word-document with bookmarks into the RadRichTextBox and then jump to a bookmark that has been set with Word in the docx file? We use the version 2012.2.608.40 of RadRichTextBox.

 

I created a bookmark “Test1” in Word, saved the document as docx and imported the docx file into a RadRichTextBox. Then I called document.GetBookmarkByName() and document.GetAllBookmarks(). But the bookmark wasn’t found in both methods. See my sample code below.

 

public void ImportDocx(string filename)

{

     RadDocument document = null;

     IDocumentFormatProvider provider = new DocxFormatProvider();

     using (FileStream stream = new FileStream(filename, FileMode.Open))

     {

           document = provider.Import(stream);

      }

      radRichTextBox.Document = document;

      BookmarkRangeStart bookmarkRangeStart = document.GetBookmarkByName("Test1");

      document.GoToBookmark("Test1");

}

 

Is the import of bookmarks created with Word not supported?

Stefan
Telerik team
 answered on 18 Jun 2013
1 answer
114 views
After searching your site, I could not find a link that said "Enter Bug Report Here" so I'm reporting it here. 

The product is RadControls for WinForms, v.2013.1.220.40, RadSpellChecker.  In the Intellisense for the RadSpellChecker on the EnableCompleteMessageBox property, the property description has a misspelling.  It reads, "Gets or set a value that determine wheather the Complete Dialog box is enabled."  Obviously it should be spelled whether. 

Kind of funny that it was misspelled on the spell checker control.  :-)

James
Peter
Telerik team
 answered on 18 Jun 2013
3 answers
194 views
Hey!

We have found radchartview rly powerfull tool for our custom reporting. With that in mind we have hit small issue with recognizing which series is using which y-axis. On following example (attachment) we got 9 different series using 3 different y-axis (or to be correct 3series from which 3 different values is shown).
Now the main question is, how can we make this more readable? Atm it's on terrible shape if it got more then 1 serie of values shown (=3different values from 1 serie). Having  one y-axis using different style (bars) could work, but that doesn't help with 3+ y-Axis. Is there any clear solution atm or do we have to life with the limitations it got atm?
Anton
Telerik team
 answered on 18 Jun 2013
1 answer
217 views
Hello,

Following up from the entry: series-draw-order, how can we improve draw performance?

When there are many series being drawn, the performance begins to suffer, for what I think is a kind of "double buffering" going on. Time is spent inserting into the draw parts. Is it possible to simply draw the series without this intermediate step?

What I'm telling my end-users is that there are limits, but if we can improve upon the performance at all, I want to.

That or go with something like an MSChart?

Thank you.

Regards,

Michael Powell
Peter
Telerik team
 answered on 17 Jun 2013
Narrow your results
Selected tags
Tags
GridView
General Discussions
Scheduler and Reminder
Treeview
Dock
RibbonBar
Themes and Visual Style Builder
ChartView
Calendar, DateTimePicker, TimePicker and Clock
DropDownList
Buttons, RadioButton, CheckBox, etc
ListView
ComboBox and ListBox (obsolete as of Q2 2010)
Form
Chart (obsolete as of Q1 2013)
PageView
MultiColumn ComboBox
TextBox
RichTextEditor
PropertyGrid
Menu
RichTextBox (obsolete as of Q3 2014 SP1)
Panelbar (obsolete as of Q2 2010)
PivotGrid and PivotFieldList
Tabstrip (obsolete as of Q2 2010)
MaskedEditBox
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
VirtualGrid
Toolstrip (obsolete as of Q3 2010)
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
SplitContainer
Documentation
Map
DesktopAlert
CheckedDropDownList
ProgressBar
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
CollapsiblePanel
LayoutControl
ShapedForm
SyntaxEditor
Wizard
TextBoxControl
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
WaitingBar
GroupBox
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
FileDialogs
ColorDialog
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
NavigationView
BindingNavigator
RibbonForm
Styling
Barcode
PopupEditor
TaskBoard
Callout
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
BreadCrumb
ButtonTextBox
FontDropDownList
BarcodeView
Overlay
Security
LocalizationProvider
Dictionary
TreeMap
StepProgressBar
SplashScreen
Flyout
Separator
SparkLine
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
SpeechToTextButton
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?