Telerik Forums
UI for WinForms Forum
1 answer
200 views
In gridview i am displaying some string fields and few numeric fields. The filter operator for string fields is automatically set to "Contains", however the numeric fields are left with "no filter". Is there a way to make the default filter for numberic fields to "equal to" without setting it on each column definition (as shown in the code below)?
GridViewTextBoxColumn colNumericField = new GridViewTextBoxColumn("NumericField");
                   colNumericField .Width = 100;
                   colNumericField .HeaderText = "Loc #";
                   colNumericField .ReadOnly = true;
                   colNumericField .FilterDescriptor = new Telerik.WinControls.Data.FilterDescriptor(null, Telerik.WinControls.Data.FilterOperator.IsEqualTo, null);
                   radGV1.MasterTemplate.Columns.Add(colNumericField );


Thanks
Stefan
Telerik team
 answered on 06 Apr 2012
2 answers
199 views

Hello,
When i tick "enable column reordering" from specific task it works fine. but i want to enable this from code. i tried the followings but did not work.
this.AllowColumnReorder = true;
this.MasterTemplate.AllowColumnReorder = true;
foreach (GridViewColumn item in this.MasterTemplate.Columns)
{
       item.AllowSort=true;
       item.AllowReorder = true;
       item.IsPinned = false;               
}
Can u help about this.
 
Ahmet Özgür
Top achievements
Rank 1
 answered on 05 Apr 2012
4 answers
671 views
I am developing a filter panel usercontrol that will allow my user to create complex filters.  My control follows the same structure as the documentation, but it does not work as expected.  It appears the last filterdescriptor added to the "main" composite filter is the only filter applied.

http://www.telerik.com/help/winforms/gridview-filtering-setting-filters-programmatically-composite-descriptors.html 

So, I took the exact code from the documentation, and it appears it is behaving incorrectly as well.  See below.  Also, notice my screenshot?  I would expect the Expression property to have the combination of the two filterdescriptors similar to the wording in documentation. Thoughts?

  Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
 
 
        Dim oFooData As New BindingList(Of SampleData)
 
        Dim i As Integer = 1
        While i < 50
            oFooData.Add(New SampleData(10 * i, 3 * i, "Game"))
            i += 1
        End While
 
        i = 0
        While i < 50
            oFooData.Add(New SampleData(5 * i, 0, "Aatar"))
            i += 1
        End While
 
        RadGridView1.DataSource = oFooData
 
        Dim compositeFilter1 As New CompositeFilterDescriptor()
        compositeFilter1.FilterDescriptors.Add(New FilterDescriptor("UnitsInStock", FilterOperator.IsGreaterThan, 100))
        compositeFilter1.FilterDescriptors.Add(New FilterDescriptor("ProductName", FilterOperator.StartsWith, "G"))
        compositeFilter1.LogicalOperator = FilterLogicalOperator.[Or]
        Dim filter2 As New FilterDescriptor("UnitsOnOrder", FilterOperator.IsEqualTo, 0)
        Dim filterDescriptor2 As New CompositeFilterDescriptor()
        filterDescriptor2.FilterDescriptors.Add(compositeFilter1)
        filterDescriptor2.FilterDescriptors.Add(filter2)
        filterDescriptor2.LogicalOperator = FilterLogicalOperator.[And]
 
        Me.RadGridView1.FilterDescriptors.Add(filterDescriptor2)
 
    End Sub
 
 
 
 
 
 
Public Class SampleData
    Property UnitsInStock As Integer
    Property UnitsOnOrder As Integer
    Property ProductName As String
 
    Public Sub New(ByVal UnitsInStock As Integer, UnitsOnOrder As Integer, ProductName As String)
        _UnitsInStock = UnitsInStock
        _UnitsOnOrder = UnitsOnOrder
        _ProductName = ProductName
    End Sub
 
End Class
Stefan
Telerik team
 answered on 05 Apr 2012
