Telerik Forums
UI for WPF Forum
4 answers
325 views
Dear Sir,
I have an application which  loading UserControl Dynamically with code, inside the UserControl I have a RadGrdivView which contains a Checkbox Column, theis is the code i have:
Window:
-----

<Window x:Class="Window2"

 

 

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

 

 

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

 

 

Title="Window2" Height="300" Width="300" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">

 

 

 

<Grid>

 

 

 

<telerik:RadTabControl Name="RadTabControl1">

 

 

 

<telerik:RadTabItem Header="Tab1" Name="tb1">

 

 

 

 

</telerik:RadTabItem>

 

 

 

<telerik:RadTabItem Header="Tab2" Name="tb2">

 

 

 

</telerik:RadTabItem>

 

 

 

</telerik:RadTabControl>

 

 

 

</Grid>

 

</

 

Window>




 

Partial Public Class Window2

 

 

Private Sub Window2_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded

 

 

Dim db As New TeachersDataContext

 

 

Dim Te = (From t In db.Teachers Select t).ToList

 

 

 

For Each itm As Telerik.Windows.Controls.RadTabItem In RadTabControl1.Items

 

 

Dim uc As New UserControl1

 

uc.ds = Te

uc.SetDG()

itm.Content = uc

 

Next

 

 

 

 

 

End Sub

 

End

 

Class



UserControl:
----

<

 

UserControl x:Class="UserControl1"

 

 

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

 

 

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

 

 

xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">

 

 

 

<Grid>

 

 

 

 

<telerik:RadGridView Name="gvTeachers" telerik:StyleManager.Theme="Summer" AutoGenerateColumns="False" RowIndicatorVisibility="Collapsed" IsReadOnly="True" ShowGroupPanel="False">

 

 

 

<telerik:RadGridView.Columns>

 

 

 

<telerik:GridViewDataColumn Width="Auto">

 

 

 

<telerik:GridViewColumn.CellTemplate>

 

 

 

<DataTemplate>

 

 

 

<CheckBox Name="chkIs_Selected" Margin="3" IsChecked="True" ></CheckBox>

 

 

 

</DataTemplate>

 

 

 

</telerik:GridViewColumn.CellTemplate>

 

 

 

</telerik:GridViewDataColumn>

 

 

 

<telerik:GridViewDataColumn HeaderText="Teacher Name" HeaderTextAlignment="Center" Width="*">

 

 

 

<telerik:GridViewColumn.CellTemplate>

 

 

 

<DataTemplate>

 

 

 

<TextBlock Text="{Binding Teacher_Full_Name}"></TextBlock>

 

 

 

</DataTemplate>

 

 

 

</telerik:GridViewColumn.CellTemplate>

 

 

 

</telerik:GridViewDataColumn>

 

 

 

</telerik:RadGridView.Columns>

 

 

 

</telerik:RadGridView>

 

 

 

 

</Grid>

 

</

 

UserControl>

 



Partial

 

Public Class UserControl1

 

 

Private _ds As List(Of Teacher)

 

 

Public Property ds() As List(Of Teacher)

 

 

Get

 

 

Return _ds

 

 

End Get

 

 

Set(ByVal value As List(Of Teacher))

 

_ds = value

 

End Set

 

 

End Property

 

 

Public Sub SetDG()

 

gvTeachers.ItemsSource = _ds

 

End Sub

 

End

 

Class

 



The problem i have is:
when i run the application all the checkboxes is checked (which is the default state) but when i uncheck some of them and then swich to another tab all the checkboxes is returning to its original state (Checked).
I tried to simulate this issue without loading the UserControls at runtime (I put two RadGridVIews in the TabControl) and everyting is running OK,
Why this happing and if there is any way to solve this please tell me.

Thank you





 

 


 

 

 



UserControl
--------------

 

Sameh
Top achievements
Rank 1
 answered on 18 Jun 2009
3 answers
253 views

Hello, following the post:
http://www.telerik.com/community/forums/wpf/gridview/multi-line-header.aspx

I have a much more simple solution using escape chars, however

,as you can see by running the below example, when I add the
telerik:StyleManager.Theme="Simple"
the last text line of the header (ccc) is not displayed.

Is there a way to overcome it ?

Thanks,

Erez


<Window x:Class="ChangeTelerikGridHeaderSize.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Window1" Height="333" Width="582" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">

    <StackPanel Orientation="Horizontal">
        <telerik:RadGridView Name="radGridView1"
                             ShowGroupPanel="False">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn UniqueName="ABC" HeaderText="aaa&#13;bbb&#13;ccc" Width="Auto"/>
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>

        <telerik:RadGridView Name="radGridView2"
                             telerik:StyleManager.Theme="Simple"
                             ShowGroupPanel="False">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn UniqueName="ABC" HeaderText="aaa&#13;bbb&#13;ccc" Width="Auto"/>
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
    </StackPanel>
</Window>

Kalin Milanov
Telerik team
 answered on 18 Jun 2009
1 answer
108 views
Hi,

In my application,I have a combobox in a window, in which some numeric values are there to set zoom for the application.
when I Click on the combo box and than click on the restore button of the window, I get a window that ask for RadTreeViewItem.Events.cs file.

It gives follwing code at disassambly.

