Telerik Forums
UI for WinForms Forum
5 answers
381 views
I have a RadDock  on my main form.  Within this RadDock I create multiple Forms that are create via the following code according to the MDI section of the RadDock documentation,

         messageGenerationForm = new MessageGenerationForm( this );
         messageGenerationForm.Text = "Message Generation";
         messageGenerationForm.MdiParent = this;
         messageGenerationForm.Show();

I set the CloseAction to be Hidden.

They are created as ToolWindows so they can be undocked from the form.  If they are closed, I want to have a menu item that will allow them to be restored.  How is this to be done?


Ken...
Julian Benkov
Telerik team
 answered on 03 Feb 2012
3 answers
230 views
It seems that Style.Reset() doesn't truly reset everything.  Code is below, results are attached.  Notice the black borders on the top two rows.  The value in the have columns for both of those rows was 0, then via code (UI technically), the number is updated to the same as the need column, going from a red border to the black border.  The third row down which appears as I would like it always had have > need, so it was never changed, and has the defaults.

And while I have your attention I have two other related questions:
1) Is there a better way to access the style element of a cell than this?
            GridViewCellInfo haveCell = e.RowElement.RowInfo.Cells["HaveColumn"];

2) I just wanted a simple 2 pixel red border...I've seen conflicting information in the forums as to what's really required.  The smallest set of properties I found that would work are in the code below.  That seems like an awful lot of work to put a 2 pixel red border in place.  Is what I have the best approach?

        private void RequirementsGrid_RowFormatting(object sender, RowFormattingEventArgs e)
        {
            GridViewCellInfo haveCell = e.RowElement.RowInfo.Cells["HaveColumn"];

            int? need = (int?)e.RowElement.RowInfo.Cells["NeedColumn"].Value;
            int have = 0;
            if (haveCell.Value != null)
                int.TryParse(haveCell.Value.ToString(), out have);

            if (have < need)
            {
                haveCell.Style.CustomizeBorder = true;
                haveCell.Style.BorderColor = Color.Red;
                haveCell.Style.BorderGradientStyle = GradientStyles.Solid;
                haveCell.Style.BorderBoxStyle = BorderBoxStyle.SingleBorder;
                haveCell.Style.BorderWidth = 2;
            }
            else
            {
                haveCell.Style.Reset();
            }
        }

Thanks!
Jack
Telerik team
 answered on 03 Feb 2012
3 answers
113 views
Hello,

I have a problem on starting the advanced layout designer for a RadDock-control. It shows me a "permission denied" for "C:\DockAdvancedLayoutDesignerInput.xml"... I can cancel afterwards, but the layout manager doesn't show the controls I added manually before.

What I have done so far:
- Installed Telerik WinForms Trial
- Started a new project
- Bought Telerik WinForms
- Uninstalled the Trial and installed the Full Version
- Conversed my project to a Telerik application (was necessary to do it again)
- Added a RadDock-Control to my project
- Added some Toolboxes, etc. to the RadDock-Control
- Tried to start the advanced layout manager
- got error message
- opened new thread here... ;)


Sorry for my broken english, I hope I could make my point.

Fabian
Stefan
Telerik team
 answered on 03 Feb 2012
1 answer
88 views
hi sir
I asked a question that how I can align screentip of RadButtonelements of Radribbonbar from right; but unfortunately you didn't answer and deleted it,
I asked again.I want to align right edge of ScreenTip to right edge of Radbuttonelement , because the screentip text is writhen by right to left language.
please help me If there was a solution.
Stefan
Telerik team
 answered on 03 Feb 2012
1 answer
184 views
Good afternoon,

I am using the component radpropertygrid and select the color need to hide tabs System and Web color picker, but I'm not succeeding.

How to perform this process on the properties of the component colors?

Thank you,
Thiago 

http://farm8.staticflickr.com/7032/6797461491_ce940494ed_z.jpg
Ivan Petrov
Telerik team
 answered on 03 Feb 2012
1 answer
374 views
Greetings,

I know how to do this in ASP.net by using the Telerik controls but i have some problems to do it for WinForm.

http://www.hostingpics.net/viewer.php?id=856225TELERIK2.png

Can anyone help me ?
The user must be able to click on the images to edit or to delete rows...

Thanks in advance
Ivan Petrov
Telerik team
 answered on 03 Feb 2012
2 answers
145 views
I have created a grid view and I am trying to group the items together.  I think maybe this is a bug in the older version (v. 2010.3.10.1215) I am using.   The problem is when I click on the expand button in the grid the winform locks up compltely and I have to end the program.  When I remove the self reference I see the grid is built out properly with reference to my IDs and ParentIDs.  The DataSource of my datagrid is a DataTable that I am building via code.

 

this.radGridView1.Relations.AddSelfReference(this.radGridView1.MasterTemplate, "Id", "ParentId");

Did I do something wrong or is this a known bug?


Aaron
Top achievements
Rank 1
 answered on 02 Feb 2012
