Telerik Forums
UI for WPF Forum
1 answer
203 views

Hello,

I am currently working on a behavior that enables bulk editing functionality for the gridview.  I have a working prototype that hooks into the CellEditEnded event.  It seems to be a little bit hacky though, involving getting the binding path (args.Cell.DataColumn.DataMemberBinding.Path.Path), separating that out into one (or more) PropertyInfo element, then walking that dependency chain back and calling the final propertyInfo.SetValue(rowItem, newData) for each edited item.

I looked at other alternatives to this and found that the GridViewCell has a Value property.  Instead of going the reflection route, I tried to iterate down the rows / cells and set the value using the GridViewCell.Value property.  This does not propigate back to the bound object though or update the visual state.

Is there a way to programmatically set cell values without going the reflection route and having to reconstruct the binding?

Stefan
Telerik team
 answered on 28 May 2015
2 answers
235 views

Hello,

 

Can someone tell how to set GridViewDataColumn width to Auto in C#. Below is the sample code.

GridViewDataColumn firstName= new GridViewDataColumn();

firstName.Header = "FirstName";

firstName.Width=  Auto ?  //something like this?

 

 

Thanks,

Nalini

 

 

 

 

 

Nalini
Top achievements
Rank 1
 answered on 28 May 2015
1 answer
149 views

Hello,
I'm working on an app for my internship and I have to make a save / load the content when we open and close the application and we click on the button "save" and "load".
I watch many times your example and I do a lot of research on google and the forum but I don't know and I have no idea how to do the GetPageContent() method.

I know this method is specific but I would like you to send me an example in C # so I can get an idea of method to follow to implement this method.

Thank you very much in advance

Jéhan

Nasko
Telerik team
 answered on 28 May 2015
2 answers
140 views

Hello,

I was wondering, is it possible to add a new document to the document host but don't immediately make that new document active/visible? To clarify, the behavior I'm looking for is like in Chrome, when you middle-click a link, it opens the link in a new tab, but doesn't switch to it, it just opens it in the background.

What I'm trying to do is allow users to quickly open multiple tabs. This is tough to do when you have to keep switching back to the original tab that triggers the new tabs.

Thanks,

Joel

JP
Top achievements
Rank 1
 answered on 28 May 2015
1 answer
171 views


   <telerik:RadGridView Name="DataGrid"
ItemsSource="{Binding Data}" ScrollViewer.CanContentScroll="True"  

                                        ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Auto" Grid.Row="0"

                                        IsReadOnly="True"
IsFilteringAllowed="False" RowIndicatorVisibility="Collapsed" ShowGroupPanel="False"

                                        AutoGenerateColumns="False"   ShowColumnFooters="True"  AutoExpandGroups="True"
CanUserFreezeColumns="False"

              SelectionMode="Extended" SelectionUnit="FullRow"     ShowInsertRow="False"   CanUserInsertRows="False"
CanUserDeleteRows="False" CanUserReorderColumns="False"

                                         CanUserResizeColumns="False"
CanUserSortColumns="False"   >

 

 

                                <telerik:RadGridView.Columns>

 

 

                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Column1}" Header="Column1"   />

                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Column2}" Header="Column2" />

 

 

 

 

 

                                </telerik:RadGridView.Columns>

                                <telerik:RadGridView.GroupRowStyle>

                                    <Style TargetType="telerik:GridViewGroupRow">

                                        <Setter Property="ShowHeaderAggregates" Value="False"></Setter>

                                    </Style>

                                </telerik:RadGridView.GroupRowStyle>

                                <telerik:RadGridView.GroupHeaderTemplate>

                                    <DataTemplate>

                                        <StackPanel Orientation="Horizontal" Margin="0,0" Height="45">

                                            <TextBlock Text="{Binding Group.Key}" Margin="0,0,0,2" Width="200" />

                                            <telerik:AggregateResultsList ItemsSource="{Binding AggregateResults}" VerticalAlignment="Center">

                                               
<ItemsControl.ItemTemplate>

                                                    <DataTemplate>

                                                       
<StackPanel Orientation="Vertical" VerticalAlignment="Center">

                                                           
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Text="{Binding Caption}" Width="90" />

                                                           
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Text="{Binding FormattedValue}" Width="90"  />

                                                       
</StackPanel>

                                                   
</DataTemplate>

                                               
</ItemsControl.ItemTemplate>

                                                <ItemsControl.ItemsPanel>

                                                   
<ItemsPanelTemplate>

                                                       
<StackPanel Orientation="Horizontal"
/>

                                                 
  </ItemsPanelTemplate>

                                               
</ItemsControl.ItemsPanel>

                                            </telerik:AggregateResultsList>

                                        </StackPanel>

 

                                    </DataTemplate>

                                </telerik:RadGridView.GroupHeaderTemplate>

 

                                <telerik:RadGridView.GroupDescriptors>

                                    <telerik:GroupDescriptor x:Name="TransactionGroup" Member="Group1" SortDirection="Ascending"
