Telerik Forums
UI for WinForms Forum
1 answer
85 views
When you have a radgrid using UseStaticHeaders=True, the radgrid's width fills the browser.  If you resize the columns using best fit, sometimes, depending on how many columns you have, an empty column shows up filling the space between your last column and the radgrids right boundary.  How is this done?  I am trying to achieve the same effect using columns with HeaderWidths specified.  Do I just add an empty GridTemplateColumn?
Angel Petrov
Telerik team
 answered on 26 Jun 2013
2 answers
206 views
Hi,

To reproduce problem just add 3 columns to grid and paste code below to Load event.

private void Form1_Load(object sender, EventArgs e)
{
    DataTable dt = new DataTable();
    dt.Columns.Add("d1", typeof(Decimal));
    dt.Columns.Add("d2", typeof(Decimal));
 
    dt.Rows.Add(new object[] { 3, 4 });
    dt.Rows.Add(new object[] { 1, 4 });
    dt.Rows.Add(new object[] { 0, 3 });
    dt.Rows.Add(new object[] { 3, 3 });
 
    radGridView1.Columns[0].FieldName = "d1";
    radGridView1.Columns[0].HeaderText = "d1";
    radGridView1.Columns[0].Name = "d1";
 
    radGridView1.Columns[1].FieldName = "d2";
    radGridView1.Columns[1].HeaderText = "d2";
    radGridView1.Columns[1].Name = "d2";
 
    radGridView1.Columns[2].HeaderText = "exp";
 
    radGridView1.DataSource = dt;
 
    radGridView1.Columns[2].Expression = "IIF(d1 = 0, 0, d2 / d1 )";
}

Even if we apply the condition that checks divide by zero, program will trow error:
A first chance exception of type 'System.DivideByZeroException' occurred in mscorlib.dll 

I was able to fool the "Expression" by double condition like this:

radGridView1.Columns[2].Expression = "IIF(d1 = 0, 0, d2 / (IIF(d1 = 0, 9999 , d1)))";




Dimitar
Telerik team
 answered on 25 Jun 2013
2 answers
138 views
I want to disable treenode auto-expansion for certain nodes when I drag a treenode .  I tried the DragOverEvent but it did not do what I wanted.  I know the Animation property was not correct, but couldn't find anything else.

Private Sub tvwSetup_DragOverNode(sender As Object, e As RadTreeViewDragCancelEventArgs) Handles tvwSetup.DragOverNode
 
     'disable expansion for nodes with values < 100
     If e.TargetNode.Value < 100 Then tvwSetup.ExpandAnimation = ExpandAnimation.None
End Sub

I've seen a solution for ASP using the "OnClientNodeExpanding" event.  Can such a thing be done in the Winforms treeview?
Brendan
Top achievements
Rank 1
 answered on 25 Jun 2013
0 answers
83 views
While reordering the rows in rad grid the scroll bar is not moving

Example : - 

i'm having 37 rows and scrolling is also shown and 

now see the pic 1 : i'm selecting one row and moving it down

now see the pic 2 : you can see the selected row is visible up to the height of the grid view

now see the pic 3 : if you still move the selected row down, its moving down but the scroll bar is not moving parallel and the selected row is not visible to the user
Manesh
Top achievements
Rank 2
 asked on 25 Jun 2013
9 answers
356 views
Hi,
    I want to reorder the rows within a grid with few condition. For example, i have 10 records in the grid.
The first 2 records should not reordered.
From the 3rd to 10th record, they can be re ordered between themselves and not with record 1 and 2. How should i acheive this?
Is there any event to handle the Reorder event?
Manesh
Top achievements
Rank 2
 answered on 25 Jun 2013
2 answers
206 views
Hi, I have a problem and can't find a solution for it:
I have this code that should add a new page to the ...UI.Docking.DocumentWindow on Form1. If I use it on a button on Form1 works fine, but if I try to call it from Form2 the code runs through and show's the messageBox on the end but it doesn't add the page, here's the code:

