Telerik Forums
UI for WinForms Forum
1 answer
146 views
im populating a data gridview from a sql table and once the information is in the grid view i want to take the average of the 5th row called TotalTime i need the average time it takes to build the product and put it in to a text box and put it in to a text box labeled Tb_AverageTime
my code so far
string _connStr = "Server = ESIDC2\\ALLORDERS,62800; User ID=sa; password=Sysadmin1;Database=ESIVENTURES";
            using (SqlConnection conn = new SqlConnection(_connStr))
            {

                conn.Open();
                string sql = "SELECT AssemblyWhen, AssemblyWho, AssemblyDevID, AssemblyTimeLength FROM ESI_AssemblyTime WHERE AssemblyDevID = 'AOS-1';";
                SqlDataReader rdr = new SqlCommand(sql, conn).ExecuteReader();

                if (!rdr.HasRows)
                {
                    rdr.Close();
                    // ADD WHAT TO DO WHEN THERE IS NO DATA
                    MessageBox.Show("No Data");
                }
                if (rdr.HasRows)
                {
                    rdr.Read();
                    while (rdr.Read())
                    {
                        if ((rdr["AssemblyWhen"] != DBNull.Value) && (rdr["AssemblyWho"] != DBNull.Value) && (rdr["AssemblyDevID"] != DBNull.Value) && (rdr["AssemblyTimeLength"] != DBNull.Value))
                        {

                            GridViewInfo info = new GridViewInfo(Aos1_GridView.MasterTemplate);
                            GridViewDataRowInfo rowInfo = new GridViewDataRowInfo(info);
                            rowInfo.Cells["PartName"].Value = rdr["AssemblyDevID"].ToString();
                            rowInfo.Cells["DateMade"].Value = rdr["AssemblyWhen"].ToString();
                            rowInfo.Cells["Employee"].Value = rdr["AssemblyWho"].ToString();
                            rowInfo.Cells["TotalTime"].Value = rdr["AssemblyTimeLength"].ToString();
                            Aos1_GridView.Rows.Add(rowInfo);
                            TB_PartsDone.Text = Aos1_GridView.Rows.Count.ToString();

                        }

                    }
                }
            }
        }
Stefan
Telerik team
 answered on 16 Jul 2012
3 answers
222 views
Hi support,

Is it possible to select a group, right-click or press the delete key, and all the lines in that group will be deleted?

Example:
GROUP1
    SUBGROUP A
        SUBSUBGROUP i
            row i1
            row i2
            row i3
        SUBGROUP ii
            row ii1
            row ii2
            row ii3
    SUBGROUP B
....

The user select SUBSUBGROUP i in the row header and press delete and the rows row i1, row i2, row i3 will be deleted.

Regards,
Nadia
Stefan
Telerik team
 answered on 16 Jul 2012
1 answer
238 views
Hi

I need put the size of the command bar to 100%.

Is there any property to do this?

Thanks,
Stefan
Telerik team
 answered on 16 Jul 2012
1 answer
554 views
Hello guys i have a problem regarding my RadButtonElement.
I have this RadButtonElement inside my GridViewCommandColumn.
here is my Code:
Private Sub rgvSKUDetails_CommandCellClick(sender As System.Object, e As System.EventArgs) Handles rgvSKUDetails.CommandCellClick
       If TypeOf rgvSKUDetails.CurrentRow Is Telerik.WinControls.UI.GridViewNewRowInfo Then
           Exit Sub
       End If
       rgvSKUDetails.Rows.RemoveAt(rgvSKUDetails.CurrentRow.Index)
   End Sub

I was Expecting that this CommandcellClick event will fire the.

Public Sub rgvSKUDetails_UserDeletingRow(sender As System.Object, e As Telerik.WinControls.UI.GridViewRowCancelEventArgs) Handles rgvSKUDetails.UserDeletingRow
Msgbox("Why Did you delete it?")
'This section here, im supposed to update the database that the
record has been deleted, but since this event is not firing is
there anyway that i could capture the event so i could update the database
that the user deleted the record?
'Perform Update to database
End Sub
i needed it because i want to update the database that the particular row was deleted by the user.

Thanks IMO
Nikolay
Telerik team
 answered on 16 Jul 2012
1 answer
227 views
Hi, 

I would be interested in a product like vlc or wmp. Both have their own issues.., and having telerik putting a tool like this on the market with all of your experience and support would make me jump in quadric circles.

Karl
Stefan
Telerik team
 answered on 16 Jul 2012
1 answer
241 views
In the ASP.Net controls you are able to set the control up so that the control times are within a certain range. IE times from 8am through to 6pm and users can only select these values from the drop down.

Is this possible in the winforms timepicker control? If it is, how is it done?

Thanks,
Karl
Stefan
Telerik team
 answered on 16 Jul 2012
2 answers
559 views
Hi all,

I use grouping in my grid view. What I want to achieve is when the user changes the current row by clicking or pressing up/down arrow the grid view will show the information about the current row using text boxes but if the current row is a group header the grid view won't perform any action.

Is there any way to identify that the current row is a group header so that I can achieve this scenario? 

Thanks
David
Top achievements
Rank 1
 answered on 16 Jul 2012
3 answers
216 views
Hello,

I want to give a different format to some rows (based on a property of the databound items). It works good, but some rows decide, on they own, to use a special format.

