Telerik Forums
UI for WinForms Forum
1 answer
72 views
how i can convert viewInfo.GridViewElement in Q2 2012


GridViewInfo viewInfo;
if ((viewInfo.GridViewElement != null))
 {
      if (viewInfo.GridViewElement.HScrollBar.Visibility == Telerik.WinControls.ElementVisibility.Visible)
            height += 20;
}
Jack
Telerik team
 answered on 19 Oct 2012
1 answer
58 views
hello how i can convert this Code to Q2 2012 

rowInfo.ChildRow.ChildViewInfo

Thank you 
Mahmoud Salem
Jack
Telerik team
 answered on 19 Oct 2012
1 answer
118 views

 

I build a winform application with some grid-views, when I invoking anything (textboxes, the main form and more) I am getting exception: Object reference not set to an instance of an object.

I really don’t know what to do; we are in an advance project developing so replaceing the telerik components will not the best idea.

Any suggestions?

 

(see stack trace below)

   at Telerik.WinControls.UI.GridVirtualizedRowElement.DetachCells()

   at Telerik.WinControls.UI.GridVirtualizedRowElement.Detach()

   at Telerik.WinControls.UI.GridDataRowElement.Detach()

   at Telerik.WinControls.UI.GridRowElement.DisposeManagedResources()

   at Telerik.WinControls.DisposableObject.PerformDispose(Boolean disposing)

   at Telerik.WinControls.RadElement.PerformDispose(Boolean disposing)

   at Telerik.WinControls.DisposableObject.Dispose(Boolean disposing)

   at Telerik.WinControls.DisposableObject.Dispose()

   at Telerik.WinControls.RadElement.DisposeChildren()

   at Telerik.WinControls.RadElement.PerformDispose(Boolean disposing)

   at Telerik.WinControls.DisposableObject.Dispose(Boolean disposing)

   at Telerik.WinControls.DisposableObject.Dispose()

   at Telerik.WinControls.RadElement.DisposeChildren()

   at Telerik.WinControls.RadElement.PerformDispose(Boolean disposing)

   at Telerik.WinControls.DisposableObject.Dispose(Boolean disposing)

   at Telerik.WinControls.DisposableObject.Dispose()

   at Telerik.WinControls.RadElement.DisposeChildren()

   at Telerik.WinControls.RadElement.PerformDispose(Boolean disposing)

   at Telerik.WinControls.DisposableObject.Dispose(Boolean disposing)

   at Telerik.WinControls.DisposableObject.Dispose()

   at Telerik.WinControls.RadElement.DisposeChildren()

   at Telerik.WinControls.RadElement.PerformDispose(Boolean disposing)

   at Telerik.WinControls.DisposableObject.Dispose(Boolean disposing)

   at Telerik.WinControls.DisposableObject.Dispose()

   at Telerik.WinControls.RadElement.DisposeChildren()

   at Telerik.WinControls.RadElement.PerformDispose(Boolean disposing)

   at Telerik.WinControls.DisposableObject.Dispose(Boolean disposing)

   at Telerik.WinControls.DisposableObject.Dispose()

   at Telerik.WinControls.RadElement.DisposeChildren()

   at Telerik.WinControls.RadElement.PerformDispose(Boolean disposing)

   at Telerik.WinControls.DisposableObject.Dispose(Boolean disposing)

   at Telerik.WinControls.DisposableObject.Dispose()

   at Telerik.WinControls.ComponentThemableElementTree.Dispose(Boolean disposing)

   at Telerik.WinControls.RadElementTree.Dispose()

   at Telerik.WinControls.RadControl.Dispose(Boolean disposing)

   at Telerik.WinControls.UI.RadGridView.Dispose(Boolean disposing)

   at System.ComponentModel.Component.Dispose()

   at System.Windows.Forms.Control.Dispose(Boolean disposing)

   at System.ComponentModel.Component.Dispose()

   at System.Windows.Forms.Control.Dispose(Boolean disposing)

   at Telerik.WinControls.RadControl.Dispose(Boolean disposing)

   at System.ComponentModel.Component.Dispose()

   at System.Windows.Forms.Control.Dispose(Boolean disposing)

   at System.Windows.Forms.Form.Dispose(Boolean disposing)

   at Telerik.WinControls.UI.RadFormControlBase.Dispose(Boolean disposing)

   at Telerik.WinControls.UI.RadForm.Dispose(Boolean disposing)

   at Generic_EI.CELL_PC.Dispose(Boolean disposing) in C:\DevelopZone\TowerProjects\Fab1Automation\NEW_CELL_PC\Generic_EI\CELL_PC.Designer.cs:line 20

   at System.ComponentModel.Component.Dispose()

   at System.Windows.Forms.ApplicationContext.Dispose(Boolean disposing)

   at System.Windows.Forms.Application.ThreadContext.DisposeThreadWindows()

Jack
Telerik team
 answered on 19 Oct 2012
1 answer
174 views
Hi,

I'm trying to use pageview backstage mode in my multi-threading application, but I always get the following error:

"Object reference not set to an instance of an object"

Basically, I create a new thread and in that thread I am trying to make a specific item button and the related page selected. Below is the code:

