Telerik Forums
UI for WinForms Forum
3 answers
368 views

I have a RowSourceNeeded event, and inside that event I create my child GridView and add rows to it.  There are conditions that would keep me from adding the child GridView; however, I still need to add this child when I do have the data required to do so.

In this event I check a property "model.Parameters" which could be null; however, it is not always going to be null (after handling the RowSourceNeeded event) and when not null I need to add the child GridView.

Here's where I add it.

// get the analysis parameter differences for this row (scan)
private async void BatchComparisonGrid_RowSourceNeeded(object sender, GridViewRowSourceNeededEventArgs e)
{
    // tell user we're getting the analysis parameters
    UpdateWaitingBar(ElementVisibility.Visible, "Getting analysis parameters");
 
    // get item bound to the row
    ComparisonScanViewModel model = e.ParentRow.DataBoundItem as ComparisonScanViewModel;
 
    await Task.Factory.StartNew(() =>
    {
        if (null != model && null != model.Parameters)
        {
            // I don't do anything here, I just needed to cause 'model.Parameters' to
            // be called since it is a timely call.
        }
    });
 
    // update the UI
    if (null != model &&
        null != model.Parameters)
    {
        foreach (ComparisonAnalysisParameterViewModel am in model.Parameters)
        {
            // build values to go in the row details grid
            GridViewRowInfo row = e.Template.Rows.NewRow();
            row.Cells["Description"].Value = am.Title;
            row.Cells["Value"].Value = am.Value;
 
            e.SourceCollection.Add(row);
        }
 
        e.ParentRow.IsExpanded = true;
    }
 
    // tell the user we're done
    UpdateWaitingBar(ElementVisibility.Collapsed);
}

 

Later, I'm listening to the CurrentRowChanging event.  Here I can get the same data from the model and potentially build the child GridView; however, I don't have the necessary information required that was provided to me in the RowSourceNeeded event.  I.e. e.Template and e.SourceCollection.

 

// row is changing in the grid and time to expand that item to show the details for the row
private void BatchComparisonGrid_CurrentRowChanging(object sender, CurrentRowChangingEventArgs e)
{
    if (e.NewRow is GridViewHierarchyRowInfo)
    {
        foreach (var item in BatchComparisonGrid.Rows)
        {
            item.IsExpanded = false;
        }
 
        // get model
        ComparisonScanViewModel model = e.NewRow.DataBoundItem as ComparisonScanViewModel;
        if(null != model.Parameters)
        {
            // code would go here that checks to see if this row already had the child GridView
            // added, and if not AND model.Parameters is not null, then we'll add the child GridView now.
 
            // BUT, how to do this from here ????
        }
 
        // expand
        e.NewRow.IsExpanded = true;
    }
}

 

Is there some way to access what I need from the CurrentRowChanging event in order to add the child GridView...since the RowSourceNeeded event is never raised again after the first time it is raised?

 

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 29 Jan 2018
2 answers
86 views

While trying to build a quick POC using Telerik diagram control I came upon this issue.

When I try to bind "Associated Diagram" in the RadDiagramRibbonBar, I get an error when I click on the Drop down control.

---------------------------
Microsoft Visual Studio
---------------------------
Error using the dropdown: Unable to cast object of type 'System.Windows.Forms.UserControl' to type 'System.Windows.Forms.Form'.
---------------------------
OK   
---------------------------

 

I understand that an Excel Document Action Pane is in effect a UserControl type but I was wondering if there was a work around to this scenario.

Dimitar
Telerik team
 answered on 29 Jan 2018
3 answers
241 views
Greetings,

Using the newest Telerik version updated from Telerik Control Panel.

Goal: Use OpenXML. Make a program that can load a docx document, add a watermark, save to docx and convert to pdf.

I've made a program that reads a docx document into a WordprocessingDocument. It then adds a watermark and saves the docx. This works and afterwards i verified in Word 2013, that the watermark is in fact in the file.

Then i need to convert this docx to a pdf using RadDocument & PdfFormatProvider. So i read the docx into a RadDocument using docxprovider.Import(stream) and save it using providerPdf.Export(document, output).

The outcome is a pdf document without the watermark.

What am i missing? Please advise.

(I tried converting the very same generated docx document to pdf using a free online service, and it's working, adding a watermark to the generated pdf.)

Best Regards,
T
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 26 Jan 2018
3 answers
326 views
Don't know how else to describe it.  There doesn't seem to be any good explanation.  For some rows, the first time I click a cell in the row the event is raised.  And then on subsequent clicks on those rows the event is never raised.
Chris Kirkman
Top achievements
Rank 1
 answered on 25 Jan 2018
1 answer
368 views

Hi 

How can I left align the text in the virtualGrid (with only one column and AutoSizeColumnsMode set to Fill).

 

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 25 Jan 2018
1 answer
719 views

Hello again folks.

Can someone please show me how to edit the border and background colors of the DesktopAlert Context Menu that appears when the "Options" button is clicked?

Thank you!

-Curtis

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 25 Jan 2018
2 answers
85 views

Hello there,

I added a RadButton to my WInForm and although I can find TextPrimitive.TextOrientation property in the Designer, I cannot find it through the Telerik API so I can change it in runtime!

Telerik Designer and API are not consistent with each other?

Any idea on how I can resolve my problem?  

Thank you,

Maria

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 25 Jan 2018
1 answer
154 views

I reported the issue below back in September 2017. It was scheduled for a fix in R1 2018 (here). However, it appears that the problem persists. Did it get missed or is there a setting/option that I'm missing. I think it is a rather major issue for anyone trying to put a DPI aware app together.

This is the problem:

In a DPI aware app, using the docking tool window auto-hide dramatically increases the size of any controls on the window. This can be demonstrated with a new application. Add a RadDock to the form, add a couple of tool windows and a document window, and add a few controls to either of the tool windows (label, button, treeview, property grid, etc.). Run the app as DPI aware at 150 scale. Hide a tool window. Open the tool window. When the tool window slides open all the font and control sizes have greatly increased.

 

 

Dimitar
Telerik team
 answered on 25 Jan 2018
9 answers
457 views
I imagine there is a way to show another grid view within a selected row of the parent grid view.  This would be something very similar to the row details template within a WPF application.  See attached screenshot from a demo WPF app.
Dimitar
Telerik team
 answered on 25 Jan 2018
1 answer
94 views

Hi. 

Attach an image. When user move mouse over the chart, a tooltip show to the user Value = 1. i want to change "value" text with my Custom text, like "مقدار".

how can do this ?

Dimitar
Telerik team
 answered on 24 Jan 2018
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?