Telerik Forums
UI for WinForms Forum
1 answer
160 views
hello,

I'm creating a RadTreeView dynamically. when adding the first level (0) nodes to the treeview, the nodes that have children are aligned without any margin, while the nodes that do not have any children are aligned with a margin. all the nodes were created the same way (all the nodes are added in a loop). can anyone help me align all the the nodes in the same place?
i attached a screen shot of the RadTreeView that i get (Personal and Confirmation Center don't have any children while the others have)

thank you
Anton
Telerik team
 answered on 07 Nov 2012
3 answers
208 views
Hi everyone,

I am hoping someone can help me solve a problem I am having with the GridViewDecimalColumn in my radGridView. I have an unbound column named "Days". This column is populated when the grid is loaded in the following way: 

private void grid_CellFormatting(object sender, Telerik.WinControls.UI.CellFormattingEventArgs e)
{
    if (e.Column.Name == "Days")
    {
        MyObject obj = (MyObject)e.Row.DataBoundItem;
        if (obj != null)
        {
            TimeSpan span = DateTime.Now.Date - obj.SomeDate.Date;
            e.CellElement.Value = span.Days;
        }
    }
}

When I try and sort on this value, the sort order does not make any sense. I get things like the following:

14
14
33
33
36
17
14 (should be at the top with the other 14's)

The sort does not follow any sort of logic and instead appears to just be sorting the numbers randomly. How can I get it to sort the numbers properly (IE ascending/descending order) 

Thanks 

----- EDIT-----------

Now that I have played with it a bit more, the grid is sorting, it is just sorting extremely slow. Moving the scrollbar up and down will force the grid to repaint and you can see the sort occurring. Why is this so slow? There are only around 160 rows in this grid. I have sorted other grids with 200+ rows and the sort is instantaneous. 


Emanuel Varga
Top achievements
Rank 1
 answered on 07 Nov 2012
1 answer
204 views

DISREGUARD:  I found the error and it was in another method that for some reason was coded to alwyas select the last row.


When ever my form is loaded with a radgirdview control on it the row 0 is always selected.  The grid is a multiselect and It is set so the user can select multiple rows and then click a button and all rows that are selected will be updated.

On the form load I have this code
POSSGridView.ClearSelection();
POSSGridView.CurrentRow = null;

and I loop through the rows as follows
foreach (GridViewRowInfo rowInfo in POSSGridView.Rows)
           {
               if (rowInfo.IsSelected)

The issue is when the form loads if I hit the button the .SelectedRows has row 0 in it.  If I select it and then select another row and hit the button not eh .SelectedRows has both rows as being selected even though on the screen the 0 row is not selected.  I am unalbe to find anyway to not have the 0 row selected.
Emanuel Varga
Top achievements
Rank 1
 answered on 07 Nov 2012
1 answer
289 views
Is there any way to catch a row reorder event?

My grid is in unbound mode, with AllowRowReorder = true.  I need to be able to tell when a user reorders the rows via drag and drop, but the obvious DragDrop event is not hit.  Do I really need to use MouseDown, MouseUp, and lots of calculations of row size and position?


-----------------------------------------------------------

Since posting this I found my answer in your demo:

...
 this.radGridView1.Rows.CollectionChanged += new NotifyCollectionChangedEventHandler(Rows_CollectionChanged);
...

 private void Rows_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
if (e.Action == NotifyCollectionChangedAction.Move)
{
for (int i = 0; i < this.radGridView1.Rows.Count; i++)
{
this.radGridView1.Rows[i].Cells["Priority"].Value = i + 1;
}
}
}
Emanuel Varga
Top achievements
Rank 1
 answered on 07 Nov 2012
1 answer
220 views
are there any third party controls ? I want to build like this
http://allbetsareoff.com/tutorials/creating-an-automated-odometer-part-2/ 

is there any telerik control ?
Emanuel Varga
Top achievements
Rank 1
 answered on 07 Nov 2012
11 answers
728 views
When I'm changing text in textbox - the value in the cell is changing too(at the same time). I use event
private void rtx_TextChanging(object sender, TextChangingEventArgs e)
{
    RadTextBox rtb = sender as RadTextBox;
    string title = rtb.Name.Substring(0, rtb.Name.Length - "textbox".Length);
    this.radLabelElement1.Text = rgv.CurrentRow.Cells[title].Value.GetType().ToString();
    rgv.CurrentRow.Cells[title].Value = e.NewValue;
    rgv.CurrentRow.InvalidateRow();
}
where rtx - radtextbox

What event? I need to use to do the same thing for textboxes - when I change value in the cell the value in textbox changes too. I was trying to use CellValueChanged but it affects only after I press enter
Emanuel Varga
Top achievements
Rank 1
 answered on 07 Nov 2012
2 answers
209 views
I have the text aligned to Top Left and the image aligned to the Bottom Right.  However, the icon always seems to appear above the text and centered.Is this a bug or something I am doing incorrectly?

Thanks,

- Brad
Stefan
Telerik team
 answered on 07 Nov 2012
1 answer
96 views
Hi
I using a RadTreeView and Bind to a Binding List. but after binding ( using DataSource, Child Member, ParentMember, DisplayMember properties ) Drag And Drop Events such as "DragEnded" event not work.

please Full help me by a sample about this prablem !

thanks

Stefan
Telerik team
 answered on 07 Nov 2012
1 answer
274 views
Hi Telerik,
I have assigned some cols as read only in the radgrid(radform) and i used cell formatting to apply colors like this by name:
DTURradGridView.Columns["dtuct0"].ReadOnly = true;
          DTURradGridView.Columns["dtuct1"].ReadOnly = true;
          DTURradGridView.Columns["dtuct2"].ReadOnly = true;
          DTURradGridView.Columns["dtuct3"].ReadOnly = true;
          DTURradGridView.Columns["dtuy"].ReadOnly = true;

if (e.CellElement.ColumnInfo is GridViewDataColumn)
            {
                if (e.CellElement.ColumnInfo.FieldName == "dtuct0" )
                {
                    e.CellElement.DrawFill = true;
                    e.CellElement.NumberOfColors = 1;
                    e.CellElement.BackColor = Color.LightSlateGray;
                    e.CellElement.GradientStyle = GradientStyles.Linear;
                }
                if (e.CellElement.ColumnInfo.FieldName == "dtuct1")
                {
                    e.CellElement.DrawFill = true;
                    e.CellElement.NumberOfColors = 1;
                    e.CellElement.BackColor = Color.LightSlateGray;
                    e.CellElement.GradientStyle = GradientStyles.Linear;
                }
                if (e.CellElement.ColumnInfo.FieldName == "dtuct2")
                {
                    e.CellElement.DrawFill = true;
                    e.CellElement.NumberOfColors = 1;
                    e.CellElement.BackColor = Color.LightSlateGray;
                    e.CellElement.GradientStyle = GradientStyles.Linear;
                }
                if (e.CellElement.ColumnInfo.FieldName == "dtuct3")
                {
                    e.CellElement.DrawFill = true;
                    e.CellElement.NumberOfColors = 1;
                    e.CellElement.BackColor = Color.LightSlateGray;
                    e.CellElement.GradientStyle = GradientStyles.Linear;
                }
                if (e.CellElement.ColumnInfo.FieldName == "dtuy")
                {
                    e.CellElement.DrawFill = true;
                    e.CellElement.NumberOfColors = 1;
                    e.CellElement.BackColor = Color.LightSlateGray;
                    e.CellElement.GradientStyle = GradientStyles.Linear;
                }
            }

Then i want to hide/unhide based on the selection like this:
private void normalToolStripMenuItem_Click(object sender, EventArgs e)//Normal View
        {
            DTURradGridView.Columns["dtuct0"].IsVisible = false;
            DTURradGridView.Columns["dtuct1"].IsVisible = false;
            DTURradGridView.Columns["dtuct2"].IsVisible = false;
            DTURradGridView.Columns["dtuct3"].IsVisible = false;
            DTURradGridView.Columns["dtuy"].IsVisible = false;
 
        }
 
         
 
        private void advancedToolStripMenuItem_Click(object sender, EventArgs e) //Advanced View
        {
            DTURradGridView.Columns["dtuct0"].IsVisible = true;
            DTURradGridView.Columns["dtuct1"].IsVisible = true;
            DTURradGridView.Columns["dtuct2"].IsVisible = true;
            DTURradGridView.Columns["dtuct3"].IsVisible = true;
            DTURradGridView.Columns["dtuy"].IsVisible = true;
 
      
        }
When i Click on Normal Mode function, it applies colors to other cols. This is really strange for me. Please help me, thank you.
Emanuel Varga
Top achievements
Rank 1
 answered on 07 Nov 2012
1 answer
268 views
Hi,

We are trying to replace a winform propertygrid with a RadPropertyGrid.

Previously, we were binding an object to the property grid, which in turn was displaying all the properties. If one of the properties is a collection it used be displayed in a collectioneditor when invoked from the property value.

Since the Propertygrid is replaced by RadPropertyGrid, we have been unable to do this. Even when one of the properties is returning a collection it the property grid is not providing the means to invoke the collection editor. I feel like we are missing something. 

Thanks in advance
--Rajesh

Ivan Petrov
Telerik team
 answered on 07 Nov 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)
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
PdfViewer and PdfViewerNavigator
CommandBar
ListControl
Carousel
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
VirtualGrid
Toolstrip (obsolete as of Q3 2010)
Label
AutoCompleteBox
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
SplitContainer
Documentation
Map
DesktopAlert
CheckedDropDownList
ProgressBar
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
Wizard
CollapsiblePanel
LayoutControl
ShapedForm
SyntaxEditor
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
SmartPasteButton
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?