If I use only one BackColor and a solid GradientStyle, the problem do not appear (but linear Gradient looks far better. Isn't it?)

Should I have miss something or it's bug ?

Private Sub dgv_Clients_RowFormatting(sender As System.Object, e As Telerik.WinControls.UI.RowFormattingEventArgs) Handles dgv_Clients.RowFormatting

Dim ClientBound As Client = TryCast(e.RowElement.Data.DataBoundItem, Client)
If ClientBound IsNot Nothing AndAlso Helper.ActiveDirectoryHelper.GetInstance.GetCurrentUser.Guid.Equals(ClientBound.FK_OwnerUser) Then
e.RowElement.DrawFill = True
e.RowElement.BackColor = Color.Red
e.RowElement.BackColor2 = Color.White
e.RowElement.BackColor3 = Color.White
e.RowElement.BackColor4 = Color.White
e.RowElement.GradientStyle = GradientStyles.Linear
e.RowElement.GradientAngle = 360
Else
e.RowElement.ResetValue(LightVisualElement.DrawFillProperty, ValueResetFlags.Local)
e.RowElement.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local)
e.RowElement.ResetValue(LightVisualElement.BackColor2Property, ValueResetFlags.Local)
e.RowElement.ResetValue(LightVisualElement.BackColor3Property, ValueResetFlags.Local)
e.RowElement.ResetValue(LightVisualElement.BackColor4Property, ValueResetFlags.Local)
e.RowElement.ResetValue(LightVisualElement.GradientStyleProperty, ValueResetFlags.Local)
e.RowElement.ResetValue(LightVisualElement.GradientAngleProperty, ValueResetFlags.Local)
End If
End Sub

 

Marco
Top achievements
Rank 2
Veteran
 answered on 16 Jul 2012
5 answers
231 views
Two questions / issues.  Easy one first.

a)  How do I control the alignment of the checkbox that appears in a ListViewDataItem?  It seems stuck in the middle and I'd like to align it with my text.

b) I'm creating custom ListViewDataItems, as I need to add a "legend" to each drop down.  Here's the sample code I'm using...

First, the code in _VisualItemCreating

private void rlvLegend_VisualItemCreating(object sender, ListViewVisualItemCreatingEventArgs e)
{
    e.VisualItem = new LegendCustomVisualItem();   
}

Second, the override of CreateChildElements

protected override void CreateChildElements()
{
    base.CreateChildElements();
    this.stackLayout = new StackLayoutPanel();
    this.stackLayout.Orientation = Orientation.Vertical;
    this.stackLayout.EqualChildrenWidth = true;
 
    //Header space
    this.p1 = new RadPanelElement();
    p1.AutoSize = true;
    p1.MinSize = new Size(200, 20);
    p1.NotifyParentOnMouseInput = true;
    p1.ShouldHandleMouseInput = false;
    p1.PanelBorder.Visibility = ElementVisibility.Hidden;
    this.stackLayout.Children.Add(p1);
 
    this.stackLayout.Children.Add(new LegendCustomStack("Test 1", Color.Red, Color.Red));
    this.stackLayout.Children.Add(new LegendCustomStack("Test 2", Color.Blue, Color.Red));
    this.stackLayout.Children.Add(new LegendCustomStack("Test 3", Color.Aquamarine, Color.Red));
    this.stackLayout.Children.Add(new LegendCustomStack("Test 4", Color.DimGray, Color.Red));
 
    this.Children.Add(this.stackLayout);
 
}

Lastly, the other items I've created in the last couple lines..

public class LegendCustomStack : StackLayoutPanel
{
    private int _height = 15;
 
    public LegendCustomStack(string labelText, Color fillColor, Color outlineColor)
    {
        //spacer panel
        RadPanelElement p2;
        p2 = new RadPanelElement();
        p2.AutoSize = true;
        p2.MinSize = new Size(25, _height);
        p2.NotifyParentOnMouseInput = true;
        p2.ShouldHandleMouseInput = false;
        p2.PanelBorder.Visibility = ElementVisibility.Hidden;
        this.Children.Add(p2);
 
        RadPanelElement p3 = new RadPanelElement();
        p3.AutoSize = false;
        p3.Size = new Size(_height, _height);
        p3.PanelFill.NumberOfColors = 1;
        p3.PanelFill.BackColor = fillColor;
        p3.PanelBorder.ForeColor = outlineColor;
        p3.NotifyParentOnMouseInput = true;
        p3.ShouldHandleMouseInput = false;
        //p3.Alignment = ContentAlignment.MiddleLeft;
        this.Children.Add(p3);
 
        RadLabelElement l1 = new RadLabelElement();
        l1.Text = labelText;
        l1.NotifyParentOnMouseInput = true;
        l1.ShouldHandleMouseInput = false;
        l1.TextAlignment = ContentAlignment.TopLeft;
        this.Children.Add(l1);
    }
}

When I load up my items, it looks fine, until I have too many that the scroll bars appear.   If I scroll down, everything is fine.  If I scroll up, the LegendCustomStack items seem to jump around randomly from ListDataItem to ListDataItem (sometimes completely disappearing)

(I created a version where, the colours were random to better demonstrate the behavior, but I think I backout out those changes)

Any ideas what I'm doing wrong?

Thanks!!!

Rob.
Ivan Todorov
Telerik team
 answered on 16 Jul 2012
3 answers
241 views
Hi,

I have just updated to the latest version (RadControls for WinForms, v.2012.2.608.40) and I am now getting on this line:


chartMarginsTitle1.Bottom = ((Telerik.Charting.Styles.Unit)(resources.GetObject("chartMarginsTitle1.Bottom")));

Warning 1 Object of type 'Telerik.Charting.Styles.Unit' cannot be converted to type 'Telerik.Charting.Styles.Unit'.

Could you tell me what must be changed)

Thank you

Karl



Ivan Petrov
Telerik team
 answered on 16 Jul 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?