Telerik Forums
UI for WinForms Forum
3 answers
183 views
I'm getting an error when I try to access a grid cell value, which has no value. I tried using the trycast function, but that didn't work.  Here is my code below.   When the code runs and there's a value the message box show without problem, but if there's no value in the cell I get an error (see attached file).   The grid is loaded from the a sub call (see below)  Need to know how to handle this situation.

Thanks,
Tom

  Private Sub grdIssued_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles grdIssued.Click
        Dim i As Integer

        If grdIssued.SelectedRows.Count > 0 Then
            '   Dim ReturnDate As String = TryCast(Me.grdIssued.Rows(Me.grdIssued.CurrentRow.Index).Cells(5).Value, String)
            MsgBox(Me.grdIssued.Rows(Me.grdIssued.CurrentRow.Index).Cells(5).Value)
        End If
        i = grdIssued.CurrentRow.Index
        clsPPE.PPEID = grdIssued.Rows(i).Cells(0).Value
    End Sub

  Private Sub LoadPPEIssuedGrid()
        Dim da As SqlDataAdapter
        Dim dt As New DataTable

        clsPPE.SelectedMemberID = Me.cboMember.SelectedValue
        da = clsPPE.GetPPEIssuedByMemberID
        da.Fill(dt)
        Me.grdIssued.DataSource = dt
        Me.grdIssued.Columns(0).IsVisible = False
        Me.grdIssued.Columns(1).Width = 100
        Me.grdIssued.Columns(2).Width = 100
        Me.grdIssued.Columns(3).Width = 100
        Me.grdIssued.Columns(4).Width = 90
        Me.grdIssued.Columns(4).FormatString = "{0: M/d/yyyy}"
        Me.grdIssued.Columns(5).Width = 90
        Me.grdIssued.Columns(5).FormatString = "{0: M/d/yyyy}"
        Me.grdIssued.CurrentRow = Nothing

    End Sub
Richard Slade
Top achievements
Rank 2
 answered on 16 Feb 2011
2 answers
102 views
Hello,

Recently I needed to hide the column that represents the slider's records RadGridView (leftmost column of the GridView) to all appearances, it was enough to indicate "AllowColumnChooser" as "false ".

But even setting the value of "AllowColumnChooser" as "false", the selector of records continued to appear.

I also realized through the method attempts ".HideColumnChooser()" and neither worked.

Finally I found it was necessary to set the property value "ShowRowHeaderColumn" to "false" to get the picker does not display records.

Questions:
1. What is the purpose of property "AllowColumnChooser" and method ".HideColumnChooser()"?
2. What is the explanation for me to use the property "ShowRowHeaderColumn" and the result is to hide the column chooser?

Control and Package Version:
* RadGridView
* Telerik WinForms VSExtensions 2010.03.1214.0
* Telerik RadControls for WinForms
Richard Slade
Top achievements
Rank 2
 answered on 16 Feb 2011
4 answers
109 views

Hello! I have following code:

this.systemPointsGridView.MasterTemplate.DataSource = this.systemTableBindingSource;
...
this.systemTableBindingSource.DataMember = "SystemTable";
this.systemTableBindingSource.DataSource = this.projectDataSet;
...

projectDataSet is filling somewhere and then in order the results to be displayed
I have to write:
systemTableBindingSource.DataSource = projectDataSet;

So, the question is why do I have to reassign dataset to BindingSource datasource property? I suppose that it should be done automatically, or there should be method that I must call on binding source in order to populate control with data.

It seems that I missed something in databinding mechanism...

Thanks in advance.

Richard Slade
Top achievements
Rank 2
 answered on 16 Feb 2011
8 answers
181 views
Hi, I was wondering if I could add a new button to the footer of a RadCalendar?
Ivan Todorov
Telerik team
 answered on 16 Feb 2011
4 answers
302 views
Hi,

I want to use RadListControl to display the logs of the ongoing large process in background thread. I will be adding hundred thousands of items into the control in main thread.

But to make everything simple, before adding item to the control, I am checking if the item count is more than 100, if it is more than 100 I am removing the top most Item, then only I am adding the new item. After adding I am scrolling the listbox control down to the last item.

This process may run for more than 10 hrs and my application may not respond as it is dealing with too much of items every seconds.

I am looking for most efficeint way to do this as with listboxcontrol after running for about 1 hr application is not able to handle the number of items and not responding.

I am using following code: 

            RadListDataItem newItem = new RadListDataItem(message);
            radListControl1.Items.Add(newItem);
            if (radListControl1.Items.Count > 100)
            {
                radListControl1.Items.RemoveAt(0);              
            }           
            radListControl1.ScrollToItem(newItem);

But if I am using windows listboxcontrol I am able to do without any problem.

            listBox1.Items.Add(message);

            if (listBox1.Items.Count > 100)
            {
                listBox1.Items.RemoveAt(0);               
            }
            listBox1.SelectedIndex = listBox1.Items.Count - 1;
            listBox1.ClearSelected();   

I want to use RadListControl because it can handle html syntax.

Please suggest something on this. I can even switch to another control which supports html code.

regards,

Bibek Dawadi

Ivan Petrov
Telerik team
 answered on 16 Feb 2011
3 answers
211 views
I have a grid with a custom filter, like the sample in Gridview Custom filtering. How can I select the first row in the grid after the custom filter is applied?

I've tried this code, but didn't work:

