Telerik Forums
UI for WinForms Forum
3 answers
194 views

I want to run separate query in each grid view, these grids is located in deferent taps that was created via dock…

Is that possible in rad grid view for win form?

The information I need to add is retrieved from the same DB

Richard Slade
Top achievements
Rank 2
 answered on 23 Mar 2011
2 answers
206 views
string[] strArr = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "A", "B", "C", "D", "E", "F", "21", "22", "23", "24", "25", "26", "27", "2", "3", "4", "5", "6", "7", "8", "9", "10", "A", "B", "C", "D", "2", "3", "4", "5", "6", "7", "8", "9", "10", "A", "B", "C", "D", "2", "3", "4", "5", "6", "7", "8", "9", "10", "A", "B", "C", "D", "2", "3", "4", "5", "6", "7", "8", "9", "10" };
 
private void CreateColumnRow()
        {
            DataTable data = new DataTable();
            data.Columns.Add("1");
            data.Columns.Add("2");
            data.Columns.Add("3");
            data.Columns.Add("4");
            data.Columns.Add("5");
             
            for (int i = 0; i < strArr.Length / 5; i++)
            {
                DataRow dr = data.NewRow();
                data.Rows.InsertAt(dr, 0);
            }
            int intSub = strArr.Length % 5;
            if (intSub > 0)
            {
                DataRow dr = data.NewRow();
                data.Rows.InsertAt(dr, 1);
            }
 
            radGridView1.DataSource = data;
 
            radGridView1.Columns[0].Width = 100;
            radGridView1.Columns[1].Width = 100;
            radGridView1.Columns[2].Width = 100;
            radGridView1.Columns[3].Width = 100;
            radGridView1.Columns[4].Width = 100;
        }
  
private void Form1_Load(object sender, EventArgs e)
        {
              
            CreateColumnRow();
            loadCheckBox();
  
        }
  
private void loadCheckBox()
{
      int z = 0;
      for (int i = 0; i < radGridView1.RowCount; i++)
            {
                for (int j = 0; j < radGridView1.ColumnCount; j++)
                {
                    radGridView1.Rows[i].IsCurrent = true;
                    radGridView1.Columns[j].IsCurrent = true;
                    if (radGridView1.CurrentColumn.Index == j && radGridView1.CurrentRow.Index == i)
                    {
                        RadCheckBoxElement check = null;
                        if (radGridView1.CurrentCell.Children.Count == 0)
                        {
                            check = new RadCheckBoxElement();
                            while (z < strArr.Length)
                            {
  
                                check.Name = "check_" + strArr[z];
                                check.Text = strArr[z];
  
                                radGridView1.CurrentCell.Children.Add(check);
                                z++;
                                break;
                            }
                        }
                        else
                        {
                            check = (RadCheckBoxElement)radGridView1.CurrentCell.Children[0];
                        }
                    }
                    if (z == strArr.Length)
                    {
                        break;
                    }
  
                }
                if (z == strArr.Length)
                {
                    break;
                }
            }
     radGridView1.Rows[0].IsCurrent = true;
     radGridView1.Columns[0].IsCurrent = true;
}

Hello all person in forum!

I send a picture. In picture, i write problem error me. You view my code, you will see code of ( string[] strArr ). If I add ( strArr.lengh < 30 ), this code run OK. Else, it will be problem.

Help me fix it ! Thanks all !
laki
Top achievements
Rank 1
 answered on 23 Mar 2011
3 answers
137 views
Previously I was running the latest 2010 edition of RadControls and had the background color of my TreeViews set to 191 | 219 | 254.  However after updating to Q1 2011, not matter what I set the color to it always shows as white.  I am not sure if this is a bug or if something changed internally.
Richard Slade
Top achievements
Rank 2
 answered on 22 Mar 2011
3 answers
224 views
Hi to everybody.
I have a problem creating a relation between a RadTreeView and a RadGridView.
I add the:
Me.RadTreeViewModelli.RelationBindings.Add(New RelationBinding("ModelloTessuti", Me.TblDBtblDBTessutiBindingSource))

If I bind the tree to a RadListBox the progam works fine, but with a RadGridView the behaviour seems random. Sometimes when I select the node the grid was refresh sometimes not.

Where I wrong?

Alessio
Stefan
Telerik team
 answered on 22 Mar 2011
2 answers
177 views
Hi,

Here is the problem :

I have a binding source (bsCustomers) filled with neccessary data from the database with entity framework.