Dim CurrentTask As Integer = 1

Dim backStageElement As RadPageViewBackstageElement

Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles Me.Load

Control.CheckForIllegalCrossThreadCalls = False

Dim checkcurrenttaskthread As New Threading.Thread(AddressOf checkcurrenttask)

checkcurrenttaskthread.Start()

End Sub

Public Sub checkcurrenttask()

While True

If CurrentTask = 1 Then

backStageElement =

TryCast(RadPageView1.ViewElement, RadPageViewBackstageElement)

backStageElement.Items(0).IsSelected = True

RadPageView1.SelectedPage = RadPageView1.Pages(0)

End If

End While

End Sub


Is it because I call the pageview control in a thread-unsafe way? How can I get rid of that error?

Thanks in advance!               
Ivan Todorov
Telerik team
 answered on 19 Oct 2012
2 answers
138 views
I'm using a listview with custom items to display formatted data from our database.

For some reason, I can't seem to get rid of the pesky checkboxes for each item. I've got the following properties defined...at this point both in the visual editor as well as in code that runs after the form on load method.

lvProgramGoals.ViewType = ListViewType.IconsView;
lvProgramGoals.FullRowSelect = true;
lvProgramGoals.AllowEdit = false;
lvProgramGoals.AllowRemove = false;           
lvProgramGoals.ShowCheckBoxes = false;


Guessing there is something happening with how I'm creating and configuring the custom items. 

using:

private void lvProgramGoals_VisualItemCreating(object sender, Telerik.WinControls.UI.ListViewVisualItemCreatingEventArgs e)
{
     e.VisualItem = new CustomVisualItem();       
}

I initialize this class (modeled after the Telerik custom item demo)

class CustomVisualItem : IconListViewVisualItem
{
    private StackLayoutPanel titleLayout;
    private StackLayoutPanel stackLayout;
 
    private LightVisualElement nameElement;
    private LightVisualElement descriptionElement;
    private LightVisualElement dateRange;
 
    public CustomVisualItem()
    {
        base.CreateChildElements();
 
        titleLayout = new StackLayoutPanel();
        titleLayout.Orientation = Orientation.Horizontal;
        titleLayout.Size = new System.Drawing.Size(200, 30);
 
        nameElement = new LightVisualElement();
        nameElement.TextAlignment = ContentAlignment.MiddleLeft;
        nameElement.TextWrap = true;
        titleLayout.Children.Add(nameElement);
 
        dateRange = new LightVisualElement();
        dateRange.TextAlignment = ContentAlignment.MiddleRight;
        titleLayout.Children.Add(dateRange);
 
        stackLayout = new StackLayoutPanel();
        stackLayout.Orientation = Orientation.Vertical;
 
        stackLayout.Children.Add(titleLayout);
 
        descriptionElement = new LightVisualElement();
        descriptionElement.TextAlignment = ContentAlignment.BottomCenter;
        stackLayout.Children.Add(descriptionElement);
 
        stackLayout.Size = new Size(200, 60);
 
        this.Children.Add(stackLayout);
 
        this.GradientStyle = GradientStyles.Gel;
 
    }
    protected override void SynchronizeProperties()
    {
        base.SynchronizeProperties();           
 
        this.nameElement.Text = Convert.ToString(this.Data[ProgramGoals.COLUMN_NAME]);
        this.descriptionElement.Text = Convert.ToString(this.Data[ProgramGoals.COLUMN_DESCRIPTION]);
 
        //TODO: convert date format to MM/dd/yyyy
        string dateStr =
            this.Data[ProgramGoals.COLUMN_START].ToString() +
            " to " +
            this.Data[ProgramGoals.COLUMN_END].ToString();
        this.dateRange.Text = Convert.ToString(dateStr);
    }
    protected override Type ThemeEffectiveType
    {
        get { return typeof(SimpleListViewVisualItem); }
    }
}


Obviously something, somewhere, is overriding my definition that checkboxes should not be visible, but I can't seem to track it down.

Any help is appreciated. More code can be provided if need be, but wanted to provide the "most relevant" snippets first.

Additionally, for bonus appreciation, I'm seeing the following (new to Telerik, so probably some noobie issues):
- I'm binding to the listview using a List<Entities> from MS Entity Framework. No matter what I seem to do, the list of entities seems to be overlaid on the visual elements shown above to get messy overlap. Ideally I would hide the data from each item with the exception of the data flowing through the custom visual elements
- I've tried a variety of NotifyParentOnMouseInput and ShouldHandleMouseInput configurations, but I still am not able to click on a list item to select. It could be that clicking a row automatically processes the checkbox instead of selecting the item? I'll know once I resolve the issue above. I am however able to use the keyboard up and down arrows to move up and down the list, selecting items as I go.
Ivan Todorov
Telerik team
 answered on 19 Oct 2012
1 answer
159 views

Hi Team,
I am binding grid to the out put of a stored procedure on page load.

I see some dummy blank rows getting added. Can you please let know on how i can remove this.
[ I have checked my stored procedure and it is not returning any blank row]

***********************************
I am adding the summary row like this. The below code is in page load.

