Telerik Forums
UI for WinForms Forum
1 answer
204 views
I have a GridView that I populate manually using OpenFileDialog...

        Dim fname As String = ""

        If (dlgImportClients.ShowDialog() = Windows.Forms.DialogResult.OK) Then
            fname = dlgImportClients.FileName
        End If

        Dim TextLine As String = ""
        Dim SplitLine() As String

        If System.IO.File.Exists(fname) = True Then
            Dim objReader As New System.IO.StreamReader(fname)

            Do While objReader.Peek() <> -1
                TextLine = objReader.ReadLine()

                'need to add false for checkbox column
                TextLine = "False," + TextLine

                SplitLine = Split(TextLine, ",")

                dgvClients.ColumnCount = SplitLine.Count
                dgvClients.MasterGridViewTemplate.AllowAddNewRow = False
                dgvClients.ReadOnly = False
                dgvClients.Columns(0).IsVisible = True

                'if .RowCount = 0 then we are processing the first row
                If dgvClients.RowCount = 0 Then
                    For i = 1 To SplitLine.Count - 1
                        With dgvClients
                            .Columns(i).HeaderText = SplitLine(i).ToString
                            .Columns(i).BestFit()
                        End With
                    Next
                End If
                dgvClients.Rows.Add(SplitLine)
            Loop

            'stupid but the only way I could get the datagridview to populate correctly
            If dgvClients.RowCount > 1 Then
                dgvClients.Rows.RemoveAt(0)
            End If
        Else
            RadMessageBox.SetThemeName("Breeze")
            RadMessageBox.Show("File Does Not Exist")
        End If

I am loading the .CSV file to the GridView so that it can be reviewed, cleaned up, and then imported into Clients table within the customers database.

I'm kinda stumped as to the best way to get the data in the GridView into the database. Could just be a brain fart or I may be going about this totally wrong. Any insight would be greatly appreciated.

Victor
Telerik team
 answered on 08 Jun 2009
3 answers
342 views
Hi, I have a question...
I'm using ADO Entity FrameWork and displays information in a GridView, all filters work correctly...
When I get the information with the Entity Framework, I put a top... I mean, if i have 50 records in a table, only I get 20.
Code:
var table = Context.Table.Top(20);
GridView1.DataSource = table;

I want to do is put other filter options (custom filter) in the menu of filters to obtain the others 30 records. I mean, how can I put other options in the menu filter and specify my own code to make another type of filter?

because The default filters only filter the records displayed.

my apologies for my english I hope to have explained..
Thanks!!
erwin
Top achievements
Rank 1
Veteran
Iron
 answered on 05 Jun 2009
3 answers
208 views
Hi!

I have got a datetimepicker (the textbox) with a theme created by me. I have also got a calendar with a theme created by me.

I want to use this calendar with the datetimepicker.

At the moment I have the datetimepicker and when I click on its box appears the default calendar theme and I would like to appear my one I have mentioned before.

How can I do this?because as far as I know with visual style builder when I try to make changes in the datetimepicker properties is not possible to change the calendar which is joined to it.

I hope you have understood what I want to get.

Thank you in advance.
Nikolay
Telerik team
 answered on 05 Jun 2009
1 answer
108 views

After upgrading my project Q1 2009 SP1 when I bring up the designeer I receive all kinds of errors about no such property registered for various rad controls (such as RadButton, RadScrollBarElement, etc.)

The project will compile and run howerver.  What can I do to correct this.
Nikolay
Telerik team
 answered on 05 Jun 2009
11 answers
1.0K+ views
I've looked around, but I can't seem to find either a text property to change the text, or a property to just hide the auto-created "Click here to add new row" Row in an empty GridView.

I'm using a RadGridView control to display data that comes from a hand held scanner and is created on the fly.  Because of this, I have no data source for the grid, I just define the columns and use AddRow() to display my data. The grid also allows editing of the data in the gird before saving.

Is there a way to turn this off?


Nick
Telerik team
 answered on 05 Jun 2009
3 answers
218 views
I'm trying to evaluate Telerik WinForm controls for our organisation with potential for large license purchase.

I've created a simple Form which inherits from RadForm and added a RadRibbonBar. I need to hide the RadForm title so that the ribbon bar appears correctly, however when I maximize the Form the RadForm menu reappears incorrectly at the very top of the screen, showing only half of the title bar (it should be invisible). I've tried using the RadRibbonForm template with the same results. I've tried searching the forums but without much success. This looks like a bug! Any suggestions?

Eric


Environment:
Visual Studio 2008 / NET 3.5
o/s: Windows Vista
Deyan
Telerik team
 answered on 05 Jun 2009
15 answers
260 views

I previously had Q3 2008 installed updated to Q1 2009 and now the save/load layout do not work. Actually the save works and creates the layout file but the load has no effect. Work fine before the update. Also noticed the demo only has a Save button, no Load button....

 

