Telerik Forums
UI for WinForms Forum
1 answer
223 views
Here is a sample of a quick test project I made to represent the issue I am having ...

    public Form1()
    {
      InitializeComponent();

      RadSplitButtonElement btnAttachFileDocument;
      btnAttachFileDocument = new RadSplitButtonElement();
      btnAttachFileDocument.Text = "Attach File";
      btnAttachFileDocument.Click += new EventHandler(btnAttachFileDocument_Click);
      btnAttachFileDocument.DropDownOpened += new EventHandler(btnAttachFileDocument_DropDownOpened);
      RadLabelElement oMenuItem;

      oMenuItem = new RadLabelElement();
      oMenuItem.Text = "Cover Sheet";
      oMenuItem.Click += new EventHandler(oMenuItem_Click);
      btnAttachFileDocument.Items.Add(oMenuItem);

      oMenuItem = new RadLabelElement();
      oMenuItem.Text = "Master Waybill Doc";
      btnAttachFileDocument.Items.Add(oMenuItem);

      radRibbonBar1.CommandTabs[0].Items.Add(btnAttachFileDocument);

    }

    void oMenuItem_Click(object sender, EventArgs e)
    {
      this.Text = "Cover Sheet Clicked";
    }

    void btnAttachFileDocument_DropDownOpened(object sender, EventArgs e)
    {
      this.Text = "DropDown";
    }

    void btnAttachFileDocument_Click(object sender, EventArgs e)
    {
      this.Text = "Clicked";
    }

I have 2 issues .

 

Firstly I cannot get a seperate event when clicking the dropdown arrow of the button or when clicking the button itself.

I want to generate a default click event if the user clicks the button but if he opens the drop down I want to wait for him

to select the appropriate item from the list. At the moment I always get the click event when the dropdown opens. How

do I prevent this ?

 

Secondly , with the splitbutton control I can mouseover the dropdown arrow and button seperately and it highlights them
seperately . WIth the splitbuttonelement that I add to the ribbonbar however it always highlights it all as one control always
and I can only ever see the Image regardless of the textimage relation I setup . My text is always invisible ...

 

Victor
Telerik team
 answered on 13 Mar 2009
1 answer
108 views
I am trying to find a way to import the column definitions of a GridView at design time.

I bind my GridView to a custom business object at runtime, and I do not want to have to bind the GridView to a BindingSource at design time just to get column definitions.

There must be some way to load serialized GridView XML definitions at design time to define a GridView's columns without having to define each column manually as an unbound column.

Check out how the Janus controls do this - it's perfect. You can save and load definitions of the grids while in design view. This allolws you to use code generators to define your grid columns and simply load those definitions at design time, then make any last-minute adjustments.

-- Greg

Nick
Telerik team
 answered on 12 Mar 2009
1 answer
89 views
Hello everyone i'm using the RadMulticolumncombobox and i'm trying to get the SelectedIndexChanged event and this is not here I start a ticket but a don't have one answer 21 hour ago I rewrite and no answer ... else that answer ... Hello Alexandre,

Thank you for contacting us.