Private Sub txtBuscar_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtBuscar.TextChanged
        wFirstVisibleRow = -1
        Me.gridArticulos.MasterTemplate.Refresh()
        If wFirstVisibleRow > 0 Then
            Dim wposcode As String = gridArticulos.MasterTemplate.Rows(wFirstVisibleRow).Cells(0).Value.ToString
            If wposcode <> "" Then
                Me.ArticulosSGFBindingSource.Position = Me.ArticulosSGFBindingSource.Find("CODIGO", wposcode)
            End If
        End If
  
    End Sub
  
Private Sub gridArticulos_CustomFiltering(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.GridViewCustomFilteringEventArgs) Handles gridArticulos.CustomFiltering
        If String.IsNullOrEmpty(Me.txtBuscar.Text) Then
            e.Visible = True
            For i As Integer = 0 To Me.gridArticulos.ColumnCount - 1
                e.Row.Cells(i).Style.Reset()
                e.Row.InvalidateRow()
            Next
            Return
        End If
        e.Visible = False
        For i As Integer = 0 To Me.gridArticulos.ColumnCount - 1
            If i <> 2 Then
                Dim text As String = e.Row.Cells(i).Value.ToString()
                If text.IndexOf(Me.txtBuscar.Text, 0, StringComparison.InvariantCultureIgnoreCase) >= 0 Then
                    e.Visible = True
                    If wFirstVisibleRow = -1 Then
                        wFirstVisibleRow = e.Row.Index
                    End If
                    e.Row.Cells(i).Style.CustomizeFill = True
                    e.Row.Cells(i).Style.DrawFill = True
                    e.Row.Cells(i).Style.BackColor = Color.FromArgb(201, 252, 254)
  
                Else
                    e.Row.Cells(i).Style.Reset()
                    e.Row.InvalidateRow()
                End If
            End If
  
        Next
  
    End Sub

Thanks in advance
Richard Slade
Top achievements
Rank 2
 answered on 16 Feb 2011
8 answers
395 views
Hello,

I was hoping someone could shed some light on this situation.

I have a RadPageView with a RadListControl inside.  The list control is populated from a sql table that contains potential 'status' setting for a recordset that is filling a RadGridView also on the same page.  I have the list control MultiSelect set to 'Simple'. The idea is a fast, multi-select filter for the radgrid.

So as with most issues, 90% works great.  Using RadListControl1.SelectedIndexChanged as my event handler I am able to create a filter for the radgrid using OR to allow filtering for multiple status at one time.   If the user clicks status 'a' then status 'b' then status 'c' the Radgrid filters and only shows 'A',then adds 'B',then 'C'.  Perfect! (status LIKE 'A' or status LIKE 'B' or status LIKE 'C' is  the expression I end up with, again perfect)

Here is where is problem lies.  When a user un-selects items in the RadListControl in reverse order (Add, A,B,C then Remove C,B,A) things seem to work, the event handler fires properly.  However, if the user un-selects items in any other order the event wont fire (Add A,B,C  then unselect A,B,C).  I'm guessing this is by design.  Although I have a loop with a message box showing the RadLIstControl items each time the event fires (for debugging).  I don't know if this might have some unseen effect on the control.

So I am wondering, is there a solution for this situation, either using the RadListControl (it's fast) or would there be a better method, I just can't seem to get my head around this one.  My code is in VB if that matters.

Thanks in advance!

Dean.

Richard Slade
Top achievements
Rank 2
 answered on 16 Feb 2011
10 answers
690 views
I'm trying to reload all the items in a RadDropDown box after something new gets added to the database. I have it set up right now that an event gets triggered when an item is added into the database, it calls the Rebind() method on the RadDropDownList, but nothing seems to happening. What should I do to get the RadDropDownList to reload?
Kamal
Top achievements
Rank 1
 answered on 16 Feb 2011
5 answers
228 views
Hello
    I have  a  question about  focus on control  TextBox, DropDownList etc.
How is the best solution for highlight control when got focus? Focus primitive, maybe some themes support this functionallity?

Please some example for solution. 

Thanks so much.
Richard Slade
Top achievements
Rank 2
 answered on 15 Feb 2011
1 answer
460 views
Hi There,

I am using Rad Ribbon bar and have a dropdownbutton that I am dynamically creating the items for from a dataset. My problem is I can not seem to create an event handler for the selection as it appears that item.click does not seem to exist. here is my code:

For Each row As DataRow In ds_sn.Tables("sn_tbl_groups").Rows
    Dim tag As New radmenuitem(row(1).ToString)
    tag.CheckOnClick = New EventHandler(AddressOf GroupMenuclick)
    Me.btn_SpecificGroup.Items.Add(tag)
Next

can some one point me to what event i should see in order to create the handler for this?

many thanks!

Jonathan
Richard Slade
Top achievements
Rank 2
 answered on 15 Feb 2011
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)
Chart (obsolete as of Q1 2013)
Form
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
Diagram, DiagramRibbonBar, DiagramToolBox
GanttView
Panorama
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
VirtualGrid
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
CheckedDropDownList
ProgressBar
TrackBar
MessageBox
Rotator
SpinEditor
StatusStrip
CheckedListBox
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
Conversational UI, Chat
DateTimePicker
CollapsiblePanel
TabbedForm
CAB Enabling Kit
GroupBox
DataEntry
ScrollablePanel
ScrollBar
WaitingBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Barcode
Callout
ColorBox
PictureBox
FilterView
Accessibility
NavigationView
VirtualKeyboard
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
Licensing
BarcodeView
BreadCrumb
Security
LocalizationProvider
Dictionary
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
ToolbarForm
NotifyIcon
DateOnlyPicker
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?