Telerik Forums
UI for WPF Forum
2 answers
253 views

Hello everybody.
I have a RadGridView  whith three column teo of whic are displayed and edited using cell templates with a radComboBox and a TextBox

The following is the XAML code

<telerik:RadGridView x:Name="radGridDiscounts"  HorizontalAlignment="Left" Height="150" Width ="500" AutoGenerateColumns="False" ShowGroupPanel="False" MultipleSelect="False" ColumnsWidthMode="Fill" ItemsSource=""> 
    <telerik:RadGridView.Columns
        
<telerik:GridViewDataColumn Header="Descrizione" HeaderTextAlignment="Center" Width="200"
             DataMemberBinding="{Binding Description}" IsReadOnly="True" IsFilterable="False" />
       
<telerik:GridViewDataColumn Header="Tipologia sconto" HeaderTextAlignment="Center" Width="120" IsFilterable="False">
            <
telerik:GridViewColumn.CellTemplate>
                <DataTemplate>
                    <telerik:RadComboBox x:Name="radComboOperations"                                                                  
                                                              SelectionChanged
="radComboOperations_SelectionChanged   Loaded="radComboOperations_Loaded"
                                                              DisplayMemberPath
="Description" SelectedValuePath="Id"/>
                
</DataTemplate>
           
</telerik:GridViewColumn.CellTemplate>
      </telerik:GridViewDataColumn>
      <telerik:GridViewDataColumn Header="Valore" HeaderTextAlignment="Center" Width="75" IsFilterable="False" IsSortable="False"
        
<telerik:GridViewColumn.CellTemplate>
            <DataTemplate>
                <TextBox x:Name="textBoxValue" TextChanged="textBoxValue_TextChanged" Loaded="textBoxValue_Loaded"/>
           
</DataTemplate>
      
</telerik:GridViewColumn.CellTemplate>
    
</telerik:GridViewDataColumn>
  
</telerik:RadGridView.Columns>
</telerik:RadGridView>

So for every record displayed in the radGridView, "radComboOperations" is a radcombobox displayed in one cell template and "textBoxValue" is a textBox of the other cell template.

During the "_Loaded" operations of both controls I initialize properly the values must be displayed.
And there is no problem at all until now.

What do I have to do is to change Text or IsEnabled properties of "textBoxValue" of the corresponding Item ot the radGirdView, when a radComboOperations_SelectionChanged event of "radComboOperations" is raised.

The following is my function for the event

private void radComboOperations_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
   
RadComboBox comboBox = (RadComboBox)sender;
   
if (comboBox!=null)
   
{
        MyDTO dto = (MyDTO)comboBox.DataContext;
       
MyOperation Operation = (MyOperation)comboBox.SelectedItem;
       
if (Operation.Id == Guid.Empty)
        {
             //need help here where
            //I have to disable the textBoxValue of the corresponding item of the radGridView
            //where and how can I find the textBoxValue text box of the cell template??
        }
    }
}

I will thank a lot everyone may help me!!
Bye everybody
Nick

Nick
Top achievements
Rank 1
 answered on 16 Dec 2009
4 answers
409 views
All,

I am using WPF GridView and want to attach a ContextMenu with the GridView. What I want is that when user right-clicks any row a ContextMenu appears with various options like Edit, Delete etc.

I have added a ContextMenu to the RadGridView.ContextMenu however when I right-click on the row is de-selected and the menu appears.

I want to row to be selected and in the code want to get hold of the object bound to the that row.

I would really appreciate for any help.

Regards,
Tahir
Vlad
Telerik team
 answered on 16 Dec 2009
1 answer
180 views
Hello,
     I need to duplicate the selected row on the grid 1-N times. The duplicates will appear below the selected row. The grid is bound to a datatable in a dataset. The only way I've figured to do this is:

for (int i = 0; i <number of duplicates>; i++)
{
  Datarow dr = datatablename.NewRow();
  dr.ItemArray = datatablename.Rows[<position of row in grid to duplicate>].ItemArray;
  datatablename.Rows.InsertAt(dr, <position of row in grid to duplicate> + 1);
  dr = null;
}

Is this the correct way to duplicate rows?

Thanks
Vlad
Telerik team
 answered on 16 Dec 2009
1 answer
125 views
I'm having trouble with the RadNumericUpDown control.  I was able to boil it down to the following. 