private void mNextP1_Click(object sender, EventArgs e)
{
    string txt = File.ReadAllText("c:\\1.html");
    string style = File.ReadAllText("c:\\styles.css");
 
    Form f = new Form();
    f.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
    f.Dock = DockStyle.Fill;
    WebBrowser wb = new WebBrowser();
    wb.DocumentText = "";
    wb.Dock = DockStyle.Fill;
    doc = wb.Document.DomDocument as IHTMLDocument2;
    doc.designMode = "On";
    doc.write(txt);
    IHTMLStyleSheet styleSheet = doc.createStyleSheet("", 0);
    styleSheet.cssText = style;
 
    f.Controls.Add(wb);
 
    DocumentWindow dw = new DocumentWindow();
    f.TopLevel = false;
 
    dw.Controls.Add(f);
    f.Show();
    dw.Text = "Contents";
    radDock1.AddDocument(dw);
    radDock1.ActiveWindow = dw;
 
    MessageBox.Show("Done");
}
This one works just fine, but here comes the problem:
I have this on my form2:
Form1 form1 = new Form1();
form1.newBlankProject();

and the code for "form1.newBlankProject();" is the same as above, but for some reason it only show's the messagebox with the text "Done2" and nothing else happens. Here's the code for that one too:

public void newBlankProject()
{
    string txt = File.ReadAllText("c:\\1.html");
    string style = File.ReadAllText("c:\\styles.css");
 
    Form f = new Form();
    f.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
    f.Dock = DockStyle.Fill;
    WebBrowser wb = new WebBrowser();
    wb.DocumentText = "";
    wb.Dock = DockStyle.Fill;
    doc = wb.Document.DomDocument as IHTMLDocument2;
    doc.designMode = "On";
    doc.write(txt);
    IHTMLStyleSheet styleSheet = doc.createStyleSheet("", 0);
    styleSheet.cssText = style;
 
    f.Controls.Add(wb);
 
    DocumentWindow dw = new DocumentWindow();
    f.TopLevel = false;
 
    dw.Controls.Add(f);
    f.Show();
    dw.Text = "Contents";
    radDock1.AddDocument(dw);
    radDock1.ActiveWindow = dw;
 
    MessageBox.Show("Done2");
}

Probably is just a stupid mistake on my part, but I can't figure out what the problem may be, any help or ideas are appreciated,

Thanks,
Z


Szabolcs
Top achievements
Rank 1
 answered on 25 Jun 2013
3 answers
157 views
I have juste installed the new version of RadControl for Winform and I have notice a little issue with the VisualStudio 2010 add-in.

There is no more menu for adding a RadForm to a Project, upgrading a Project to the new version of assembly, etc. In fact, there is only a "About" item in the menu.

It's not painfull to update the references by hand but theses Tools where nice to have !


Missing User
 answered on 25 Jun 2013
3 answers
209 views

I am trying to use the combo in virtual mode, but am getting poor performance.  If I arrow down while focus is in the text box, it responds OK, but if I click the drop down button it takes quite a while to respond.   

Sample code follows.  Any ideas?

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
 
        radMultiColumnComboBox1.EditorControl.EnableSorting = false;
        radMultiColumnComboBox1.EditorControl.EnableFiltering  = false;
        radMultiColumnComboBox1.EditorControl.EnableGrouping = false;
 
    }
 
 
    private void Form1_Load(object sender, EventArgs e)
    {
 
        radMultiColumnComboBox1.EditorControl.VirtualMode = true;
        radMultiColumnComboBox1.EditorControl.CellValueNeeded += new Telerik.WinControls.UI.GridViewCellValueEventHandler(EditorControl_CellValueNeeded);
        radMultiColumnComboBox1.EditorControl.ColumnCount = 2;
        radMultiColumnComboBox1.EditorControl.RowCount = 2000;
 
 
 
    }
 
    void EditorControl_CellValueNeeded(object sender, Telerik.WinControls.UI.GridViewCellValueEventArgs e)
    {
        e.Value = e.RowIndex.ToString() + "," + e.ColumnIndex.ToString();
    }
}
Peter
Telerik team
 answered on 25 Jun 2013
3 answers
277 views

I have a scenario with two RagGridView, I need select 5 rows at RadGridView1 to drop at RadGridView2.

1 - Selected the 5 rows and release the button.
2 - Now I was press the left button again at one these 5 selected row to make the drag. At this moment all the rows was unselect. 

This is a different behavior from Windows Explorer and the comon multiselect lists.


Stefan
Telerik team
 answered on 25 Jun 2013
1 answer
102 views
I use VisualStudio2012Light theme.
how can i remove space between StatusStrip and radform like VisualStudio2012.

please. help me.



Paul
Telerik team
 answered on 25 Jun 2013
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
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?