GridViewSummaryItem Additional_Pipeline_Needed = new GridViewSummaryItem("Additional_Pipeline_Needed", "{0}", GridAggregateFunction.Sum);
              GridViewSummaryItem Next_Year_Backlog = new GridViewSummaryItem("Next_Year_Backlog", "{0}", GridAggregateFunction.Sum);
              GridViewSummaryItem Next_Year_Weighted_Pipeline = new GridViewSummaryItem("Next_Year_Weighted_Pipeline", "{0}", GridAggregateFunction.Sum);
 GridViewSummaryRowItem summaryRowItem = new GridViewSummaryRowItem(new GridViewSummaryItem[] { 
                  ,Additional_Pipeline_Needed,Next_Year_Backlog,Next_Year_Weighted_Pipeline});
              this.rgvSummaryReport.SummaryRowsBottom.Add(summaryRowItem);

I have ViewCellFormatting & CellFormatting events which is used to add $ symbol and replace - of negative number with ()
Ex: -5 will become ($5)

private void radgrid_ViewCellFormatting_1(object sender, CellFormattingEventArgs e)
        {
           
                GridSummaryCellElement cell = e.CellElement as GridSummaryCellElement;
                if (e.CellElement != null)
                {
                    if (e.CellElement.Text.Contains("$-"))
                    {
                        e.CellElement.Text = e.CellElement.Text.Replace("$", "").Replace("-", "($") + ")";
                        e.CellElement.TextAlignment = ContentAlignment.MiddleRight;
                    }
                }
          }

private void radgrid_CellFormatting(object sender, CellFormattingEventArgs e)
        {
                GridSummaryCellElement cell = e.CellElement as GridSummaryCellElement;
                if (e.CellElement != null)
                {
                    if (e.CellElement.Text.Contains("$-"))
                    {
                        e.CellElement.Text = e.CellElement.Text.Replace("$", "").Replace("-", "($") + ")";
                        e.CellElement.TextAlignment = ContentAlignment.MiddleRight;
                    }
                }
        
}


After writing the above code, the -ve sign in a column in the  total row does not show up with () on page load. It still appears as $-5, but on click on any cell, it gets changed to  ($5)
Can you pls help.

Regards,
-Vikas

Julian Benkov
Telerik team
 answered on 19 Oct 2012
3 answers
241 views
I have created a custom column by inheriting from GridViewDataColumn (and GridDataCellElement and BaseGridEditor and LightvisualElement)

When used, the column is databound to an object (often an Entity Framework Entity).

If I try to sort on the column, it doesn't work in any meaningful way, probably because the grid doesn't know how to sort the objects the column is databound to.

Is there a way for the column to control how it is sorted ?

I'd rather not use the custom sorting features of the grid, then I would have to implement it on all grids using the column (the column is rather generic and used all over).

The logic I would like to implement is quite similar to logic of the DisplayMemberSort property in GridViewComboBoxColumn (sorting on something else than the value the column is databound to).

Peeking at the code of GridViewComboBoxColumn, it seems as it is implementing this functionality by overriding the GetValue method, and looking at the GridViewDataOperation flag. However, the GetValue method is internal, so I can't do the same in my column class.

Thanks /Hannes
Julian Benkov
Telerik team
 answered on 19 Oct 2012
1 answer
115 views
Hi,

Is it possible to change the Values section of the RadPivotFieldList component to display a value instead of counting the values?

Cheers

Shaun.
Ivan Todorov
Telerik team
 answered on 19 Oct 2012
1 answer
84 views
I need a masked edit box that allows for up to 2 digits (0 - 99).  I followed the documentation, tried every combination of standard and numeric masks that should have worked to no avail.

I use Standard MaskType, with Mask 00, 99, ## - it only allows me to enter 1 digit, it should be 2 according to the documentation.  
Peter
Telerik team
 answered on 19 Oct 2012
6 answers
381 views
I'm using the following snippet to find text

private void HightlightText(string textToHighlight)
{
    DocumentTextSearch search = new DocumentTextSearch(this.radRichTextBox1.Document);
    foreach (var textRange in search.FindAll(textToHighlight))
    {
        this.radRichTextBox1.Document.Selection.AddSelectionStart(textRange.StartPosition);
        this.radRichTextBox1.Document.Selection.AddSelectionEnd(textRange.EndPosition);
        this.radRichTextBox1.ChangeTextHighlightColor(Color.Red);
    }
}

I'd like to know how to get the line number of the textRange found and the entire text of the line that contains textRange.

Tommaso
Tommaso
Top achievements
Rank 1
 answered on 19 Oct 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
Documentation
SplitContainer
Map
DesktopAlert
CheckedDropDownList
ProgressBar
TrackBar
MessageBox
Rotator
SpinEditor
CheckedListBox
StatusStrip
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
CollapsiblePanel
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
GroupBox
WaitingBar
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
FileDialogs
ColorDialog
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
Styling
Barcode
PopupEditor
RibbonForm
TaskBoard
Callout
NavigationView
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
BreadCrumb
ButtonTextBox
FontDropDownList
BarcodeView
Security
LocalizationProvider
Dictionary
SplashScreen
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?