Telerik Forums
UI for WinForms Forum
1 answer
158 views
I have followed your tutorial on how to create a hierarchy using the GridView. Everything works perfectly except for one small issue. If there are no related records in a particular child, I don't get an Add New Row line (??), I therefore cannot add the first child record to the child table using the GridVew. If there is at least one related record, the Add New Row line is visible and allows me to add a new row.

Some help on this matter will be much appreciated
Martin Vasilev
Telerik team
 answered on 13 Mar 2009
2 answers
168 views
I bind my radGridView to a custom object - let's say a CustomerList that is made up of a bunch of Customer objects.

How do I get the underlying Customer object from the CurrentRow (or ANY row, for that matter)?

Thanks.

-- Greg
Jack
Telerik team
 answered on 13 Mar 2009
1 answer
158 views
I'm fairly new using Winforms gridview.  I'm trying to create a grid with a simple hierarchy relationship.  In the full auto mode it works fine. but when I try the manual bound mode I cannot make it work.  The child grid is not displayed at all.

Below is a snippet of code.  The commented out code is when I try the auto mode, so I don't believe there is anything wrong with the dataset.

Any help would be greatly appreciated.

                grdKitDetail.Relations.Clear();
                grdKitDetail.MasterGridViewTemplate.ChildGridViewTemplates.Clear();
                grdKitDetail.MasterGridViewTemplate.Columns.Clear();
                grdKitDetail.DataSource = null;
                grdKitDetail.AutoGenerateHierarchy = false;

                DataSet dataset = new DataSet();
                if (!Route._getKitDetail(ref dataset, masterid, kittypes)) { fstatus = false; goto PROC_EXIT; }

                dataset.Relations.Clear();
                dataset.Tables[0].TableName = "KitDetail"; dataset.Tables[1].TableName = "Inventory";
                dataset.Relations.Add("Inventory", new DataColumn[] { dataset.Tables["KitDetail"].Columns["DetailId"] },
                                                                        new DataColumn[] { dataset.Tables["Inventory"].Columns["DetailId"] });

                //grdKitDetail.AutoGenerateHierarchy = true;
                //grdKitDetail.DataMember = "KitDetail";
                //grdKitDetail.DataSource = dataset;
                //goto PROC_EXIT;

                grdKitDetail.DataSource = dataset.Tables["KitDetail"];

                GridViewTemplate childtemplate = new GridViewTemplate();
                childtemplate.DataSource = dataset.Tables["Inventory"];

                grdKitDetail.MasterGridViewTemplate.ChildGridViewTemplates.Add(childtemplate);

                GridViewRelation childrelation = new GridViewRelation(grdKitMaster.MasterGridViewTemplate);
                childrelation.ChildTemplate = childtemplate;
                childrelation.RelationName = "KitDetailInventory";
                childrelation.ParentColumnNames.Add("DetailId");
                childrelation.ChildColumnNames.Add("DetailId");
                grdKitDetail.Relations.Add(childrelation);

Jack
Telerik team
 answered on 13 Mar 2009
8 answers
300 views
Hey all,

I have a FlowLayoutPanel. AutoScroll is set to True, FlowDirection is TopDown, and WrapContents is False.

Inside this FlowLayoutPanel, I have a RadPanelBar. GroupStyle is ExplorerBarStyle. There is a single Element in this RadPanelBar.

The desired functionality is: When the Element is collapsed, the RadPanelBar.Height property should be set to the height of the Element's title bar. When the Element is expanded, RadPanelBar.Height should be the sum of the title bar's Height and the element content panel's height.

Obviously I've hooked an event handler up to the GroupExpandedChanged event of the Element. I need two Height values - the Content Panel's and the Title Bar's.

I can get to radPanelBarGroupElement1.ContentPanel.Height. That's fine, and returning as expected. 

I can't for the life of me work out how to extract the height of the title bar programatically.

Alternatively, if there's an easier way to do create this functionality, I'm all ears.
Boyko Markov
Telerik team
 answered on 13 Mar 2009
1 answer
249 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
129 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
113 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
244 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
247 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
361 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
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
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
VirtualGrid
Toolstrip (obsolete as of Q3 2010)
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
SplitContainer
Documentation
Map
DesktopAlert
CheckedDropDownList
ProgressBar
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
CollapsiblePanel
LayoutControl
ShapedForm
SyntaxEditor
Wizard
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
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?