8 answers
201 views
Afternoon,

I have created a table which shows sales orders by agent. The items sold can one of 9 types and appear multiple times. What I would like to know is what is the best way of getting that group value for each type?

I currently have the below code which when grouped displays the group value.

private void OrderHistory_GroupSummaryEvaluate(object sender, GroupSummaryEvaluationEventArgs e)
        {
            decimal totalRevenue = 0;
   
            foreach(GridViewRowInfo row in e.Group)
            {
                totalRevenue += (decimal)row.Cells["RevenueValue"].Value;
            }
              
            e.FormatString = String.Format("{0} : £{1:0.00}", e.Value, totalRevenue);
        }

My initial thought would be to try and get at those values but I don't think that would be the correct way of doing it. I think I need to use the foreach section to tally up the values but I am unsure as to how to do that for each type.

A point in the right direction would be greatly appreciated!

Guy
Guy
Top achievements
Rank 1
 answered on 02 Feb 2012
5 answers
298 views
quick background:
I notice that when a user tries to add a new row to a gridview, the row isn't bound to the data type until after the row is validated. This is problematic because I want to 'pre-populate' some of the fields based on what they enter in the first cell. If it was bound, it'd be simple as all I'd have to do is set the bound variable and the table would automatically populate...this doesn't appear feasible...

so I think I have, what I believe to be a work around...basically on a cell validation, I check to see if the row index == -1, if so then I cancel the edit and create a new CashReceivable object and add that to the bound list...the theory being that I'm esentially cancelling the edit and instead of adding the object via the gridview, I add it via the bound list...based on the code below, this works...

So what's my problem?
After this executes, the row gets added to the gridview just fine, the cell that I want to be selected is, however when I start typing to try the trustDGV.BeginEdit() (*note* I didn't include it in the code snipet below since it wasn't working, but I would assume I need to call this to put the cell into edit immediately mode) nothing happens...I am wanting it so as soon as this row gets added the second column goes directly into edit mode...What am I doing wrong?  *note* when I debugged it, I noticed that the currentCell rowIndex was still set to -1, even though I am speicifically setting the current row and column....it would appear as though currentCell is never being updated properly and I might need to do it during another event, but for the life of me, I dont see which event I could do it under...
 
        public ReceiptSplitWizard(String receiptNumber)
        {
            InitializeComponent();
 
            trustReceivables = new BindingList<CashReceivable>();
            trustDGV.DataSource = trustReceivables;
             
            trustDGV.CellValidated += new CellValidatedEventHandler(trustDGV_CellValidated);
            trustDGV.RowsChanged += new GridViewCollectionChangedEventHandler(trustDGV_RowsChanged);
 
             ... foreach loop here to add pre-existing receivables to the binding list to pre-populate it ...
}
 
        void trustDGV_CellValidated(object sender, CellValidatedEventArgs e)
        {
            if (e.RowIndex == -1)
            {
                if (e.Column.UniqueName.Equals("trustTargetInvoiceNumberDGVTBC"))
                {
                    CashReceivable receivable = CashReceivable.Clone(originalReceivable);
                    receivable.TXSet = null;
                    receivable.BillInvoiceNo = (String)e.Value;
                    receivable.CheckAmount = null;
                    receivable.BusinessFunction = GetBusinessFunction(receivable.BillInvoiceNo);
                    trustReceivables.Add(receivable);
                    trustDGV.MasterView.TableAddNewRow.CancelAddNewRow();
                    trustDGV.CurrentRow = trustDGV.Rows[trustDGV.Rows.Count - 1];
                    trustDGV.CurrentColumn = trustDGV.Columns[1];
                }
            }
     }
 
void trustDGV_RowsChanged(object sender, GridViewCollectionChangedEventArgs e)
        {
            GridViewDataRowInfo row = (GridViewDataRowInfo)e.NewItems[0];
 
            CashReceivable receivable = (CashReceivable)row.DataBoundItem;
 
            // if it's been distributed, then gray it out and set it readonly
            if (receivable.TXSet != null)
            {
                foreach (GridViewCellInfo cell in e.GridViewTemplate.Rows[e.NewStartingIndex].Cells)
                {
                    cell.Style.Font = new Font("Segoe UI", 8.25F, FontStyle.Italic);
                    cell.Style.ForeColor = Color.SlateGray;
                    cell.ReadOnly = true;
                }
            }
        }

Jack
Telerik team
 answered on 02 Feb 2012
1 answer
204 views
Ctrl+A (Select All)
Ctr+Y (Redo)
are not working in RadText Boxes.
Also, is there a way to change the undo being  done in RadTextBoxes to be a character at a time.
Stefan
Telerik team
 answered on 02 Feb 2012
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
ProgressBar
CheckedDropDownList
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
Barcode
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Callout
ColorBox
PictureBox
FilterView
NavigationView
Accessibility
VirtualKeyboard
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Licensing
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
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?