3 answers
259 views
I am using Telerik WinForms RadGridView Control, I have set up Excel-like filtering, everything in fine, but I have a little problem. When I am filtering a Boolean field, in filter popup their are values: "True" and "False". Is it possible to change them on something more user-friendly, like "Yes" and "No" ?  Maybe it is possible to do in FilterPopupRequired Event ?
Nikolay
Telerik team
 answered on 05 Apr 2012
1 answer
273 views
Hi, Telerik team 


I have some heavy and rich in features application. I need to support it, so even if i know it was written with some of Telerik controls that are obsolete now I am not allowed to change everything I want to. So please, excuse me for this question.


I have the following layout:
On a winform there is a RadDock.
In it there are two ToolTabStrips, one on the left side and the other one on the right side. In the middle there is DocumentContainer with DocumentTabStrip objects inside it.


I am asked to implement the following functionality:
Some collapse/restore button that will hide both ToolTabStrips and maximize form.  On restore it should return ToolTabStrips to their places, form to normal state. I did it like this:


private void OnMenuViewFullScreenClick(object sender, EventArgs e)
{
    _isMaximized = !_isMaximized;
 
 
    if (_isMaximized)
    {
        toolTabStripLeft.Hide();
        toolTabStripRight.Hide();
        WindowState = FormWindowState.Maximized;
        tbutFullScreen.Checked = true;
    }
    else
    {
        toolTabStripLeft.Show();
        toolTabStripRight.Show();
        WindowState = FormWindowState.Normal;
        tbutFullScreen.Checked = false;
    }
 
 
}



Well, there is one more thing I need to be done and I don't know how to do it. DocumentContainer should be maximized and rstored to initial size as well. How can I acheive it?
Thanks in advance!
Nikolay
Telerik team
 answered on 05 Apr 2012
10 answers
383 views
Hi.  When I bind my chart I get the error Binding produces error: The type of column with name  EstKBytesSaved is not numeric 

   // Display series           
   rcChart.DataSource = lstStats;  
   rcChart.Series[0].DataYColumn = "EstKBytesSaved";  
   rcChart.Series[1].DataYColumn = "Hits";  
   rcChart.PlotArea.XAxis.DataLabelsColumn = sDataLabelColumn;  
   rcChart.DataBind(); 

Where lstStats is a generic <List> of items and both EstKBytesSaved and Hits are declared as long values.  e.g.
 
    public long EstKBytesSaved   
      {  
         get { return _lEstKBytesSaved ; }  
      } 

in this scenario, the graph does not produce at all

This error was, and can only be found in production - which makes it really confusing - if I compile the project in RELEASE mode and run the executable, the error appears.  If I compile it in DEBUG mode there are no errors and the graph produces just fine!  I have a few #if DEBUG statements in the solution, but none of my #DEBUG seem to relate to the charting areas.  I wonder what the microsoft compiler is doing here..?

given EstKBytesSaved  is declared as a long.   I wondered if numeric in this instance meant it had to be a numeric in the database sense, e.g.  double in c#. but the telerik examples use int, so I figured any numeric value would be ok.

if I change my internal values to convert my long to an int, when compiling in RELEASE mode:

  public int EstKBytesSaved  
      {  
         get { return (int)((long)_lEstBytesSaved / 1024); }  
      } 

In this scenario, the graph produces but incorrectly with a message about "no or empty series" (If i loop through and message output the data there are most definetly values.. values which graph correctly in debug mode)

If I change my internal values to convert to a double, when compiling in RELEASE mode, e.g.

 public double EstKBytesSaved  
      {  
         get { return (double)((long)_lEstBytesSaved / 1024); }  
      } 

I get the same "there is no or empty series" error message.

I'm stumped, any ideas where to look next?

Regards
  Ewart.

Rishi
Top achievements
Rank 1
 answered on 04 Apr 2012
1 answer
193 views
I was having some trouble getting my checkbox slection to have a oncheck event that could be used to restrict the grid to have a single checkbox selected at any given time and process the change as soon as the value changed not after leaving the field. This is what I came up with.