>

                                        <telerik:GroupDescriptor.AggregateFunctions>

                                            <telerik:MinFunction SourceField="GroupHeader1"  Caption="GroupHeader1" />

                                            <telerik:MinFunction SourceField="GroupHeader2" Caption="GroupHeader2" />

                                        </telerik:GroupDescriptor.AggregateFunctions>

                                    </telerik:GroupDescriptor>

                                </telerik:RadGridView.GroupDescriptors>

 

 

                            </telerik:RadGridView>

 

 

 

 

Dimitrina
Telerik team
 answered on 28 May 2015
1 answer
228 views

Normally the pivot element has a parent and child (on expanding) and the parent is usually some kind of aggregation of all its children. I have a requirement where-in the parent should not  be an aggregation and its independent of children. Say parent has some 5000 value, upon expanding the value need not be a sum, it can be more than 5000.

 

Is this possible with Pivots or do I have to use any other controls?

Polya
Telerik team
 answered on 28 May 2015
3 answers
2.3K+ views

My Challenge:

I am trying to capture the selected row in a RadGridView which I would like to store in the database when the user exits the screen. When the user re-enters the screen I would like to programmatically select the row previously stored.

I set up a proof of concept using 2 Test buttons and a GridView:

Test 1 Button:
 - Get the selected row
 - Cast the selected row object to a string (which would be stored in the database)
 - Cast the string back to an object (simulate return from the database)
 - Add object to a list of objects
 - Clear selected items in the grid

Test 2 Button:
 - Execute the Select method on the GridView with the list of selected objects as an argument
 - Check the GridView SelectedItems count

Problem:
The select method executes but nothing happens. What am I missing? 

Sample Code:

private object rowObject = new object();
private List<object> rowList = new List<object>(); 

private void test1_Click(object sender, System.Windows.RoutedEventArgs e)
{
  if (ProjectListingGridView.SelectedItems.Count > 0)
  {
      var item = ProjectListingGridView.SelectedItem.ToString();

      if (item != null)
      {
        var rowObject = (object)item;
        rowList.Clear();
        rowList.Add(rowObject);
        }

      this.ProjectListingGridView.SelectedItems.Clear();
  }
}

private void test2_Click(object sender, System.Windows.RoutedEventArgs e)
{
  var selectList = rowList;

  try
  {
       ProjectListingGridView.Select(selectList);
  }
  catch (Exception)
  {
      throw;
  }
    var cnt = ProjectListingGridView.SelectedItems.Count;
}

Stefan
Telerik team
 answered on 28 May 2015
8 answers
603 views
The demo(GridView.WPF.Commands)  is what we want. But when I write code , I find the command is bind to "telerikGrid:RadGridViewCommands.BeginInsert" , which is compiled into Telerik.Windows.Controls.dll. It is not a custom command in viewmodel. So how can I add my custom logic (such as save to database) to these command?

your demo :
<StackPanel Orientation="Horizontal"
                    HorizontalAlignment="Center"
                    Margin="0,5,0,0">
            <telerik:RadButton Width="150"
                               Content="Delete selected rows"
                               Margin="0,0,5,0"
                               Command="telerikGrid:RadGridViewCommands.Delete"
                               CommandTarget="{Binding ElementName=RadGridView1}" />
            <telerik:RadButton Width="150"
                               Content="Add new row"
                               Margin="0,0,5,0"
                               Command="telerikGrid:RadGridViewCommands.BeginInsert"
                               CommandTarget="{Binding ElementName=RadGridView1}" />
            <telerik:RadButton Width="150"
                               Content="Save insert/edit"
                               Margin="0,0,5,0"
                               Command="telerikGrid:RadGridViewCommands.CommitEdit"
                               CommandTarget="{Binding ElementName=RadGridView1}" />
            <telerik:RadButton Width="150"
                               Content="Cancel insert/edit"
                               Command="telerikGrid:RadGridViewCommands.CancelRowEdit"
                               CommandTarget="{Binding ElementName=RadGridView1}" />
        </StackPanel>
Thomas
Top achievements
Rank 1
 answered on 28 May 2015
5 answers
179 views

Hello,

I'm missing a way to display a label for a GridLineAnnotation in a polar chart. What is the intended way to achieve this?
I would have created my own annotation type, but the necessary methods are all internal, so overriding is not possible.
Is there a reason why these are not declared as protected internal? (This would be helpful anyway, as I also also need
other annotation types which are not possible at the moment...)

Alex

Martin Ivanov
Telerik team
 answered on 28 May 2015
10 answers
1.7K+ views
Is there a way to set minimum/maximum width of RadPane. When I try to do that, that the RadPanes don't fill the complete space (see attached image). Also when I resize the window I want to be able to set RadPane's widths.

Other solution I have seen is that set the Realtive size of the RadPanes in a RadPaneGroup. However I have some windows, I want them to be of FixWidth/FixHeight, and with Resizing, I don't want them to change.

If you have an example, that illustrates different resizing options do let me know.
Kalin
Telerik team
 answered on 28 May 2015
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
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
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
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
InlineAIAssistant
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?