1.  Create a Windows Application project
2.  Place a Element Host in the default form (Form1)
3.  Create a WPF UserControl.
4.  Place a RadNumericUpDown control in a UserControl:
<UserControl x:Class="UserControl1" 
   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"  
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    Height="300" Width="300"
    <Grid> 
        <Grid.RowDefinitions> 
            <RowDefinition Height="Auto"/> 
 
        </Grid.RowDefinitions> 
        <telerik:RadNumericUpDown Maximum="100" Minimum="0" IsInteger="True"/> 
 
 
    </Grid> 
</UserControl> 
 

5.  Place that UserControl in the Element Host
6.  Run the program.
7.  Attempt to click the up or down button in the RadNumericUpDown control. 
8.  Watch NullReferenceException occur. 

This works fine when run in a native WPF app, but fails when hosted in Winforms.

I've tried this with 2009Q2 and 2009Q3 builds. 

I'm currently on the trial for RadControls, and this is pretty much preventing me from completing my evaluation and ultimately purchasing the product. 
Boyan
Telerik team
 answered on 15 Dec 2009
1 answer
200 views
Hello,
is there a "today" Button in the DTPicker, which selects the current date?

Best regards,
Markus
Konstantina
Telerik team
 answered on 15 Dec 2009
3 answers
335 views
Hi,

I wanted to know if it is possible to display edit controls only when the mouse is over the row.

I mean by that that if there is a combobox in a cell, the combobox is not visible as long as i am not overing the mouse on a row.  Instead of the combobox, we should see the text only.  This allow to have a clean datagrid not clustered with tons of controls and, be able to edit easily with the mouse.

Thank you!
Tsvyatko
Telerik team
 answered on 15 Dec 2009
2 answers
85 views

I have a column with a checkbox in it which will reflect the selection status of the row. This column is added via the xmal and the other columns are binding to the data source.

 

Same implementation as the following link:

http://www.telerik.com/community/forums/wpf/gridview/button-and-checkbox-on-row.aspx

 

They work very well and only one issue for me. I can sort other columns by default, but nothing happen when I click the header of the checkbox column, neither the colour will change when I move the mouse over it like other columns.

 

Is it possible to sort the grid be selection status of the rows (true or false) when I click the header of this column, just like a REAL data column?

 

Many thanks!

John

allSEASON
Top achievements
Rank 1
 answered on 14 Dec 2009
7 answers
203 views

What event of the rad Carousel can I use to track the currently selected item’s index when it changes?

 

I need to track the selected item’s index in the Carousel control for both the mouse and keyboard whenever the Carousel item is changed to another item. For example, just like in a list box, the selected item changed event is raised letting you read the currently selected item’s index.

 

 

I noticed that the Carousel control has buttons that you can move to next, previous, last, first, etc. but there are no button click events for those buttons  on the Carousel control itself.

 

So again, I just need a way to perform the following task using a Carousel control event:

 

1.        The currently selected item changes to a new item

2.  I then can get the new selected item’s index of the Carousel control

 

 

And again, I need to do this task no matter if it is the keyboard, the mouse, the mouse wheel, the click of the mouse, etc. I just need an event to help me get the currently selected item’s index.

 

Note: I am not using the most recent version of the telerik controls. I think I am one or two versions prior.

 

Help!

 

Bill

Bill
Top achievements
Rank 1
 answered on 14 Dec 2009
4 answers
318 views
I'm having some problems with the IsHidden property of the RadPane. I cannot seem to get a RadPane to show again once the user has clicked the hide cross button.

I have tried doing the following:

  1. Have a RadPane in a RadDocking.
  2. Click the hide cross button.
  3. Have a menu item with an event handler in the code behind of the window.
  4. In the event handler:
    this.myRadPane.IsHidden = false

The IsHidden is set and is even serialized if I use SaveLayout() on the docking. But the panel doesn't show up. Am I missing something here?

Regards,
// Martin
Östemar
Top achievements
Rank 2
 answered on 14 Dec 2009
2 answers
157 views
I'm sorry for "Cross Posting" but I put this in the wrong forum originally
I'm using the numeric up down for several measurement entries, the user is able to use the "." key on the numeric keypad, but not the "." key on the alphabet keyboard (next to the "," key and the shift key).

is there a reason that the period key isn't allowed, and how do I get past it.  this is a big problem for my users, as they all use laptops with no "numeric keypad".
Is there a workaround?

Thank you

Joshua
joshua odell
Top achievements
Rank 1
 answered on 14 Dec 2009
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
SplashScreen
Callout
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?