Telerik Forums
UI for WinForms Forum
2 answers
73 views

In my code, i want to add many items in radlistview and then save to sql server table in windows forms app. Here below is my code, but this code isnt working as radlistview does not contain definition for text

The ones i have lebelled in green color. 

Note: This code normally works with normal windows list view control, but i want to use radlistview to implement the same.


    if(ListView1.Items.Count == 0)
    {
        ListViewItem lst = new ListViewItem(txtCustomer.Text);
        lst.SubItems.Add(txtPhone.Text);
        lst.SubItems.Add(txtAddress.Text);
        lst.SubItems.Add(txtLoadNo.Text);
        lst.SubItems.Add(txtDriver.Text);
        lst.SubItems.Add(txtDriverPhone.Text);
        lst.SubItems.Add(txtHauler.Text);
        lst.SubItems.Add(txtPlateNo.Text);
        lst.SubItems.Add(txtProduct.Text);
        lst.SubItems.Add(txtDescription.Text);
        lst.SubItems.Add(txtQty.Text);
        lst.SubItems.Add(txtDate.Text);
        ListView1.Items.Add(lst);


        txtProduct.Text = "";
        txtDescription.Text = "";
        txtQty.Text = "";

        return;
    }

    for(int j = 0; j <= ListView1.Items.Count - 1; j++)
    {
        if(ListView1.Items[j].SubItems[1].Text == txtCustomer.Text)
        {
            ListView1.Items[j].SubItems[1].Text = txtCustomer.Text;
            ListView1.Items[j].SubItems[2].Text = txtPhone.Text;
            ListView1.Items[j].SubItems[3].Text = txtAddress.Text;
            ListView1.Items[j].SubItems[4].Text = txtLoadNo.Text;
            ListView1.Items[j].SubItems[5].Text = txtDriver.Text;
            ListView1.Items[j].SubItems[6].Text = txtDriverPhone.Text;
            ListView1.Items[j].SubItems[7].Text = txtHauler.Text;
            ListView1.Items[j].SubItems[8].Text = txtPlateNo.Text;
            ListView1.Items[j].SubItems[9].Text = txtProduct.Text;
            ListView1.Items[j].SubItems[10].Text = txtDescription.Text;
            ListView1.Items[j].SubItems[11].Text = txtQty.Text;
            ListView1.Items[j].SubItems[12].Text = txtDate.Text;


            txtProduct.Text = "";
            txtDescription.Text = "";
            txtQty.Text = "";

            return;
        }
    }

    ListViewItem lst1 = new ListViewItem(txtCustomer.Text);
    lst1.SubItems.Add(txtPhone.Text);
    lst1.SubItems.Add(txtAddress.Text);
    lst1.SubItems.Add(txtLoadNo.Text);
    lst1.SubItems.Add(txtDriver.Text);
    lst1.SubItems.Add(txtDriverPhone.Text);
    lst1.SubItems.Add(txtHauler.Text);
    lst1.SubItems.Add(txtPlateNo.Text);
    lst1.SubItems.Add(txtProduct.Text);
    lst1.SubItems.Add(txtDescription.Text);
    lst1.SubItems.Add(txtQty.Text);
    lst1.SubItems.Add(txtDate.Text);
    ListView1.Items.Add(lst1);

    txtProduct.Text = "";
    txtDescription.Text = "";
    txtQty.Text = "";
} catch(Exception ex)
{
    MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}

Nadya | Tech Support Engineer
Telerik team
 answered on 15 Sep 2023
1 answer
62 views

I'm trying to intercept the Open and Save As Buttons for special handling

I have tried

AddHandler RadPdfViewerNavigator1.CommandBarElement.Rows(0).Strips(0).MouseDown, AddressOf OpenButton_MouseDown

But the addressof sub never gets hit.

Also, when I try to get to the Save As button with the following code; it throws an error.  So, I'm approaching this the wrong way I guess.

AddHandler RadPdfViewerNavigator1.CommandBarElement.Rows(0).Strips(1).MouseDown, AddressOf SaveButton_MouseDown

After searching the forums, I'm not seeing any way to do this (so, I must be missing something).

Can you please tell me how to intercept these buttons?

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 14 Sep 2023
1 answer
67 views

Hello!

I *LOVE* your PDF Viewer - wish I'd found this a few years back!  I only wish it had TIFF support but that's for another time.

My users deal with large documents and having the Thumbnails is a nice navigation element.

They are NOT allowed to make bookmarks and for the life of me I can't figure out how to hide the Thumbnail menu button "Bookmarks"

In a perfect world, I'd like to hide that menu that sits directly above the thumbnail images entirely (two buttons.  Left Button when clicked shows the Thumbnails.  Right button when clicked shows Bookmarks.

How do I hide this menu OR if no way to hide it, how do i hide that "Bookmarks" button?

 

Cheers!

-c

 

 

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 13 Sep 2023
1 answer
85 views
When using RadSpreadsheet how do I get filename that was loaded when user uses File Open?
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 13 Sep 2023
2 answers
167 views

This is a follow-up to my question from last week re a data-driven property grid.

1. Is there any way to remove the white space to the left?

2. In the (abbreviated) code below, I am able to set the ForeColor of the text description but If I try the BackColor, nothing happens. Perhaps a bug?

private void propDataDriven_ItemFormatting(object sender, PropertyGridItemFormattingEventArgs e)
{
    PropertyGridItemElement el = e.VisualElement as PropertyGridItemElement;

    el.TextElement.ForeColor = Color.Red; //works fine

    el.TextElement.BackColor = Color.Green; //does nothing
}

 