When i checked the bsCustomers i can see the values are not NULL.
 
My treeview control`s (rtvCustomers) datasource is bsCustomers and I want to assign rtvCustomers.DisplayMember to Name field which is in tbContacts. 

bsCustomer  has --> tbContact.
tbContact has --> Code, Name.

So when i say

this.tvCustomers.RootRelationDisplayName = "Customers";  
this.tvCustomers.DisplayMember = "tbContact.Name";  
thisthis.tvCustomers.DataSource = this.bsCustomers; 

it doesnt work. (In radgridview such assignment ("tbContact.Name") works properly.)

As a solution in NodeCollectionChange

void Nodes_CollectionChanged(object sender, Telerik.WinControls.Data.NotifyCollectionChangedEventArgs e)  
        {  
            if(e.Action==Telerik.WinControls.Data.NotifyCollectionChangedAction.Add)  
            {  
                if (((RadTreeNode)e.NewItems[0]).Level == 0)  
                    return;  
                ((RadTreeNode)e.NewItems[0]).Text = ((Customer)this.bsCustomers[e.NewStartingIndex]).tbContact.Name;  
            }  
        } 

and it worked. I filled the treeview with customer Names. But i guess there must be another solution.

So is there any other solution to get treeview filled with Names?

Thanks.


Stefan
Telerik team
 answered on 22 Mar 2011
2 answers
128 views
I am using a radtreeview bound to a dataset having multiple levels of hierarchy. See attached file radtreeview.gif.

With AllowEdit=True, I press F2, and edit the text. Then when I hit the enter or escape key, the radtreeview crashes with the an exception "Index -1 does not have a value". See attached file radtreeviewError1.gif

I noticed that this exception is only thrown for the nodes that do not have children. For nodes having children, it works fine.

Also I tried to programmatically edit using a context menu and context menu manager. However the same exception is thrown. My code is pasted below.
-----------------------------------------------------------------------------------------------------------
private void radMenuItemEdit_Click(object sender, EventArgs e)
{
            RadTreeNode node = territoryRadTreeView.SelectedNode;

            if (node != null)
            {
                territoryRadTreeView.AllowEdit = true;
                node.BeginEdit();
            }
        }
-----------------------------------------------------------------------------------------------------------

The version I have is, RadControls for WinForms Q2 2009 SP1.
I am stuck on this issue for the last 2 days and any help will be appreciated.

Thanks
Stefan
Telerik team
 answered on 22 Mar 2011
4 answers
158 views
Hi,

I was just wondering if there was any reason there are no overrides when instantiating a RadTreeNode to set BOTH the TEXT value AND Name Value of the node?

So lets say I wanna create a array of RadTreeNode from some data I have, since there just a constructor having the text (and others but still no NAME property) I have to loop through them to set one by one their name value...


Thanks :)
Stefan
Telerik team
 answered on 22 Mar 2011
2 answers
155 views
Hi!

Working with treeview I encountered some problems:

1. How can i override the default context menu methods (like add and delete)
2. My data structure is a decision tree made out of nodes, where each node has child nodes in an array. Is there an elegant way
   to bind my data structure with the tree view?
Stefan
Telerik team
 answered on 22 Mar 2011
8 answers
161 views
I have a treeview and after adding a node, I want to select that node.  The tree is databound.   I am trying to implement the FindByTextCommand, but am having troubles.  Can you supply sample code on the implementation. 

Thanks
Stefan
Telerik team
 answered on 22 Mar 2011
2 answers
167 views
I am using WinForms Q2 2010 SP2 (v2010.2.10.0914)

I have a form with a gridview and a save button outside gridview.  The gridview has a commandcell column with dynamically generated command buttons to open another form.  When the row gets modified, click the save button will save the grid data into database.

If I modified the data and clicked the commandcell button, without leaving the row, then click the save button outside gridview.  It will stop working.  It seems that the dataset bounded to the grid donsn't get the row state changed to modified.

My work around is to force the row change by setting Radgridview1.CurrentRow to first or last row in the save button click event.  Wonder if this is a known issue.  Is there any better solution.  My work around will fail if there is only one row in the grid.

Thanks.
Stefan
Telerik team
 answered on 22 Mar 2011
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
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
VirtualGrid
Toolstrip (obsolete as of Q3 2010)
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
SplitContainer
Documentation
Map
DesktopAlert
CheckedDropDownList
ProgressBar
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
CollapsiblePanel
LayoutControl
ShapedForm
SyntaxEditor
Wizard
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
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?