c:\Builds\WPF_Scrum\WPF_Team\Sources\Development\Silverlight\Telerik.Windows.Controls.Navigation\TreeView\RadTreeViewItem.Events.cs
00000000  push        ebp 
00000001  mov         ebp,esp
00000003  sub         esp,8
00000006  mov         dword ptr [ebp-8],ecx
00000009  mov         dword ptr [ebp-4],edx
0000000c  cmp         dword ptr ds:[075A0B60h],0
00000013  je          0000001A
00000015  call        6D42ADF1
0000001a  mov         ecx,dword ptr [ebp-8]
0000001d  xor         edx,edx
0000001f  call        005A8148
00000024  mov         ecx,dword ptr [ebp-8]
00000027  call        005A78F0
0000002c  nop             
0000002d  mov         esp,ebp
0000002f  pop         ebp 
00000030  ret         4 

after this my application get crash.Can anybody help me out to find the reason behind this.

***Application works well if Combo's IsEditable= False,but if it is True application gets crash.

Thanks,
Anshul
Miroslav Nedyalkov
Telerik team
 answered on 18 Jun 2009
3 answers
184 views
Hi
I have an async data source in my ViewModel class.
I want to force the grid to show it's animation.
I set that DataLoadMode property to Asynchronous but it's not working (the grid don't know that there is background operation)
How can I make it work?
(In silverlight it was IsBusy state but here it's readonly )
Thanks
Adiel
Adiel
Top achievements
Rank 2
 answered on 18 Jun 2009
5 answers
294 views
Hi

Is there any documentation on using this feature (I'm assuming this will allow us to show some animation whilst the grid is loading data)?
Milan
Telerik team
 answered on 18 Jun 2009
1 answer
540 views
                    <telerik:GridViewDataColumn Width="25">  
                        <telerik:GridViewDataColumn.CellStyle> 
                            <Style TargetType="telerik:GridViewCell">  
                                <Setter Property="Template">  
                                    <Setter.Value> 
                                        <ControlTemplate TargetType="telerik:GridViewCell">  
                                            <Button   
                                            Command="{Binding IngredientDeleteCommand}" 
                                            HorizontalAlignment="Center"   
                                            VerticalAlignment="Center">  
                                                <Image Height="20" Width="20" Source="/CakeBoss.WPF;component/Images/delete.png" /> 
                                            </Button> 
                                        </ControlTemplate> 
                                    </Setter.Value> 
                                </Setter> 
                            </Style> 
                        </telerik:GridViewDataColumn.CellStyle> 
                    </telerik:GridViewDataColumn> 

I've got a column that is for deleting a row, and I'm using MVVM so i'm binding to a command instead of using the click event on the button.  The command does not fire from inside the grid, but the Click event does.   If I copy the button outside the grid the button works just great.  Any clues?
Jon
Top achievements
Rank 1
 answered on 18 Jun 2009
3 answers
249 views
I am populating a treeview control from a database. I want to allow the user to drag and drop nodes to arrange the nodes in a sort order. I was trying to use the DragEnded event to get the new position in the tree and update the new position in the database. I thought I could use the IndexOf to get the new position in the tree the node is located. If I drag a root node the Items.IndexOf for the dragged node returns the correct position, lower level nodes return -1. The code I am using is as follows:

    Private Sub RadTreeView1_DragEnded(ByVal sender As ObjectByVal e As Telerik.Windows.Controls.RadTreeViewDragEndedEventArgs) Handles RadTreeView1.DragEnded  
 
        Dim newSortOrder As Integer 
        Dim parentId As Integer 
 
        Dim draggedItem As RadTreeViewItem = e.DraggedItems(0)  
        Dim eStore As eStoreDataDataContext = New eStoreDataDataContext  
 
        If IsNothing(draggedItem.ParentItem) Then 
            ' no parent then item is root node  
            parentId = 0  
        Else 
            parentId = draggedItem.ParentItem.Tag.ToString  
        End If 
 
        newSortOrder = RadTreeView1.Items.IndexOf(draggedItem)  
 
        MsgBox("parentId = " & parentId.ToString)  
        MsgBox("newSortOrder = " & newSortOrder.ToString)  
 
    End Sub 
 


 I am using the tag property to identify the parentId value in my database table. Does anyone know why the Items.IndexOf returns a number corresponding to the order the item is displayed in the tree for root node items and -1 for all other nodes?

Thanks.
Kiril Stanoev
Telerik team
 answered on 17 Jun 2009
1 answer
69 views

hi

I have a radgridview in this two column first column have string value and in second column  combo box contain list of string.When application run user select any value in combobox when save then i have two value one is string and another is string value which is select from combo box .how to iterate on radgridview,save values.how can i achieve this problem.please send an example. 
Stefan Dobrev
Telerik team
 answered on 16 Jun 2009
6 answers
351 views
Hey

How can I set ShowGroupPanel=False
in a child grid (when I use hirarchy)

Thanks
Rossen Hristov
Telerik team
 answered on 16 Jun 2009
3 answers
158 views
I see there's an API to scroll a record into view:

RadGridView.ItemsControl.BringRecordIntoView

But I also need the ability to insure that a specific cell is also in view (if the grid has horizontal scroll bars), but I see no public API to do this.

Milan
Telerik team
 answered on 16 Jun 2009
Narrow your results
Selected tags
Tags
+113 more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?