Can someone confirm that the load layout is broken or if I need to keep diggin..

Nick
Telerik team
 answered on 05 Jun 2009
1 answer
271 views
Hello,

I keep getting this "error" in my log files:

4/06/2009 15:19:52: <<WARNING>> Column count: 4.
4/06/2009 15:19:52: <<WARNING>> NetworkManager.cs -> clear telerik columns:    at Telerik.WinControls.UI.TableViewDefinition.Measure(GridRowElement row, SizeF availableSize)
   at Telerik.WinControls.UI.GridTableElement.ArrangeOverride(SizeF finalSize)
   at Telerik.WinControls.RadElement.ArrangeCore(RectangleF finalRect)
   at Telerik.WinControls.RadElement.Arrange(RectangleF finalRect)
   at Telerik.WinControls.Layouts.ContextLayoutManager.UpdateLayout()
   at Telerik.WinControls.RadElement.UpdateLayout()
   at Telerik.WinControls.ComponentLayoutElementTree.GetPreferredSize(Size sizeConstraints)
   at Telerik.WinControls.RadControl.GetPreferredSize(Size proposedSize)
   at System.Windows.Forms.Layout.DefaultLayout.LayoutAutoSizedControls(IArrangedElement container)
   at System.Windows.Forms.Layout.DefaultLayout.xLayout(IArrangedElement container, Boolean measureOnly, Size& preferredSize)
   at System.Windows.Forms.Layout.DefaultLayout.LayoutCore(IArrangedElement container, LayoutEventArgs args)
   at System.Windows.Forms.Layout.LayoutEngine.Layout(Object container, LayoutEventArgs layoutEventArgs)
   at System.Windows.Forms.Control.OnLayout(LayoutEventArgs levent)
   at System.Windows.Forms.ScrollableControl.OnLayout(LayoutEventArgs levent)
   at System.Windows.Forms.Control.PerformLayout(LayoutEventArgs args)
   at System.Windows.Forms.Control.System.Windows.Forms.Layout.IArrangedElement.PerformLayout(IArrangedElement affectedElement, String affectedProperty)
   at System.Windows.Forms.Layout.LayoutTransaction.DoLayout(IArrangedElement elementToLayout, IArrangedElement elementCausingLayout, String property)
   at System.Windows.Forms.Control.PerformLayout(LayoutEventArgs args)
   at System.Windows.Forms.Control.System.Windows.Forms.Layout.IArrangedElement.PerformLayout(IArrangedElement affectedElement, String affectedProperty)
   at System.Windows.Forms.Layout.LayoutTransaction.DoLayout(IArrangedElement elementToLayout, IArrangedElement elementCausingLayout, String property)
   at System.Windows.Forms.Control.ControlCollection.Remove(Control value)
   at Telerik.WinControls.RadHostItem.PerformRoutedEventAction(RadElement sender, RoutedEventArgs args)
   at Telerik.WinControls.RadHostItem.OnTunnelEvent(RadElement sender, RoutedEventArgs args)
   at Telerik.WinControls.UI.RadTextBoxItem.OnTunnelEvent(RadElement sender, RoutedEventArgs args)
   at Telerik.WinControls.RadElement.RaiseTunnelEvent(RadElement sender, RoutedEventArgs args)
   at Telerik.WinControls.RadElement.SetParent(RadElement parent)
   at Telerik.WinControls.RadElement.ChangeCollection(RadElement child, ItemsChangeOperation changeOperation)
   at Telerik.WinControls.RadElementCollection.OnClear()
   at System.Collections.CollectionBase.Clear()
   at Telerik.WinControls.UI.GridRowElement.DisposeChildren(RadElementCollection children)
   at Telerik.WinControls.UI.GridRowElement.DisposeChildren(RadElementCollection children)
   at Telerik.WinControls.UI.GridRowElement.DisposeChildren(RadElementCollection children)
   at Telerik.WinControls.UI.GridRowElement.DisposeChildren(RadElementCollection children)
   at Telerik.WinControls.UI.GridRowElement.DisposeChildren(RadElementCollection children)
   at Telerik.WinControls.UI.GridRowElement.Dispose(Boolean disposing)
   at Telerik.WinControls.UI.GridTableHeaderRowElement.Dispose(Boolean disposing)
   at Telerik.WinControls.RadComponentElement.Dispose()
   at Telerik.WinControls.RadElement.Cleanup()
   at Telerik.WinControls.UI.GridTableBodyElement.CleanupRows()
   at Telerik.WinControls.UI.GridTableElement.Update(GridUINotifyAction action, GridViewRowInfo[] rowInfos)
   at Telerik.WinControls.UI.GridViewTemplate.UpdateUI(GridUINotifyAction action, GridViewRowInfo[] rowInfos)
   at Telerik.WinControls.Data.DataAccessComponent.ResetGrid()
   at Telerik.WinControls.Data.DataAccessComponent.UpdateColumns(NotifyCollectionChangedEventArgs e)
   at Telerik.WinControls.UI.GridViewTemplate.UpdateColumns(NotifyCollectionChangedEventArgs e)
   at Telerik.WinControls.UI.GridViewColumnCollection.NotifyListenersCollectionChanged(NotifyCollectionChangedEventArgs e)
   at Telerik.WinControls.Data.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at Telerik.WinControls.Data.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedAction action, Object item, Int32 index)
   at Telerik.WinControls.Data.ObservableCollection`1.RemoveItem(Int32 index)
   at Telerik.WinControls.Data.ItemObservableCollection`1.RemoveItem(Int32 index)
   at Telerik.WinControls.UI.GridViewColumnCollection.RemoveItem(Int32 index)
   at System.Collections.ObjectModel.Collection`1.RemoveAt(Int32 index)
   at adlogix.Views.NetworkManager.clearAdservedItemsColumns() in D:\networkManager\adlogix-views\Views\NetworkManager.cs:line 452, Object reference not set to an instance of an object..

the program doesn't crash, its just on this piece of code that I get the error message:

            if (rgvAllItems.MasterGridViewTemplate.Columns.Count > 0)  
            { 
                Log.LogMessageToFileWarnings("Column count: " + rgvAllItems.MasterGridViewTemplate.Columns.Count); 
                try  
                {  
                    while(rgvAllItems.MasterGridViewTemplate.Columns.Count > 0)  
                    {  
                        rgvAllItems.MasterGridViewTemplate.Columns.RemoveAt(0);  
                    }  
                      
                }catch(Exception ex)  
                {  
                    Log.LogMessageToFileWarnings(String.Format("NetworkManager.cs -> clear telerik columns: {0}, {1}", ex.StackTrace, ex.Message));  
                }  
            }  

before the while loop wasn't there and only existed with one line of code : rgvAllItems.MasterGridViewTemplate.Columns.Clear();

after some advice here on the forum to change it with the while loop I still got the same error message.
Strange thing is that the count of the columns is greater as zero so this should be giving any problems?

got the same message with this piece of code:
           
            if (rgvAllItems.MasterGridViewTemplate.ChildGridViewTemplates.Count > 0) 
            {
               
                try 
                { 
                    while (rgvAllItems.MasterGridViewTemplate.ChildGridViewTemplates.Count > 0) 
                    { 
                        rgvAllItems.MasterGridViewTemplate.ChildGridViewTemplates.RemoveAt(0); 
                    } 
                }catch (Exception ex) 
                { 
                    Log.LogMessageToFileWarnings( 
                        String.Format("NetworkManager.cs -> clear telerik ChildGridViewTemplates: {0}, {1}", 
                                      ex.StackTrace, ex.Message)); 
                } 
            } 

just clearing the gridview for a rebind of other data, which is done without a problem. But I'm getting these errors in my log file on regular basis. So I'm curious what is happening since I have no idea If I'm doing something wrong here or not.

thanks in advanced





Jack
Telerik team
 answered on 05 Jun 2009
1 answer
161 views
Hello,

In my hierarchy gridview I have a columncombobox in my heading of my grid. So when I select a value in the combobox it is set to the hole structure of my grid.
Now I was wondering and I added it, that if I select more then one row and select a value of the combobox the value is being set only to the selected items in my grid.

All goes well until I selected an item to much. I wanted to deselect it, but that doesn't work. I need to select an item that isn't select.
But now all items are unselected except of one item. I searched on how I should handle this. but I didn't find it.

thanks in advanced
Jack
Telerik team
 answered on 05 Jun 2009
1 answer
192 views

Hi

How do I clear previously created conditional formatting items from the ConditionalFormattingObject

Which were created using:

Dim con1 As ConditionalFormattingObject = New ConditionalFormattingObject("white rule", ConditionTypes.Contains, Me.RadTextBox1.Text.ToLower, Me.RadTextBox1.Text.ToLower, True)

            c1.RowBackColor = Color.Green

            RadGridView1.MasterGridViewTemplate.Columns.FindByDataField("Country").ConditionalFormattingObjectList.Add(c1)

Thanks

Joe

Boryana
Telerik team
 answered on 05 Jun 2009
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
PdfViewer and PdfViewerNavigator
CommandBar
ListControl
Carousel
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
VirtualGrid
Toolstrip (obsolete as of Q3 2010)
Label
AutoCompleteBox
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
SplitContainer
Documentation
Map
DesktopAlert
CheckedDropDownList
ProgressBar
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
SyntaxEditor
Wizard
CollapsiblePanel
LayoutControl
ShapedForm
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
SmartPasteButton
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?