Telerik Forums
UI for WinForms Forum
3 answers
247 views
Hello experts!

I have an application where there are 2 treeviews, each one is in a tab item.
When I do a double click in one of the nodes of the second treeview, the application search for it's twin in the first node and show some information in the form.
The application is finding the node, is expanding the treeview and scrolling to show the node (I'm using treeview1.bringintoview(node) functionality). But I need to the node get's highlighted as if it was selected with the mouse.

Please help me with this, I've worked on this for hours and can't get any solution. I've also used the treevie1.setfocus(node), but it doesn't work.

Thanks in advance.
Nikolay
Telerik team
 answered on 23 Jul 2009
1 answer
230 views
Hi

We have a tool strip with 4 buttons on all with an image and text, after we upgraded to the new version of the win controls a while a go 3 of the buttons started displaying incorrectly. The text is slightly overlapping the image.
For some reason the remaining button is fine.

Do you have any idea why it would do this, I have tried changing all the alignment and position settings but I cant get them to sit side by side properly?

Thanks

Bex
Bex
Top achievements
Rank 1
 answered on 23 Jul 2009
5 answers
298 views
Hello,

I put some data in my RadChart thanks to a datatable.

My data is  integers like '12000'', 50000', '100000' and represents milliseconds time.

Then, in my Bar Chart, that display bars, and my YAxis Label display '0', '20000',... and I want to display this number in this format : hh:mm:ss:fff

How can I do ?

Regards,

YSP


Giuseppe
Telerik team
 answered on 23 Jul 2009
12 answers
927 views
I saw an example on how to replace the default RadGridView context (right-click) menu with a "user"-defined context menu. But how do I add items to the default menu.

VB .NET code only, please.

Finn
Nikolay
Telerik team
 answered on 23 Jul 2009
1 answer
189 views
Hi,
   I have a radgridview with the theme set to vista. It seems this and the default theme has column gridlines but no row ones.

How can I enable this at design time?

To give an idea of what i mean think excel sheet.
Thanks.
Boryana
Telerik team
 answered on 23 Jul 2009
7 answers
433 views
Hello,
how can I display my own combobox values in an unbound RadGridView when editing? The values are not specific to any columns or rows, in my scenario each cell can have completely different combobox values to offer (some can be even edited as free text or as numeric value).

Thanks in advance for your support
ZS
Jack
Telerik team
 answered on 23 Jul 2009
3 answers
274 views

Hi,

I am trying out the GridView in a programmatically manner, to build a hierarchy of an exception tree.  I don’t know if my approach is the best way, please tell if otherwise. The hierarchy is shown, but there are two issues I can’t figure out.

First, Due to the relationship all rows are shown as expandable! Only the root exception row and the InnerException row should be expandable. I have tried setting the ParentID to zero for those rows that are not expandable, but then they are not shown at all?

Second, In the expanded (nested) grid two tabs appear (named; table1 and table2), how do I remove/hide those?

Cheers, Frank

---------------------------- Sample Code -------------------------

  public class ExceptionExplorer
  {
    private static readonly string FIELD_EXCEPTIONID = "ExceptionID";
    private static readonly string FIELD_PARENTID = "ParentID";
    private static readonly string FIELD_NAME = "Name";
    private static readonly string FIELD_VALUE = "Value";

    public void ShowData(RadGridView gridView)
    {
      gridView.AutoGenerateHierarchy = false;
      gridView.AllowDrop = false;
      gridView.ShowGroupPanel = false;
      gridView.ShowNoDataText = false;
      
      try
      {
        gridView.Enabled = false;
        gridView.GridElement.BeginUpdate();
        gridView.Rows.Clear();

        List<Exception> exceptions = new List<Exception>();
        exceptions.Add(new ArithmeticException("ArithmeticException", new DataMisalignedException("DataMisalignedException", new global::System.NotSupportedException("NotSupportedException", new NotImplementedException("NotImplementedException")))));
        exceptions.Add(new ArgumentOutOfRangeException("ArgumentOutOfRangeException", new NullReferenceException("NullReferenceException", new global::System.NotSupportedException("NotSupportedException", new NotImplementedException("NotImplementedException")))));

        PrepareGridViewTemplate(gridView.MasterGridViewTemplate);
        int exceptionID = 0;
        foreach (Exception exception in exceptions)
        {
          ShowException(gridView.MasterGridViewTemplate, null, ref exceptionID, 0, exception.GetType().Name, exception);
        }
      }
      finally
      {
        gridView.GridElement.EndUpdate();
        gridView.Enabled = true;
      }
    }

    private void ShowException(GridViewTemplate gridviewTemplate, GridViewDataRowInfo parentRow, ref int exceptionID, int parentID, string exceptionTitle, Exception exception)
    {
      GridViewDataRowInfo exceptionRow = CreateGridRow(gridviewTemplate, parentRow, ++exceptionID, parentID, exceptionTitle, exception.GetType().FullName);

      parentID = exceptionID;
      GridViewTemplate childGridViewTemplate = CreateChildGridViewTemplate(gridviewTemplate);

      CreateGridRow(childGridViewTemplate, exceptionRow, ++exceptionID, parentID, "Message", exception.Message);
      CreateGridRow(childGridViewTemplate, exceptionRow, ++exceptionID, parentID, "Source", exception.Source);
      CreateGridRow(childGridViewTemplate, exceptionRow, ++exceptionID, parentID, "HelpLink", exception.HelpLink ?? string.Empty);
      CreateGridRow(childGridViewTemplate, exceptionRow, ++exceptionID, parentID, "TargetSite", exception.TargetSite == null ? string.Empty : exception.TargetSite.ToString());
      CreateGridRow(childGridViewTemplate, exceptionRow, ++exceptionID, parentID, "Stacktrace", exception.StackTrace);

      if (exception.InnerException != null)
      {
        ShowException(childGridViewTemplate, exceptionRow, ref exceptionID, parentID, "InnerException", exception.InnerException);
      }
    }

    private GridViewDataRowInfo CreateGridRow(GridViewTemplate gridviewTemplate, GridViewDataRowInfo parentRow, int exceptionID, int parentID, string nameColumn, string valueColumn)
    {
      //      GridViewDataRowInfo dataRow = gridviewTemplate.Rows.AddNew(/*parentRow*/); // Gives NullReferenceException...
      //      GridViewDataRowInfo dataRow = gridviewTemplate.Rows.AddNew();
      //      dataRow.Cells[FIELD_EXCEPTIONID].Value = exceptionID.ToString();
      //      dataRow.Cells[FIELD_PARENTID].Value = parentID.ToString();
      //      dataRow.Cells[FIELD_NAME].Value = nameColumn;
      //      dataRow.Cells[FIELD_VALUE].Value = valueColumn;
      // Gives NullReferenceException if cells are addressed through index/name ???

      GridViewDataRowInfo dataRow = gridviewTemplate.Rows[gridviewTemplate.Rows.Add(exceptionID, parentID, nameColumn, valueColumn)];
      dataRow.EnsureVisible();

      return dataRow;
    }

    private void PrepareGridViewTemplate(GridViewTemplate gridviewTemplate)
    {
      gridviewTemplate.AutoGenerateColumns = false;

      GridViewDataColumn gridColumn;
      gridviewTemplate.Columns.Add(gridColumn = new GridViewDataColumn(FIELD_EXCEPTIONID));
      gridColumn.IsVisible = false;
      SetColumnDefaults(gridColumn);

      gridviewTemplate.Columns.Add(gridColumn = new GridViewDataColumn(FIELD_PARENTID));
      gridColumn.IsVisible = false;
      SetColumnDefaults(gridColumn);

      gridviewTemplate.Columns.Add(gridColumn = new GridViewDataColumn(FIELD_NAME));
      gridColumn.Width = 200;
      SetColumnDefaults(gridColumn);

      gridviewTemplate.Columns.Add(gridColumn = new GridViewDataColumn(FIELD_VALUE));
      gridColumn.MinWidth = 200;
      SetColumnDefaults(gridColumn);

      gridviewTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;

      gridviewTemplate.AllowAddNewRow = false;
      gridviewTemplate.AllowDeleteRow = false;
      gridviewTemplate.AllowEditRow = false;
      gridviewTemplate.AllowColumnChooser = false;
      gridviewTemplate.AllowColumnReorder = false;
      gridviewTemplate.AllowDragToGroup = false;

      gridviewTemplate.ShowColumnHeaders = gridviewTemplate.Owner.MasterGridViewTemplate == gridviewTemplate;
      gridviewTemplate.ShowFilteringRow = false;
      gridviewTemplate.ShowGroupedColumns = false;
    }

    private GridViewTemplate CreateChildGridViewTemplate(GridViewTemplate parentTemplate)
    {
      GridViewTemplate childTemplate = new GridViewTemplate(parentTemplate.Owner);
      PrepareGridViewTemplate(childTemplate);

      GridViewRelation relation = new GridViewRelation(parentTemplate);
      relation.ChildTemplate = childTemplate;
      relation.RelationName = "ExceptionRelation";
      relation.ParentColumnNames.Add(FIELD_EXCEPTIONID);
      relation.ChildColumnNames.Add(FIELD_PARENTID);
      parentTemplate.Owner.Relations.Add(relation);

      parentTemplate.ChildGridViewTemplates.Add(childTemplate);

      return childTemplate;
    }

    private void SetColumnDefaults(GridViewDataColumn gridColumn)
    {
      gridColumn.HeaderText = gridColumn.FieldName;
      gridColumn.AllowFiltering = false;
      gridColumn.AllowGroup = false;
      gridColumn.AllowSort = false;
    }
  }

Jack
Telerik team
 answered on 23 Jul 2009
1 answer
250 views

Requirements

 

.Net Framework

3.5

Visual Studio version

2008 

Programming Language

C#


PROJECT DESCRIPTION
Only an example of using Linq to SQL with the Datagrid control

 

DataClasses1DataContext db = new DataClasses1DataContext();

 

 

var query = from p in db.Mst_Reconcilations

 

 

where p.Pat_Last_Name.StartsWith("A") && p.Pat_First_Name.StartsWith("C")

 

 

select new CustomerOrderResult

 

{

ID = p.ID,

AccNo = p.Acc_No,

CharNo = p.Chg_No,

FName = p.Pat_First_Name,

LName = p.Pat_Last_Name,

DOS = p.DOS

};

dataGridView1.DataSource = query;

dataGridView1.Columns[0].Visible =

false;

 

Vassil Petev
Telerik team
 answered on 23 Jul 2009
7 answers
210 views
What is the best way to prevent editing of primary key column(s) in the data grid?  I do not want the user to edit existing primary key column(s), however, I do want them to be able to edit the primary key column(s) when adding a new row.

Thanks for your help in advance,

James
Jack
Telerik team
 answered on 23 Jul 2009
3 answers
142 views
Hello,
  I am new to Telerik winforms controls. I have a RadGridView consisting of  a GridViewComboBoxColumn. I want to display images
within the combo-box, and when a selection is made, I want the selection text box of the combo-box to also display the image, not
just the text associated with it.

Also, I want to be able to implement the DblClick on the combo-box so that the images will rotate through the list
of images.

Can I accomplish this using a GridViewComboBoxColumn, or do I have to add a custom element to the grid cells?
I have been combing through the examples and forums, but have not been successful in implementing this functionality.

Thanks in advance,

Adriana

Victor
Telerik team
 answered on 23 Jul 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
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
SyntaxEditor
Wizard
CollapsiblePanel
LayoutControl
ShapedForm
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?