Private Sub rgridAffinityPrograms_CellEditorInitialized(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.GridViewCellEventArgs) Handles rgridAffinityPrograms.CellEditorInitialized
        Dim editor As RadCheckBoxEditor = TryCast(e.ActiveEditor, RadCheckBoxEditor)
        AddHandler (editor.ValueChanged), AddressOf editor_ValueChanged
End Sub
 
Private Sub editor_ValueChanged(ByVal sender As Object, ByVal e As EventArgs)
        rgridAffinityPrograms.EndEdit()
End Sub
 
Private Sub rgridAffinityPrograms_CellValueChanged(ByVal sender As System.Object, ByVal e As Telerik.WinControls.UI.GridViewCellEventArgs) Handles rgridAffinityPrograms.CellValueChanged
        If e.ColumnIndex = 0 And sender.ToString = "Telerik.WinControls.UI.GridCheckBoxCellElement" Then
            Dim chk As GridCheckBoxCellElement = sender
            If chk.Value = True Then
                For Each row As GridViewRowInfo In rgridAffinityPrograms.Rows
                    If row.Index <> e.RowIndex Then
                        row.Cells("IsSelected").Value = False
                    End If
                Next
            End If
        End If
End Sub
Stefan
Telerik team
 answered on 04 Apr 2012
3 answers
212 views
I tried to follow your guide, but I'm not able to figure out what step I skipped... 
The problem is that when I group my items, they all get into a single group with the FQDN of the object in BindingList. For the same reason (I think), the ordering doesn't work.

I set up a RadListView whith those parameters (ViewType cannot be changed):
radListView1.DataSource = dtoList;
oDtoList = dtoList;
radListView1.DisplayMember = "Title";
radListView1.ValueMember = "PictureId";
radListView1.ViewType = ListViewType.IconsView;
radListView1.Padding = new Padding(10, 48, 10, 10);
this.radListView1.ItemSize = new Size(300, 110);
this.radListView1.ItemSpacing = 5;
this.radListView1.AllowArbitraryItemHeight = false;

dtoList is a BindingList of:
public class DTOimage
    {
       public Int64 PictureId;
       public String Path;
       public String Author;
       public String Title;
       public DTOimage(){}
       public DTOimage(Int64 pictureId, String path, String author, String title)
       {
           PictureId = pictureId;
           Path = path;
           Author = author;
           Title = title;
       }
    }

when I group items, I've:
private void commandBarDropDownList2_SelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e)
        {
            this.radListView1.GroupDescriptors.Clear();
            switch (this.commandBarDropDownList2.Text)
            {
                case "Nessuno":
                    this.radListView1.EnableGrouping = false;
                    this.radListView1.ShowGroups = false;
                    break;
                case "Nome":
                    this.radListView1.GroupDescriptors.Add(new GroupDescriptor(
                        new SortDescriptor[] { new SortDescriptor("Title", ListSortDirection.Ascending) }));
                    this.radListView1.EnableGrouping = true;
                    this.radListView1.ShowGroups = true;
                    break;
                case "Autore":
                    this.radListView1.GroupDescriptors.Add(new GroupDescriptor(
                        new SortDescriptor[] { new SortDescriptor("Author", ListSortDirection.Ascending) }));
                    this.radListView1.EnableGrouping = true;
                    this.radListView1.ShowGroups = true;
                    break;
            }
        }

Nikolay
Telerik team
 answered on 04 Apr 2012
2 answers
972 views
Hi,

I am binding the parent nodes to a treeview initially and intends to bind the children of each node on LoadOnDemand.I am checking whether each parent node is having child nodes on initial bind to show or hide the expand-collapse button.I want to hide the expand-collapse button for those nodes who doesn't have any child.

Help me.
Thnx in advance.
Julian Benkov
Telerik team
 answered on 03 Apr 2012
1 answer
153 views
gridView dosnt Print Group Header Row
exist an example in telerik winform example "group summaries"
and i add a function to header row " Customer ID : ALFKI | Max of Freight: 63.53;"
but in printing dosent show " | Max of Freight: 63.53;"

Ivan Petrov
Telerik team
 answered on 03 Apr 2012
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
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
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
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
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?