Telerik Forums
UI for WinForms Forum
2 answers
265 views
What is the proper way to remove a row and set the previous row as active(if # of rows > 0) on a sorted and/or filtered and/or grouped radGridView?
I populate my radGridView manually with a stored procedure.
The first column in the rGV is a button column when the user presses the button the row should be removed and the previous row set as active/current.
I had this working perfectly when using the DataGridView included with VS2012 but now I'm getting an IndexOutOfRangeException thrown.

 

Private Sub DataGridView4_CellContentClick(ByVal sender As System.Object, ByVal e As Telerik.WinControls.UI.GridViewCellEventArgs) Handles DataGridView4.CellClick
    If e.ColumnIndex = 0 Then
        intDataGridSelectedIndexRenewalC = DataGridView4.CurrentRow.Index
        If sps_EIPHasBeenBilled(DataGridView4.CurrentRow.Cells("Policy_no").Value.ToString) Then
            RenewalsCommercialMarkComplete()
        Else
            MsgBox("Unable to Mark This Policy as Complete! " & DataGridView4.CurrentRow.Cells("Policy_no").Value.ToString & " Has Not been Billed Yet.", vbOKOnly)
        End If
    End If
End Sub
 
Private Sub RenewalsCommercialMarkComplete()
    Dim UpdateStatus As Boolean
    Dim SQLQuery As String = "exec " & strDefaultDatabase & ".dbo.spu_EIPRenewalMarkCompleteByRenewalID '" & DataGridView4.CurrentRow.Cells("RenewalsID").Value & "', '" & strLoggedInUserFullName & "'"
 
    If MsgBox("Do you wish to mark this record: " & DataGridView4.CurrentRow.Cells("Customer").Value.ToString & ": " & DataGridView4.CurrentRow.Cells("Policy_no").Value.ToString & " as complete?", vbYesNo + vbQuestion, "Renewal Mark Complete") = vbYes Then
        UpdateStatus = WriteSQL_Data(SQLQuery)
        If UpdateStatus Then
            MsgBox("Record: " & DataGridView4.CurrentRow.Cells("Policy_no").Value.ToString & " Marked As Complete!", MsgBoxStyle.OkOnly)
            DataGridView4.ChildRows(intDataGridSelectedIndexRenewalC).Delete()
            If (intDataGridSelectedIndexRenewalC - 1) > 0 Then
                DataGridView4.ChildRows(intDataGridSelectedIndexRenewalC - 1).IsSelected = True
                DataGridView4.ChildRows(intDataGridSelectedIndexRenewalC - 1).IsCurrent = True
            End If
        Else
            MsgBox("Unable to Connect to Database Please see your System Administrator with Error: Summary - ButtonOk_Click: ", vbOK)
        End If
    Else
        MsgBox("The Operation was Cancelled", vbOKOnly)
    End If
End Sub
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 21 Oct 2013
1 answer
1.3K+ views

I have a problem with formatting numbers with Telerik controls (version Q3 2012).

Requirements are
 - formatting similar to ###,###,##0.00## (limiting number of decimals and also number of digits on the left of decimal point) must be supported.
 - formatting mask must be invisible so with mask ###,###,##0.00## text should be only 0.00 and not ___,___,__0.00__.

I have tried to implement this scenario with MaskedEditBox and Textbox but 
 - in MaskedEditBox i could not hide the mask
 - TextBox does not have any formatting options

Is such scenario supported with Telerik controls?
Dimitar
Telerik team
 answered on 20 Oct 2013
2 answers
147 views
Hi,

i am trying to build an editable TreeView:

if selectedNade change the current selected value goes to a radtextbox:

private void radTreeView1_SelectedNodeChanged(object sender, Telerik.WinControls.UI.RadTreeViewEventArgs e)
        {
                TestItem item = radTreeView1.SelectedNode.DataBoundItem as TestItem;
                if (item != null)
                {
                    radTextBox1.Text = item.Name;
                    radTextBox1.Enabled = true;
                }
        }

on KeyUp Event i store the value back:

private void radTextBox1_KeyUp(object sender, KeyEventArgs e)
{
    if (radTreeView1.SelectedNode != null)
    {
        TestItem item = radTreeView1.SelectedNode.DataBoundItem as TestItem;
        if (item != null)
        {
            item.Name = radTextBox1.Text;
        }
    }
}

this doesn't work immediately, but if i click on another node then the last node updates correctly. i tried refresh(), update() and implementing INotifyPropertyChanged, but nothing worked

is live updateing possible?

greetings
jed
Top achievements
Rank 1
 answered on 19 Oct 2013
10 answers
214 views
I noticed that even though you set the Auto tooltips to True on the RadDropDownButton it has no effect - no tooltip gets displayed - and yes the Text value is set :)
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 18 Oct 2013
12 answers
627 views
Hi,

I need help with one problem. I got databound ListView on windows form.
One of the columns in bound data is of DateTime type.
How do I display it in format dd/MM/yyyy (without time).
I can return date from database as already formated string but then sorting on this column
works on string value not DateTime.
I can't find way around it. Any help would be greatly appreciated.

Thanks
Chris
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 18 Oct 2013
1 answer
126 views
Two tables in my database are: Regions and Carriers.
In the Carriers table, there is a field called "Regions".

That 'regions' field will be a GridViewComboBox that should get it's values from a "name" field in the Carriers table.

How would I do this?
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 17 Oct 2013
1 answer
230 views
If I take a tab strip (like the one in Examples/TabbedDocument) and add the following code in order to only allow dragging the documents within the tab strip they are a part of:

radDock1.GetService<DragDropService>().Starting += (sender, args) =>
{
    if ((sender as DragDropService).DragDropContext == DragDropContext.DocumentWindow)
    {
        args.Cancel = true;
    }
};

Then when dragging the cursor does weird things. If I start dragging, it shows the red circle (because I can't drop the document on itself). And if the cursor stays within the tab strip, everything is fine. But if I drag down so I'm hovering over one of the documents themselves, the cursor reverts to a simple pointer, even though I'm still dragging. Ideally, it would remain as a red circle, or if I had first hovered over a different tab, changing the cursor to the valid drop cursor, it should switch back to a red circle.

If I then return to the document tab strip (still dragging), the cursor will come back when I hover over the original document tab being dragged, but not any of the others.
George
Telerik team
 answered on 17 Oct 2013
0 answers
155 views
I added a combobox to my grid via the following method
   GridViewComboBoxColumn cboreason = new GridViewComboBoxColumn("Reasons");
               
               cboreason.DataSource = pamsContext.GetGrievancesReasons();
               cboreason.FieldName = "reason";
               cboreason.DisplayMember = "Value";
               cboreason.ValueMember = "Key";
               cboreason.Width = 100;
               grvGrievances.Columns.Add(cboreason);
               grvGrievances.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
     

 I have a details changed to track the dirty state of my form which i normally attach via 
  txtReportedTo.SelectedValueChanged+= DetailsChanged;
             

How do i do this with the above ???? As dont see the usual SelectedValueChanged method to call ??
Dave
Top achievements
Rank 1
 asked on 17 Oct 2013
7 answers
191 views
How do I get a context menu to show up for a childtemplate in a radgridview?
Thx.
Craig
Stefan
Telerik team
 answered on 17 Oct 2013
1 answer
245 views
HI

I need to have a close button on some tab of my PageView, but not all.

How should i proceed ?


Thank
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 17 Oct 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
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
Wizard
CollapsiblePanel
LayoutControl
ShapedForm
SyntaxEditor
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?