3. Looking at the date entry, I turned off the context menu but the vertical ellipsis still appears when I click in the cell. Nothing happens when I click on this though. is this intended behavior? I'd rather not see it at all.

Thanks

Carl

Nadya | Tech Support Engineer
Telerik team
 answered on 13 Sep 2023
1 answer
51 views

I'm capturing the event below

    Private Sub RadRichTextEditor1_CommandExecuting(sender As Object, e As Telerik.WinForms.Documents.RichTextBoxCommands.CommandExecutingEventArgs) Handles RadRichTextEditor1.CommandExecuting
        If TypeOf e.Command Is SaveCommand Then
            If e.CommandParameter = "pdf" Then
                'allow export to pdf
            Else
                e.Cancel = True

          End If
       End If

    End Sub

I was hoping to find

 If TypeOf e.Command Is SaveASCommand - but from what I can see, that doesn't exist.

The problem is - if the user clicks the Save Button or BackStage Save - I'm doing special processing to the database.

But if they click on Save As - It indicates that the user wants to 'export' the document to a pdf or to a word .docx

But in both cases - e.command is always SaveCommand.

It would have been nice to have a (1) SaveCommand and (2) SaveAsCommand

Anyway, is there any event that I can tap into so that these 2 methods can be dealt with differently?

I did add a handler for the SaveButton itself... and that works just fine.

AddHandler RichTextEditorRibbonBar1.QuickAccessToolBarItems(0).MouseDown, AddressOf SaveButton_MouseDown

Maybe you can show me how to create an addhandler for the BackStage Save Menu Option

And

For the BackStage SaveAs Menu Option

That would be of great help and probably solve my special handling needs.

Dinko | Tech Support Engineer
Telerik team
 answered on 13 Sep 2023
2 answers
76 views

Hi,

I want to display text above the (bottom) border. Therefore, I am experimenting with RadLabel and tried this by setting the ZIndex of LabelElement.LabelText above the ZIndex of LabelElement.LabelBorder which unfortunately does not work. All overlapping letters are just cut. Now, I would need to expand the controls size by which the border would move further below the text which is not what I want.

How can I achieve this?

It would be even better if the border would leave some space around the text like in your web menu here on any "overlapping" letter ("j", "g", "p", "q", "y") but I assume this is not possible.

tar
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 11 Sep 2023
1 answer
79 views

The ribbon bar has a save button... and I'd like to add special behavior when the user clicks the save button.

Is there any way to intercept or override (with add handler perhaps) the save button click event?

Dinko | Tech Support Engineer
Telerik team
 answered on 07 Sep 2023
1 answer
54 views

this exception will happen randomly in my program ,but i cann't reproduce it , and it cann't be catched by program. so i want to know when and how will this exception happen . i want to check my program and find if there is such code which will make this exception happen

参数名: index
 Source=mscorlib
StackTrace=   在 System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   在 Telerik.WinControls.UI.ColumnLayoutHelper.ProcessColumnsCollection(List`1 columns)
   在 Telerik.WinControls.UI.ColumnLayoutHelper.CalculateColumnsWidth(SizeF availableSize)
   在 Telerik.WinControls.UI.TableViewRowLayout.MeasureRow(SizeF availableSize)
   在 Telerik.WinControls.UI.RowsContainerElement.MeasureOverride(SizeF availableSize)
   在 Telerik.WinControls.RadElement.MeasureCore(SizeF availableSize)
   在 Telerik.WinControls.RadElement.Measure(SizeF availableSize)
   在 Telerik.WinControls.Layouts.ContextLayoutManager.UpdateLayout()
   在 Telerik.WinControls.Layouts.ContextLayoutManager.UpdateLayoutCallback(ILayoutManager manager) 

Dinko | Tech Support Engineer
Telerik team
 answered on 07 Sep 2023
1 answer
115 views

Hi,

I am populating a GridViewComboBoxColumn in RadGridView with data from an ArrayList.

How to set a default value on the column (using index from ArrayList or maybe just using string compare) on grid load?

Please advise.

/Br. Anders

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 04 Sep 2023
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
ComboBox and ListBox (obsolete as of Q2 2010)
ListView
Chart (obsolete as of Q1 2013)
Form
PageView
MultiColumn ComboBox
TextBox
RichTextEditor
Menu
PropertyGrid
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
ProgressBar
CheckedDropDownList
Rotator
TrackBar
MessageBox
SpinEditor
StatusStrip
CheckedListBox
Wizard
ShapedForm
SyntaxEditor
TextBoxControl
LayoutControl
CollapsiblePanel
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
DataEntry
GroupBox
ScrollablePanel
WaitingBar
ScrollBar
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
ColorBox
Callout
FilterView
PictureBox
VirtualKeyboard
NavigationView
Accessibility
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
Licensing
BreadCrumb
Security
LocalizationProvider
Dictionary
Overlay
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
Flyout
ToolbarForm
NotifyIcon
Rating
TimeSpanPicker
BarcodeView
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
+? more
Top users last month
Henri
Top achievements
Rank 2
Iron
Iron
Iron
SUNIL
Top achievements
Rank 2
Iron
Iron
Iron
David
Top achievements
Rank 1
Jackson
Top achievements
Rank 1
Iron
Iron
Tim
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Henri
Top achievements
Rank 2
Iron
Iron
Iron
SUNIL
Top achievements
Rank 2
Iron
Iron
Iron
David
Top achievements
Rank 1
Jackson
Top achievements
Rank 1
Iron
Iron
Tim
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?