There is SelectedIndexChanged  (http://www.telerik.com/help/winforms/multicolumn-selectedindexchanged.html)  event which you can use. You have probably overlooked it.

Write me back if you have further questions.
 

Regards,
Nick
the Telerik team

Look at the link ... is it me or the SelectedIndexChanged sub isn't handle ?? so how the event can be fire ???  I'm a little bit frustrated by telerik my company paid 2 lisences of it and this is always hard to deal with ... because of that my application is 60% make with windows form controls ...
Nick
Telerik team
 answered on 12 Mar 2009
1 answer
215 views
I have a gridview ( Winforms Q2 2008) binded to a datasource. I want to get the edited value in a cell (Decimal Datatype)
The CellClick event is not getting fired and the code in it is not being executed. The ActiveEditor.value is NOTHING ...
I need to get the value in that cell...Please help
Below is the code for reference

 Private Sub rdgvItemPricing_CellClick(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.GridViewCellEventArgs)
        If e.ColumnIndex = 12 Then
            m_blnPriceRowClicked = True
        Else
            m_blnPriceRowClicked = False
        End If
    End Sub
--
   Private Sub rdgvItemPricing_Validated(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim stcItemPricing As New stc_Item_ItemPricing
        If m_blnPriceRowClicked Then
            m_blnPriceRowClicked = False
            If Not fnGetStructure(stcItemPricing) Then Exit Sub
            If m_objMenuItems.AddUpdateItemPricing(stcItemPricing) Then
                MessageBox.Show("Item price updated successfully", g_strCaption, MessageBoxButtons.OK, MessageBoxIcon.Information)

            Else
                MessageBox.Show("Error updating the Item Price", g_strCaption, MessageBoxButtons.OK, MessageBoxIcon.Information)
            End If
        End If
    End Sub


  Private Function fnGetStructure(ByRef stcItemPricing As stc_Item_ItemPricing) As Boolean
        With stcItemPricing
            'UI.RadGridView.EditingElement
            .intMenuItemCode = CInt(rdgvItemPricing.CurrentRow.Cells(1).Value)
            .intDeptCode = CInt(rdgvItemPricing.CurrentRow.Cells(14).Value)
            .intUserCode = CInt(g_intUserCode)

            If IsNothing(rdgvItemPricing.ActiveEditor.Value) Then
                Return False
            End If
        .dblPrice = CDbl(rdgvItemPricing.ActiveEditor.Value) 'CDbl(rdgvItemPricing.CurrentRow.Cells(12).Value)
............................
............................

         

Jack
Telerik team
 answered on 12 Mar 2009
1 answer
220 views
Hello,
I'm following the "Adding Custom Elements to Cells" example found in the documentation.

private void radGridView1_CellFormatting(object sender, CellFormattingEventArgs e) 
   // exclude header element in the data column                        
   if (e.CellElement.ColumnInfo is GridViewDataColumn && !(e.CellElement.RowElement is GridTableHeaderRowElement)) 
   { 
       GridViewDataColumn column = (GridViewDataColumn)e.CellElement.ColumnInfo; 
       if (column.FieldName == "Discount"
       { 
           // check if the progress bar is already added to the cell                            
           if (e.CellElement.Children.Count > 0) 
               return
           RadProgressBarElement element = new RadProgressBarElement(); 
           e.CellElement.Children.Add(element); 
           element.StretchHorizontally = true
           element.StretchVertically = true
           // extract the value in the cell, convert it to a value 
           // usable in the progress bar element and assign it to the 
           // progress bar Value1 and Text properties 
           object discountValue = e.CellElement.RowInfo.Cells["Discount"].Value; 
           int discountPercentage = Convert.ToInt32(Convert.ToDecimal(discountValue) * 100); 
           element.Value1 = discountPercentage; 
           if (discountPercentage > 0) 
           { 
               element.Text = discountPercentage.ToString() + "%"
           } 
           // apply theme to the progress bar   
           ApplyThemeToElement(element, "ControlDefault"); 
       } 
   } 
private void ApplyThemeToElement(RadItem item, string themeName) 
   DefaultStyleBuilder builder = 
           ThemeResolutionService.GetStyleSheetBuilder(item, themeName) as DefaultStyleBuilder; 
   if (builder != null
       //clone because control might modify it later 
       item.Style = new XmlStyleSheet(builder.Style).GetStyleSheet(); 

Actually, i'm using a RadImageItem instead of progress bar.
Tthe items are "rendered" the right way. Scrolling and sorting do not work: the image (or the progressbar) doesn't change when re-sorting or scrolling (whatever column i sort), while the other columns are shown ok.

Any hints?

Btw, i'm using the latest trial.
Thanks in advance
Jack
Telerik team
 answered on 12 Mar 2009
3 answers
332 views
Hi,

Can we have multiple control for example TextBox and Button in the same column ?

What I really want is : In the RadGridView one column consists of some file path..so I want the textpath and button in the same column so that the user can click on that button to browse and change the file path.

thanks in advance.


regards,

Bibek Dawadi
Jack
Telerik team
 answered on 12 Mar 2009
1 answer
82 views

Hello,

I have got a strange problem. In my application a radGrid is well shown but in the header is a sentence written that I don´t want to appear.

"Drag a column here to group by this colum". I don´t know why is shown.

Do you know why?

Thank you in advance.

PS If you need the code just tell me and I´ll write it.
      Sorry, the title is not as I wanted to call to this post :(, mistake
Patxi
Top achievements
Rank 1
 answered on 11 Mar 2009
1 answer
136 views
<?xml version="1.0" encoding="utf-8"?>  
<Invoices> 
<Invoice> 
  <InvoiceNumber>456789</InvoiceNumber> 
  <JobNumber>TTT</JobNumber> 
  <CreateDate>01/03/2009 12:23:34</CreateDate> 
  <Parts> 
       <Part> 
           <PartNumber>001</PartNumber> 
           <PartDescription>Part Number 1 has expection</PartDescription> 
           <PartPrice>12.99</PartPrice> 
 
       </Part> 
       <Part> 
           <PartNumber>002</PartNumber> 
           <PartDescription>No Part available</PartDescription> 
           <PartPrice>60.00</PartPrice> 
       </Part> 
  </Parts> 
 
          
</Invoice> 
<Invoice> 
  <InvoiceNumber>0000</InvoiceNumber> 
  <JobNumber>SSSS</JobNumber> 
  <CreateDate>01/01/2001 11:00:00</CreateDate> 
  <Parts> 
       <Part> 
           <PartNumber>003</PartNumber> 
           <PartDescription>Part Number3 has expection</PartDescription> 
           <PartPrice>42.99</PartPrice> 
 
       </Part> 
       <Part> 
           <PartNumber>004</PartNumber> 
           <PartDescription>4 Part available</PartDescription> 
           <PartPrice>100.00</PartPrice> 
       </Part> 
  </Parts> 
 
          
</Invoice> 
</Invoices> 
the Invoice table to part table is many to many
so  table diagram is  "Invioce" -> "InvoiceParts" ->"Parts"
any sample codes how to implement it?

here is my source code
 Dim mO As New XMLOperater  
        grdvewCurrentParts.DataSource = mO.XMLToDataSet("C:\xmlfile.xml").Tables(0)  
        Dim template As Telerik.WinControls.UI.GridViewTemplate = New Telerik.WinControls.UI.GridViewTemplate  
        template.DataSource = mO.XMLToDataSet("C:\xmlfile.xml").Tables(1)  
 grdvewCurrentParts.MasterGridViewTemplate.ChildGridViewTemplates.Add(template)  
        Dim template2 As Telerik.WinControls.UI.GridViewTemplate = New Telerik.WinControls.UI.GridViewTemplate  
        template2.DataSource = mO.XMLToDataSet("C:\xmlfile.xml").Tables(2)  
        template.ChildGridViewTemplates.Add(template2)  
 
 
        grdvewCurrentParts.MasterGridViewTemplate.ChildGridViewTemplates.Add(template2)  
 
        Dim relation As GridViewRelation = New GridViewRelation(grdvewCurrentParts.MasterGridViewTemplate)  
        Dim relation2 As GridViewRelation = New GridViewRelation(grdvewCurrentParts.MasterGridViewTemplate.ChildGridViewTemplates(template))  
        relation.ChildTemplate = template  
        relation2.ChildTemplate = template2  
        relation.ParentColumnNames.Add("Invoice_Id")  
        relation.ChildColumnNames.Add("Invoice_Id")               relation2.ParentColumnNames.Add("Parts_Id")  
        relation2.ChildColumnNames.Add("Parts_Id")  
        grdvewCurrentParts.Relations.Add(relation)  
 
grdvewCurrentParts.Relations.Add(relation2)  
 
thank you very much!
Nick
Telerik team
 answered on 10 Mar 2009
2 answers
154 views
Hello,
When I create a TreeView via code and  a node is disabled, his backColor become "gray-gradient".
But if the Treeview is created in design, there is not backColor .
How can i have the same "Disabled Style" as if i create my treeView via Design ?
Thank you
Victor
Telerik team
 answered on 10 Mar 2009
1 answer
154 views
I'm new with using Menu for WinForms.  I'm sure it can be none easily, but how to bind the menu item combo box to a dataset or reader?
Nick
Telerik team
 answered on 09 Mar 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)
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
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
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
CheckedListBox
StatusStrip
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
Conversational UI, Chat
DateTimePicker
CollapsiblePanel
TabbedForm
CAB Enabling Kit
GroupBox
WaitingBar
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
Styling
Barcode
BindingNavigator
PopupEditor
RibbonForm
TaskBoard
Callout
ColorBox
PictureBox
FilterView
NavigationView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
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
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?