Telerik Forums
UI for WinForms Forum
1 answer
192 views
I need to use manual crud in my context.

How do I get the values of the cells in the row being update.

private void radGridView1_CellEndEdit(object sender, Telerik.WinControls.UI.GridViewCellEventArgs e)
        {
            //TextBox t1 = RadGridView1.MasterGridViewInfo.CurrentRow.Cells("Company").Value.ToString();
            //TextBox t2 = RadGridView1.MasterGridViewInfo.CurrentRow.Cells("something").Value.ToString
 
             
             
             {
                 using (var cn = new SqlConnection(connString))
                 {
                     cn.Open();
                     try
                     {
                         SqlCommand cmd = new SqlCommand("UPDATE myTable SET Column = @Parm1 WHERE Col = @Parm2", cn);
                         var parm1 = cmd.CreateParameter("Parm1");
                         parm1.Value = t1.Text;
                         var parm2 = cmd.CreateParameter("Parm2");
                         parm2.Value = t2.text;;
                         cmd.Parameters.Add(parm1);
                         cmd.Parameters.Add(parm2);
                         int rowsAffected = cmd.ExecuteNonQuery();
                     }
                     catch (SqlException ex)
                     {
                         //MessageBox.Show(ex.StackTrace);
                     }
                 }
             
             }
        }

1) The first two lines of code above is what I use to implement in radgrid for asp. How do I get those values in this context winforms?
2) I also have added a delete button column. I do I code the event to delete the row where the button is clicked?

Thanks
Dimitar
Telerik team
 answered on 28 Oct 2014
5 answers
113 views
Sorry for asking such simple think but for some reasons I am not coming right.
I have a dropdownList that gets populated with the table names: 

public  void FillDropDownList(string connString)
        {
            String Query = "SELECT * FROM information_schema.tables where Table_Name like 'Table%'";
            using (var cn = new SqlConnection(connString))
            {
                cn.Open();
                DataTable dt = new DataTable();
                try
                {
                    SqlCommand cmd = new SqlCommand(Query, cn);
                    SqlDataReader myReader = cmd.ExecuteReader();
                    dt.Load(myReader);
                }
                catch (SqlException e)
                {
                   //TODO
                }
                radDropDownList1.DataSource = dt;
                radDropDownList1.ValueMember = "TABLE_NAME";
                radDropDownList1.DisplayMember = "TABLE_NAME";
            }
        }

On selectedIndexChanged of the DropDownList I need to fill in the GridView preserving all functionalities (add, update, delete). Basically the table gets choose at runtime. I am not coming right with this and I would appreciate if can point me to a solution or give me a snippet for this.

Thanks
Dimitar
Telerik team
 answered on 28 Oct 2014
9 answers
168 views
I wonder how to edit Node text, currently F2 edit all the Node and not only Node text:

radTreeView1.AllowEdit = true;
radTreeView1.BeginEdit();
RadTreeNode ethernetNode = radTreeView1.Nodes.Add("Ip address: 0.0.0.0");

Note that i am not using bound but just regular node creation like in my code example, please see my screenshot, can i edit only my text ? (in my example this is 0.0.0.0)
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 28 Oct 2014
1 answer
140 views
I have a loaded Gridview with multiple GridViewColumnGroups and I am trying to use SaveLayout/LoadLayout unsuccessfully. I have read ALL the documentation concerning the RadGridView Serialization API but somehow I can't figure out how or even if it's possible.

Can someone shed some light? I'm getting ready to jump out my window!

Thanks!
Stefan
Telerik team
 answered on 28 Oct 2014
2 answers
156 views
Is there a control for WinForms or a way of constructing "Switch" type buttons as below within Telerik ?



Thanks

Terry
Stefan
Telerik team
 answered on 28 Oct 2014
5 answers
638 views
I'm trying to add 40 rows in a grid programmaticly like this :

try 
{  
this.Cursor = Cursors.WaitCursor;  
grdSearchResults.SuspendUpdate();  
 
//remove all filters  
foreach (GridViewDataColumn dc in grdSearchResults.MasterGridViewTemplate.Columns)  
  dc.Filter.StringValue = string.Empty;  
 
//add new pax to current manifest  
for (int i = 0; i < nb; i++)  
  paxList.AddNew();  
 
UpdateScreenState();  
 
grdSearchResults.Rows[paxList.Count - nb].IsCurrent = true;  
grdSearchResults.Columns[0].IsCurrent = true;  
grdSearchResults.GridElement.ScrollToRow(0);  
if (grdSearchResults.CurrentCell != null)  
  ((GridDataCellElement)grdSearchResults.CurrentCell).BeginEdit();  
}  
catch (Exception exc)  
{  
  ExceptionPolicy.HandleException(exc, "Client Policy");  
}  
finally 
{  
  this.Cursor = Cursors.Default;  
  grdSearchResults.ResumeUpdate();  

when adding let say 30 rows (nb=30) the grid is extremely slow. Is there something i should do to fasten things up?

I've tried using 

grdSearchResults.GridElement.BeginUpdate();

instead of SuspendUpdate but the grid throws an argument out of range exception stating that Value is out of range???

George
Telerik team
 answered on 28 Oct 2014
6 answers
67 views
I have an application and i used Telerik rad controls in this app , in RadGrid i want to add a column that have a combo and another column that have a button , user select an action in combo (such as edit/delete/update record status ) and push the button and then system do the action , but i cant add a combo with this situation in RadGrid
please help
thanks
Dimitar
Telerik team
 answered on 27 Oct 2014
5 answers
161 views
Hi All, 

I have Telerik grid view that has a view definition, and i need to export it to excel sheet, i succeeded to export the grid to excel sheet but it was exported without its View Definition. 

Is there any way to export Telerik grid with its view definition to excel file ??

Thanks In Advance :) 
Stefan
Telerik team
 answered on 26 Oct 2014
3 answers
55 views
I am using the RadMaskedTextBox for a phone number input.  For my situation, when a different country is selected, I am dynamically creating the mask to include the country code.  The behavior I would prefer would be that when the user starts to input numbers, the country code would be ignored.  This works great if the user starts with a number different then the country code.  But, if the user starts with the same number as the country code, the carat only moves through the mask.

To illustrate further.  If the mask is this:  +56 _____________  , and I start typing a phone number that doesn't start with 5, such as 345, the box will look like this : +56 345_______  .   This is fine, and what I would expect.

If, however, I would start typing and the input starts with 5, such as 595, the box will look like this:  +56 95____________ .

This is because the first 5 is being "eaten up" by the mask.   Is there an easy way to disable the mask from "eating up" this input?

Thank you!
Dimitar
Telerik team
 answered on 24 Oct 2014
5 answers
519 views
I want to change backcolour of the radgrid while printing the panel which contains this particular grid.
On click of print button , the grid backcolour should be none in the page being printed.
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 24 Oct 2014
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
Styling
Barcode
BindingNavigator
PopupEditor
RibbonForm
TaskBoard
Callout
ColorBox
PictureBox
FilterView
NavigationView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
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
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?